* [PATCH 6/8] inetpeer: Add inet_getpeer_v6()
@ 2010-11-30 21:22 David Miller
0 siblings, 0 replies; only message in thread
From: David Miller @ 2010-11-30 21:22 UTC (permalink / raw)
To: netdev
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>
---
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 834f045..fb8aeb1 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);
--
1.7.3.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-11-30 21:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-30 21:22 [PATCH 6/8] inetpeer: Add inet_getpeer_v6() David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).