Commit 33be081a authored by Matthias Schiffer's avatar Matthias Schiffer Committed by David S. Miller

ipv6: ndisc: fix ndisc_send_redirect writing to the wrong skb

Since some refactoring in 5f5a0115, 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: default avatarMatthias Schiffer <mschiffer@universe-factory.net>
Reviewed-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 32de868c
...@@ -1493,7 +1493,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target) ...@@ -1493,7 +1493,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
*/ */
if (ha) 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. * build redirect option and copy skb over to the new packet.
......
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