aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-06-09 22:12:36 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-09 22:12:36 -0400
commitc0efc887dcadbdbfe171f028acfab9c7c00e9dde (patch)
treed2f628d6c222c6328a6f310378d7227c32ebf183 /include/net
parent8b51b064a6da90c68af5385a874968829a2a0ed7 (diff)
inet: Pass inetpeer root into inet_getpeer*() interfaces.
Otherwise we reference potentially non-existing members when ipv6 is disabled. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/inetpeer.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 733edc641b76..b84b32fd5df1 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -83,11 +83,11 @@ static inline bool inet_metrics_new(const struct inet_peer *p)
83} 83}
84 84
85/* can be called with or without local BH being disabled */ 85/* can be called with or without local BH being disabled */
86struct inet_peer *inet_getpeer(struct net *net, 86struct inet_peer *inet_getpeer(struct inet_peer_base *base,
87 const struct inetpeer_addr *daddr, 87 const struct inetpeer_addr *daddr,
88 int create); 88 int create);
89 89
90static inline struct inet_peer *inet_getpeer_v4(struct net *net, 90static inline struct inet_peer *inet_getpeer_v4(struct inet_peer_base *base,
91 __be32 v4daddr, 91 __be32 v4daddr,
92 int create) 92 int create)
93{ 93{
@@ -95,10 +95,10 @@ static inline struct inet_peer *inet_getpeer_v4(struct net *net,
95 95
96 daddr.addr.a4 = v4daddr; 96 daddr.addr.a4 = v4daddr;
97 daddr.family = AF_INET; 97 daddr.family = AF_INET;
98 return inet_getpeer(net, &daddr, create); 98 return inet_getpeer(base, &daddr, create);
99} 99}
100 100
101static inline struct inet_peer *inet_getpeer_v6(struct net *net, 101static inline struct inet_peer *inet_getpeer_v6(struct inet_peer_base *base,
102 const struct in6_addr *v6daddr, 102 const struct in6_addr *v6daddr,
103 int create) 103 int create)
104{ 104{
@@ -106,7 +106,7 @@ static inline struct inet_peer *inet_getpeer_v6(struct net *net,
106 106
107 *(struct in6_addr *)daddr.addr.a6 = *v6daddr; 107 *(struct in6_addr *)daddr.addr.a6 = *v6daddr;
108 daddr.family = AF_INET6; 108 daddr.family = AF_INET6;
109 return inet_getpeer(net, &daddr, create); 109 return inet_getpeer(base, &daddr, create);
110} 110}
111 111
112/* can be called from BH context or outside */ 112/* can be called from BH context or outside */