]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ipv6: ndisc: fix ndisc_send_redirect writing to the wrong skb
authorMatthias Schiffer <mschiffer@universe-factory.net>
Fri, 31 May 2013 01:27:55 +0000 (03:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Jun 2013 05:59:12 +0000 (22:59 -0700)
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>
net/ipv6/ndisc.c

index 2712ab22a174087c09cc705e1f6adec2bd601154..ca4ffcc287f1ebbd3cdb5011660f385479d597d3 100644 (file)
@@ -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.