提交 4d5c152e 编写于 作者: Y YOSHIFUJI Hideaki / 吉藤英明 提交者: David S. Miller

ndisc: Use compound literals to build redirect message.

Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1cb3fe51
......@@ -1481,18 +1481,14 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
if (!buff)
goto release;
skb_put(buff, sizeof(*msg));
msg = (struct rd_msg *)icmp6_hdr(buff);
memset(&msg->icmph, 0, sizeof(struct icmp6hdr));
msg->icmph.icmp6_type = NDISC_REDIRECT;
/*
* copy target and destination addresses
*/
msg->target = *target;
msg->dest = ipv6_hdr(skb)->daddr;
msg = (struct rd_msg *)skb_put(buff, sizeof(*msg));
*msg = (struct rd_msg) {
.icmph = {
.icmp6_type = NDISC_REDIRECT,
},
.target = *target,
.dest = ipv6_hdr(skb)->daddr,
};
/*
* include target_address option
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册