[IPV6]: Add ifindex field to ND user option messages.
authorPierre Ynard <linkfanel@yahoo.fr>
Tue, 13 Nov 2007 01:58:35 +0000 (17:58 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Nov 2007 01:58:35 +0000 (17:58 -0800)
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: Pierre Ynard <linkfanel@yahoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rtnetlink.h
net/ipv6/ndisc.c

index 5bf618241ab910eaf1c92a53026ccc672bf6165a..4e81836191df82ebaa5d8bf19e658ad29e92c16e 100644 (file)
@@ -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 */
 };
 
index 36f7dbfb6dbbd72cc36cca13157930c9fdc4915a..67997a74ddce15d85e43c8146a9ed62f91085f77 100644 (file)
@@ -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;