aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@linux-ipv6.org>2013-01-21 01:49:25 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-21 13:33:18 -0500
commit4d5c152e8694b57094e320060be4621dee5779dd (patch)
treea9b0846968a4df192ec7cb890b5a929c67b61a9d /net
parent1cb3fe513f62ca7c5963d551e01d75aa4f6ca72a (diff)
ndisc: Use compound literals to build redirect message.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/ndisc.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 1c015665ce71..76ef4353d518 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1481,18 +1481,14 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
1481 if (!buff) 1481 if (!buff)
1482 goto release; 1482 goto release;
1483 1483
1484 skb_put(buff, sizeof(*msg)); 1484 msg = (struct rd_msg *)skb_put(buff, sizeof(*msg));
1485 msg = (struct rd_msg *)icmp6_hdr(buff); 1485 *msg = (struct rd_msg) {
1486 1486 .icmph = {
1487 memset(&msg->icmph, 0, sizeof(struct icmp6hdr)); 1487 .icmp6_type = NDISC_REDIRECT,
1488 msg->icmph.icmp6_type = NDISC_REDIRECT; 1488 },
1489 1489 .target = *target,
1490 /* 1490 .dest = ipv6_hdr(skb)->daddr,
1491 * copy target and destination addresses 1491 };
1492 */
1493
1494 msg->target = *target;
1495 msg->dest = ipv6_hdr(skb)->daddr;
1496 1492
1497 /* 1493 /*
1498 * include target_address option 1494 * include target_address option