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

Commit dbb2ed24 authored by Pierre Ynard's avatar Pierre Ynard Committed by David S. Miller
Browse files

[IPV6]: Add ifindex field to ND user option messages.



Userland neighbor discovery options are typically heavily involved with
the interface on which thay are received: add a missing ifindex field to
the original struct. Thanks to Rémi Denis-Courmont.

Signed-off-by: default avatarPierre Ynard <linkfanel@yahoo.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 325d22df
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -491,9 +491,11 @@ struct nduseroptmsg
	unsigned char	nduseropt_family;
	unsigned char	nduseropt_pad1;
	unsigned short	nduseropt_opts_len;	/* Total length of options */
	int		nduseropt_ifindex;
	__u8		nduseropt_icmp_type;
	__u8		nduseropt_icmp_code;
	unsigned short	nduseropt_pad2;
	unsigned int	nduseropt_pad3;
	/* Followed by one or more ND options */
};

+1 −0
Original line number Diff line number Diff line
@@ -1037,6 +1037,7 @@ static void ndisc_ra_useropt(struct sk_buff *ra, struct nd_opt_hdr *opt)

	ndmsg = nlmsg_data(nlh);
	ndmsg->nduseropt_family = AF_INET6;
	ndmsg->nduseropt_ifindex = ra->dev->ifindex;
	ndmsg->nduseropt_icmp_type = icmp6h->icmp6_type;
	ndmsg->nduseropt_icmp_code = icmp6h->icmp6_code;
	ndmsg->nduseropt_opts_len = opt->nd_opt_len << 3;