ndisc: Use compound literals to build redirect message.
Subsystems (3)
PATCH 19/19 ndisc: Use compound literals to build redirect message.
Signed-off-by YOSHIFUJI Hideaki <[email protected]>
--- net/ipv6/ndisc.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-)
net/ipv6/ndisc.c +8 -12
@@ -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
Signature · 1 line
1.7.9.5