Commit 4e766f6c authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[NET]: More build fixes for CONFIG_XFRM disabled.

parent 385016f2
...@@ -562,6 +562,15 @@ secpath_put(struct sec_path *sp) ...@@ -562,6 +562,15 @@ secpath_put(struct sec_path *sp)
extern struct sec_path *secpath_dup(struct sec_path *src); extern struct sec_path *secpath_dup(struct sec_path *src);
static inline void
secpath_reset(struct sk_buff *skb)
{
#ifdef CONFIG_XFRM
secpath_put(skb->sp);
skb->sp = NULL;
#endif
}
static inline int static inline int
__xfrm4_state_addr_cmp(struct xfrm_tmpl *tmpl, struct xfrm_state *x) __xfrm4_state_addr_cmp(struct xfrm_tmpl *tmpl, struct xfrm_state *x)
{ {
......
...@@ -601,8 +601,7 @@ int ipgre_rcv(struct sk_buff *skb) ...@@ -601,8 +601,7 @@ int ipgre_rcv(struct sk_buff *skb)
read_lock(&ipgre_lock); read_lock(&ipgre_lock);
if ((tunnel = ipgre_tunnel_lookup(iph->saddr, iph->daddr, key)) != NULL) { if ((tunnel = ipgre_tunnel_lookup(iph->saddr, iph->daddr, key)) != NULL) {
secpath_put(skb->sp); secpath_reset(skb);
skb->sp = NULL;
skb->mac.raw = skb->nh.raw; skb->mac.raw = skb->nh.raw;
skb->nh.raw = __pskb_pull(skb, offset); skb->nh.raw = __pskb_pull(skb, offset);
......
...@@ -483,8 +483,7 @@ static int ipip_rcv(struct sk_buff *skb) ...@@ -483,8 +483,7 @@ static int ipip_rcv(struct sk_buff *skb)
return 0; return 0;
} }
secpath_put(skb->sp); secpath_reset(skb);
skb->sp = NULL;
skb->mac.raw = skb->nh.raw; skb->mac.raw = skb->nh.raw;
skb->nh.raw = skb->data; skb->nh.raw = skb->data;
......
...@@ -515,8 +515,7 @@ int ip6ip6_rcv(struct sk_buff **pskb, unsigned int *nhoffp) ...@@ -515,8 +515,7 @@ int ip6ip6_rcv(struct sk_buff **pskb, unsigned int *nhoffp)
read_unlock(&ip6ip6_lock); read_unlock(&ip6ip6_lock);
goto discard; goto discard;
} }
secpath_put(skb->sp); secpath_reset(skb);
skb->sp = NULL;
skb->mac.raw = skb->nh.raw; skb->mac.raw = skb->nh.raw;
skb->nh.raw = skb->data; skb->nh.raw = skb->data;
skb->protocol = htons(ETH_P_IPV6); skb->protocol = htons(ETH_P_IPV6);
......
...@@ -377,10 +377,7 @@ static int ipip6_rcv(struct sk_buff *skb) ...@@ -377,10 +377,7 @@ static int ipip6_rcv(struct sk_buff *skb)
read_lock(&ipip6_lock); read_lock(&ipip6_lock);
if ((tunnel = ipip6_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) { if ((tunnel = ipip6_tunnel_lookup(iph->saddr, iph->daddr)) != NULL) {
#ifdef CONFIG_XFRM secpath_reset(skb);
secpath_put(skb->sp);
skb->sp = NULL;
#endif
skb->mac.raw = skb->nh.raw; skb->mac.raw = skb->nh.raw;
skb->nh.raw = skb->data; skb->nh.raw = skb->data;
memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options)); memset(&(IPCB(skb)->opt), 0, sizeof(struct ip_options));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment