Commit 4d5c152e authored by YOSHIFUJI Hideaki / 吉藤英明's avatar YOSHIFUJI Hideaki / 吉藤英明 Committed by David S. Miller

ndisc: Use compound literals to build redirect message.

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1cb3fe51
...@@ -1481,18 +1481,14 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target) ...@@ -1481,18 +1481,14 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
if (!buff) if (!buff)
goto release; goto release;
skb_put(buff, sizeof(*msg)); msg = (struct rd_msg *)skb_put(buff, sizeof(*msg));
msg = (struct rd_msg *)icmp6_hdr(buff); *msg = (struct rd_msg) {
.icmph = {
memset(&msg->icmph, 0, sizeof(struct icmp6hdr)); .icmp6_type = NDISC_REDIRECT,
msg->icmph.icmp6_type = NDISC_REDIRECT; },
.target = *target,
/* .dest = ipv6_hdr(skb)->daddr,
* copy target and destination addresses };
*/
msg->target = *target;
msg->dest = ipv6_hdr(skb)->daddr;
/* /*
* include target_address option * include target_address option
......
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