diff options
author | David S. Miller <davem@davemloft.net> | 2013-03-12 05:36:52 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-12 05:36:52 -0400 |
commit | 2230e0c1934af5779e6feda663b1b756cef7d3c2 (patch) | |
tree | 2f2aa510f4e9bed31bfbe37843982210c7511d69 /net | |
parent | 4660c7f498c07c43173142ea95145e9dac5a6d14 (diff) | |
parent | b47506d91259c29b9c75c404737eb6525556f9b4 (diff) | |
download | op-kernel-dev-2230e0c1934af5779e6feda663b1b756cef7d3c2.zip op-kernel-dev-2230e0c1934af5779e6feda663b1b756cef7d3c2.tar.gz |
Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge
Included changes ares:
- fix packet parsing routine to avoid to read beyond the packet boundary
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/batman-adv/bat_iv_ogm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index a0b253e..a5bb0a76 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c @@ -1288,7 +1288,8 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb, batadv_ogm_packet = (struct batadv_ogm_packet *)packet_buff; /* unpack the aggregated packets and process them one by one */ - do { + while (batadv_iv_ogm_aggr_packet(buff_pos, packet_len, + batadv_ogm_packet->tt_num_changes)) { tt_buff = packet_buff + buff_pos + BATADV_OGM_HLEN; batadv_iv_ogm_process(ethhdr, batadv_ogm_packet, tt_buff, @@ -1299,8 +1300,7 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb, packet_pos = packet_buff + buff_pos; batadv_ogm_packet = (struct batadv_ogm_packet *)packet_pos; - } while (batadv_iv_ogm_aggr_packet(buff_pos, packet_len, - batadv_ogm_packet->tt_num_changes)); + } kfree_skb(skb); return NET_RX_SUCCESS; |