ipvs: Remove skb_sknet
This function adds no real value and it obscures what the code is doing. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: Simon Horman <horms@verge.net.au>
This commit is contained in:

committed by
Simon Horman

parent
7c6c21ee94
commit
9cfdd75b7c
@@ -38,28 +38,6 @@ static inline struct netns_ipvs *net_ipvs(struct net* net)
|
||||
return net->ipvs;
|
||||
}
|
||||
|
||||
static inline struct net *skb_sknet(const struct sk_buff *skb)
|
||||
{
|
||||
#ifdef CONFIG_NET_NS
|
||||
#ifdef CONFIG_IP_VS_DEBUG
|
||||
/* Start with the most likely hit */
|
||||
if (likely(skb->sk && sock_net(skb->sk)))
|
||||
return sock_net(skb->sk);
|
||||
WARN(skb->dev, "Maybe skb_net should be used instead in %s() line:%d\n",
|
||||
__func__, __LINE__);
|
||||
if (likely(skb->dev && dev_net(skb->dev)))
|
||||
return dev_net(skb->dev);
|
||||
pr_err("There is no net ptr to find in the skb in %s() line:%d\n",
|
||||
__func__, __LINE__);
|
||||
BUG();
|
||||
#else
|
||||
return sock_net(skb->sk);
|
||||
#endif
|
||||
#else
|
||||
return &init_net;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* This one needed for single_open_net since net is stored directly in
|
||||
* private not as a struct i.e. seq_file_net can't be used.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user