Author: marek Date: 2010-01-25 09:42:15 +0100 (Mon, 25 Jan 2010) New Revision: 1564
Modified: trunk/batman-adv-kernelland/routing.c Log: 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?\195?\188ssing linus.luessing@web.de Signed-off-by: Andrew Lunn andrew@lunn.ch
Modified: trunk/batman-adv-kernelland/routing.c =================================================================== --- trunk/batman-adv-kernelland/routing.c 2010-01-23 08:58:22 UTC (rev 1563) +++ trunk/batman-adv-kernelland/routing.c 2010-01-25 08:42:15 UTC (rev 1564) @@ -1116,7 +1116,6 @@ struct vis_packet *vis_packet; struct ethhdr *ethhdr; int hdr_size = sizeof(struct vis_packet); - int ret;
if (skb_headlen(skb) < hdr_size) return NET_RX_DROP; @@ -1139,18 +1138,18 @@ 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; + + /* We take a copy of the data in the packet, so we should + always free the skbuf. */ + return NET_RX_DROP; }