Re: [B.A.T.M.A.N.] bat_events: page allocation failure (batman-adv maint)

Andrew Lunn
2010-01-25T06:47:47Z

Staging: batman-adv: Fix skbuff leak in VIS code.

The vis code takes a copy of the data inside the skbuf if it is interesting
for us, so we always need to release the skbuf.

Reported-by: Linus Lüssing <linus.luessing@web.de>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>

Index: routing.c
===================================================================
--- routing.c (revision 1563)
+++ routing.c (working copy)
@@ -1135,21 +1135,22 @@
if (is_my_mac(vis_packet->sender_orig))
return NET_RX_DROP;

+ /* We take a copy of the data in the packet, so we should
+ always free the skbuf. */
+ ret = NET_RX_DROP;
+
switch (vis_packet->vis_type) {
case VIS_TYPE_SERVER_SYNC:
/* TODO: handle fragmented skbs properly */
receive_server_sync_packet(vis_packet, skb_headlen(skb));
- ret = NET_RX_SUCCESS;
break;

case VIS_TYPE_CLIENT_UPDATE:
/* TODO: handle fragmented skbs properly */
receive_client_update_packet(vis_packet, skb_headlen(skb));
- ret = NET_RX_SUCCESS;
break;

default: /* ignore unknown packet */
- ret = NET_RX_DROP;
break;
}
return ret;