From: David S. Miller Date: Tue, 30 Nov 2010 20:20:00 +0000 (-0800) Subject: inetpeer: Add inet_getpeer_v6() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=672f007d65f50468a4a1e55825fe58e5b035324d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git inetpeer: Add inet_getpeer_v6() Now that all of the infrastructure is in place, we can add the ipv6 shorthand for peer creation. Signed-off-by: David S. Miller --- diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 834f0456c87e..fb8aeb1fd23f 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h @@ -11,6 +11,7 @@ #include #include #include +#include #include typedef struct { @@ -61,6 +62,15 @@ static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create) return inet_getpeer(&daddr, create); } +static inline struct inet_peer *inet_getpeer_v6(struct in6_addr *v6daddr, int create) +{ + inet_peer_address_t daddr; + + ipv6_addr_copy((struct in6_addr *)daddr.a6, v6daddr); + daddr.family = AF_INET6; + return inet_getpeer(&daddr, create); +} + /* can be called from BH context or outside */ extern void inet_putpeer(struct inet_peer *p);