summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-11-30 12:20:00 -0800
committerDavid S. Miller <davem@davemloft.net>2010-11-30 12:20:00 -0800
commit672f007d65f50468a4a1e55825fe58e5b035324d (patch)
tree1c4c74ed6cdc6881cccc1c24a97b8117efe93d6c /include/net
parent021e9299113363cc1b713f86b2cba30b8e6cb5dd (diff)
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 <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/inetpeer.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 834f0456c87..fb8aeb1fd23 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -11,6 +11,7 @@
#include <linux/init.h>
#include <linux/jiffies.h>
#include <linux/spinlock.h>
+#include <net/ipv6.h>
#include <asm/atomic.h>
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);