The following commit has been merged in the next branch: commit 9234184a25981daaa04efd279d36896eb32e8d44 Author: Andreas Langer an.langer@gmx.de Date: Sat Sep 25 10:06:52 2010 +0000
batman-adv: fragment forwarded packets
If a packet is too big to be forwarded over an interface it will be fragmented on-the-fly (if fragmentation is enabled).
Signed-off-by: Andreas Langer an.langer@gmx.de Signed-off-by: Sven Eckelmann sven.eckelmann@gmx.de
diff --git a/routing.c b/routing.c index 685edfd..9289a91 100644 --- a/routing.c +++ b/routing.c @@ -1166,6 +1166,12 @@ static int route_unicast_packet(struct sk_buff *skb,
unicast_packet = (struct unicast_packet *)skb->data;
+ if (unicast_packet->packet_type == BAT_UNICAST && + atomic_read(&bat_priv->frag_enabled) && + skb->len > batman_if->net_dev->mtu) + return frag_send_skb(skb, bat_priv, batman_if, + dstaddr); + /* decrement ttl */ unicast_packet->ttl--;
diff --git a/unicast.h b/unicast.h index 5908b01..e32b786 100644 --- a/unicast.h +++ b/unicast.h @@ -29,5 +29,7 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv, struct sk_buff **new_skb); void frag_list_free(struct list_head *head); int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv); +int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, + struct batman_if *batman_if, uint8_t dstaddr[]);
#endif /* _NET_BATMAN_ADV_UNICAST_H_ */