Commit 9061109a authored by Andreas Langer's avatar Andreas Langer Committed by Greg Kroah-Hartman

Staging: 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: default avatarAndreas Langer <an.langer@gmx.de>
Signed-off-by: default avatarSven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b8cd7544
...@@ -1165,6 +1165,12 @@ static int route_unicast_packet(struct sk_buff *skb, ...@@ -1165,6 +1165,12 @@ static int route_unicast_packet(struct sk_buff *skb,
unicast_packet = (struct unicast_packet *)skb->data; 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 */ /* decrement ttl */
unicast_packet->ttl--; unicast_packet->ttl--;
......
...@@ -206,8 +206,8 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv, ...@@ -206,8 +206,8 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
return ret; return ret;
} }
static int frag_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[]) struct batman_if *batman_if, uint8_t dstaddr[])
{ {
struct unicast_packet tmp_uc, *unicast_packet; struct unicast_packet tmp_uc, *unicast_packet;
struct sk_buff *frag_skb; struct sk_buff *frag_skb;
......
...@@ -29,5 +29,7 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv, ...@@ -29,5 +29,7 @@ int frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
struct sk_buff **new_skb); struct sk_buff **new_skb);
void frag_list_free(struct list_head *head); void frag_list_free(struct list_head *head);
int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv); 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_ */ #endif /* _NET_BATMAN_ADV_UNICAST_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment