Message ID | 50D04BDD.3070203@linux-ipv6.org |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index e614388..232daea 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1469,8 +1469,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target) if (!buff) goto release; - skb_put(buff, sizeof(struct red_msg)); - msg = (struct red_msg *)icmp6_hdr(buff); + msg = (struct red_msg *)__skb_put(buff, sizeof(struct red_msg)); *msg = (struct red_msg) { .icmph = { .icmp6_type = NDISC_REDIRECT,
It is safe to use __skb_put() here and it returns buffer for ICMPv6 header. Let's use it. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> --- net/ipv6/ndisc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)