diff options
author | David S. Miller <davem@davemloft.net> | 2010-11-30 15:20:00 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-30 15:20:00 -0500 |
commit | 672f007d65f50468a4a1e55825fe58e5b035324d (patch) | |
tree | 1c4c74ed6cdc6881cccc1c24a97b8117efe93d6c /include/net/inetpeer.h | |
parent | 021e9299113363cc1b713f86b2cba30b8e6cb5dd (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/inetpeer.h')
-rw-r--r-- | include/net/inetpeer.h | 10 |
1 files changed, 10 insertions, 0 deletions
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 @@ | |||
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
12 | #include <linux/jiffies.h> | 12 | #include <linux/jiffies.h> |
13 | #include <linux/spinlock.h> | 13 | #include <linux/spinlock.h> |
14 | #include <net/ipv6.h> | ||
14 | #include <asm/atomic.h> | 15 | #include <asm/atomic.h> |
15 | 16 | ||
16 | typedef struct { | 17 | typedef struct { |
@@ -61,6 +62,15 @@ static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create) | |||
61 | return inet_getpeer(&daddr, create); | 62 | return inet_getpeer(&daddr, create); |
62 | } | 63 | } |
63 | 64 | ||
65 | static inline struct inet_peer *inet_getpeer_v6(struct in6_addr *v6daddr, int create) | ||
66 | { | ||
67 | inet_peer_address_t daddr; | ||
68 | |||
69 | ipv6_addr_copy((struct in6_addr *)daddr.a6, v6daddr); | ||
70 | daddr.family = AF_INET6; | ||
71 | return inet_getpeer(&daddr, create); | ||
72 | } | ||
73 | |||
64 | /* can be called from BH context or outside */ | 74 | /* can be called from BH context or outside */ |
65 | extern void inet_putpeer(struct inet_peer *p); | 75 | extern void inet_putpeer(struct inet_peer *p); |
66 | 76 | ||