Skip to content

Commit

Permalink
ipv6: ndisc: fix ndisc_send_redirect writing to the wrong skb
Browse files Browse the repository at this point in the history
Since some refactoring in 5f5a011, ndisc_send_redirect called
ndisc_fill_redirect_hdr_option on the wrong skb, leading to data corruption or
in the worst case a panic when the skb_put failed.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Matthias Schiffer authored and David S. Miller committed Jun 18, 2013
1 parent 32de868 commit 33be081
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/ndisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
*/

if (ha)
ndisc_fill_addr_option(skb, ND_OPT_TARGET_LL_ADDR, ha);
ndisc_fill_addr_option(buff, ND_OPT_TARGET_LL_ADDR, ha);

/*
* build redirect option and copy skb over to the new packet.
Expand Down

0 comments on commit 33be081

Please sign in to comment.