Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

ndisc: Use compound literals to build redirect message.

parent 1cb3fe51
Loading
Loading
Loading
Loading
+8 −12
Original line number Diff line number Diff line
@@ -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