On 16.03.2017 13:02, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Mar 16 10:02:45 2017 > New Revision: 315405 > URL: https://svnweb.freebsd.org/changeset/base/315405 > > Log: > Add helper function similar to ip_dev_find() to the LinuxKPI to lookup > a network device by its IPv6 address in the given VNET. > > +static inline struct net_device * > +ip6_dev_find(struct vnet *vnet, struct in6_addr addr) > +{ > + struct sockaddr_in6 sin6; > + struct ifaddr *ifa; > + struct ifnet *ifp; > + > + memset(&sin6, 0, sizeof(sin6)); > + sin6.sin6_addr = addr; > + sin6.sin6_len = sizeof(sin6); > + sin6.sin6_family = AF_INET6; > + CURVNET_SET_QUIET(vnet); > + ifa = ifa_ifwithaddr((struct sockaddr *)&sin6);
Hi Hans, There are at least two IPv6-specific functions to this task: in6ifa_ifwithaddr() and in6ifa_ifpwithaddr(). -- WBR, Andrey V. Elsukov
signature.asc
Description: OpenPGP digital signature