Skip to contentSkip to conversation

ipv6: fix warning in xfrm6_mode_tunnel_input

PATCH Applied Stephen Hemminger 2 participants 4 messages Feb 16, 2013 – Feb 18, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipv6: fix warning in xfrm6_mode_tunnel_input

Should not use assignment in conditional:
warning: suggest parentheses around assignment used as truth value [-Wparentheses]

Problem introduced by:
commit 14bbd6a565e1bcdc240d44687edb93f721cfdf99

Author: Pravin B Shelar <[email protected]>
Date:   Thu Feb 14 09:44:49 2013 +0000

net: Add skb_unclone() helper function.

net/ipv6/xfrm6_mode_tunnel.c +2 -1
@@ -69,7 +69,8 @@ static int xfrm6_mode_tunnel_input(struc
 	if (!pskb_may_pull(skb, sizeof(struct ipv6hdr)))
 		goto out;
 
-	if (err = skb_unclone(skb, GFP_ATOMIC))
+	err = skb_unclone(skb, GFP_ATOMIC);
+	if (err)
 		goto out;
 
 	if (x->props.flags & XFRM_STATE_DECAP_DSCP)
#1 lore raw

PATCH 1/1 ip: fix warning in xfrm4_mode_tunnel_input

Same problem as IPv6

net/ipv4/xfrm4_mode_tunnel.c +2 -1
@@ -142,7 +142,8 @@ static int xfrm4_mode_tunnel_input(struc
 	for_each_input_rcu(rcv_notify_handlers, handler)
 		handler->handler(skb);
 
-	if (err = skb_unclone(skb, GFP_ATOMIC))
+	err = skb_unclone(skb, GFP_ATOMIC);
+	if (err)
 		goto out;
 
 	if (x->props.flags & XFRM_STATE_DECAP_DSCP)
maintainer Applied
#3 lore raw
In reply to Stephen Hemminger

From: Stephen Hemminger <[email protected]>
Date: Sat, 16 Feb 2013 09:38:15 -0800

Quoted 5 lines

Should not use assignment in conditional:
warning: suggest parentheses around assignment used as truth value [-Wparentheses]

Problem introduced by:
commit 14bbd6a565e1bcdc240d44687edb93f721cfdf99

Quoted 7 lines
Author: Pravin B Shelar <[email protected]>
Date:   Thu Feb 14 09:44:49 2013 +0000

net: Add skb_unclone() helper function.

Applied.