svn commit: r315405 - head/sys/compat/linuxkpi/common/include/linux

Andrey V. Elsukov bu7cher at yandex.ru
Thu Mar 16 10:14:54 UTC 2017


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 553 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20170316/9032bc06/attachment.sig>


More information about the svn-src-head mailing list