[NETFILTER]: Remove useless comparisons before assignments

Remove unnecessary if() constructs before assignment.

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jan Engelhardt 2007-02-07 15:06:43 -08:00 committed by David S. Miller
parent a09113c2c8
commit 2822b0d926
6 changed files with 9 additions and 21 deletions

View File

@ -52,8 +52,7 @@ static unsigned int ip6t_hl_target(struct sk_buff **pskb,
break;
}
if (new_hl != ip6h->hop_limit)
ip6h->hop_limit = new_hl;
ip6h->hop_limit = new_hl;
return IP6T_CONTINUE;
}

View File

@ -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;
(*pskb)->priority = clinfo->priority;
return XT_CONTINUE;
}

View File

@ -61,7 +61,7 @@ target(struct sk_buff **pskb,
#else
nf_conntrack_event_cache(IPCT_MARK, *pskb);
#endif
}
}
break;
case XT_CONNMARK_SAVE:
newmark = (*ctmark & ~markinfo->mask) |
@ -78,8 +78,7 @@ target(struct sk_buff **pskb,
case XT_CONNMARK_RESTORE:
mark = (*pskb)->mark;
diff = (*ctmark ^ mark) & markinfo->mask;
if (diff != 0)
(*pskb)->mark = mark ^ diff;
(*pskb)->mark = mark ^ diff;
break;
}
}

View File

@ -41,8 +41,7 @@ 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;
*connsecmark = skb->secmark;
}
}
@ -58,8 +57,7 @@ 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;
skb->secmark = *connsecmark;
}
}

View File

@ -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;
(*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;
(*pskb)->mark = mark;
return XT_CONTINUE;
}

View File

@ -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;
(*pskb)->secmark = secmark;
return XT_CONTINUE;
}