Commit 2822b0d9 authored by Jan Engelhardt's avatar Jan Engelhardt Committed by David S. Miller

[NETFILTER]: Remove useless comparisons before assignments

Remove unnecessary if() constructs before assignment.
Signed-off-by: default avatarJan Engelhardt <jengelh@gmx.de>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a09113c2
......@@ -52,7 +52,6 @@ static unsigned int ip6t_hl_target(struct sk_buff **pskb,
break;
}
if (new_hl != ip6h->hop_limit)
ip6h->hop_limit = new_hl;
return IP6T_CONTINUE;
......
......@@ -33,9 +33,7 @@ target(struct sk_buff **pskb,
{
const struct xt_classify_target_info *clinfo = targinfo;
if ((*pskb)->priority != clinfo->priority)
(*pskb)->priority = clinfo->priority;
return XT_CONTINUE;
}
......
......@@ -78,7 +78,6 @@ target(struct sk_buff **pskb,
case XT_CONNMARK_RESTORE:
mark = (*pskb)->mark;
diff = (*ctmark ^ mark) & markinfo->mask;
if (diff != 0)
(*pskb)->mark = mark ^ diff;
break;
}
......
......@@ -41,7 +41,6 @@ static void secmark_save(struct sk_buff *skb)
connsecmark = nf_ct_get_secmark(skb, &ctinfo);
if (connsecmark && !*connsecmark)
if (*connsecmark != skb->secmark)
*connsecmark = skb->secmark;
}
}
......@@ -58,7 +57,6 @@ static void secmark_restore(struct sk_buff *skb)
connsecmark = nf_ct_get_secmark(skb, &ctinfo);
if (connsecmark && *connsecmark)
if (skb->secmark != *connsecmark)
skb->secmark = *connsecmark;
}
}
......
......@@ -31,9 +31,7 @@ target_v0(struct sk_buff **pskb,
{
const struct xt_mark_target_info *markinfo = targinfo;
if((*pskb)->mark != markinfo->mark)
(*pskb)->mark = markinfo->mark;
return XT_CONTINUE;
}
......@@ -62,9 +60,7 @@ target_v1(struct sk_buff **pskb,
break;
}
if((*pskb)->mark != mark)
(*pskb)->mark = mark;
return XT_CONTINUE;
}
......
......@@ -47,9 +47,7 @@ static unsigned int target(struct sk_buff **pskb, const struct net_device *in,
BUG();
}
if ((*pskb)->secmark != secmark)
(*pskb)->secmark = secmark;
return XT_CONTINUE;
}
......
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