diff options
author | Martin Hundebøll <martin@hundeboll.net> | 2013-05-23 16:53:02 +0200 |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2013-10-12 11:58:34 +0200 |
commit | 610bfc6bc99bc83680d190ebc69359a05fc7f605 (patch) | |
tree | 355ae39e185e72ca129360037525fd5f7f5ff875 /net/batman-adv/main.c | |
parent | f097e25dbe9144447f46b6b61ca3da1a2ba432d4 (diff) |
batman-adv: Receive fragmented packets and merge
Fragments arriving at their destination are buffered for later merge.
Merged packets are passed to the main receive function as had they never
been fragmented.
Fragments are forwarded without merging if the MTU of the outgoing
interface is smaller than the size of the merged packet.
Signed-off-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Diffstat (limited to 'net/batman-adv/main.c')
-rw-r--r-- | net/batman-adv/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 8822fad5694e..ca6f1340d70c 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c @@ -40,6 +40,7 @@ #include "hash.h" #include "bat_algo.h" #include "network-coding.h" +#include "fragmentation.h" /* List manipulations on hardif_list have to be rtnl_lock()'ed, @@ -399,6 +400,7 @@ static void batadv_recv_handler_init(void) BUILD_BUG_ON(offsetof(struct batadv_unicast_4addr_packet, src) != 10); BUILD_BUG_ON(offsetof(struct batadv_unicast_packet, dest) != 4); BUILD_BUG_ON(offsetof(struct batadv_unicast_tvlv_packet, dst) != 4); + BUILD_BUG_ON(offsetof(struct batadv_frag_packet, dest) != 4); BUILD_BUG_ON(offsetof(struct batadv_icmp_packet, dst) != 4); BUILD_BUG_ON(offsetof(struct batadv_icmp_packet_rr, dst) != 4); @@ -414,6 +416,8 @@ static void batadv_recv_handler_init(void) batadv_rx_handler[BATADV_UNICAST_TVLV] = batadv_recv_unicast_tvlv; /* batman icmp packet */ batadv_rx_handler[BATADV_ICMP] = batadv_recv_icmp_packet; + /* Fragmented packets */ + batadv_rx_handler[BATADV_UNICAST_FRAG] = batadv_recv_frag_packet; } int |