aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@gmx.de>2007-02-07 18:06:43 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-08 15:39:11 -0500
commit2822b0d92675cd8d4fc73112334f4b113ba7c979 (patch)
treeb4167e7664415b8c9331479eb7c3d65c25821156 /net
parenta09113c2c8ec59a5cc228efa5869aade2b8f13f7 (diff)
[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>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/netfilter/ip6t_HL.c3
-rw-r--r--net/netfilter/xt_CLASSIFY.c4
-rw-r--r--net/netfilter/xt_CONNMARK.c5
-rw-r--r--net/netfilter/xt_CONNSECMARK.c6
-rw-r--r--net/netfilter/xt_MARK.c8
-rw-r--r--net/netfilter/xt_SECMARK.c4
6 files changed, 9 insertions, 21 deletions
diff --git a/net/ipv6/netfilter/ip6t_HL.c b/net/ipv6/netfilter/ip6t_HL.c
index 435750f664dd..7e5d51386f56 100644
--- a/net/ipv6/netfilter/ip6t_HL.c
+++ b/net/ipv6/netfilter/ip6t_HL.c
@@ -52,8 +52,7 @@ static unsigned int ip6t_hl_target(struct sk_buff **pskb,
52 break; 52 break;
53 } 53 }
54 54
55 if (new_hl != ip6h->hop_limit) 55 ip6h->hop_limit = new_hl;
56 ip6h->hop_limit = new_hl;
57 56
58 return IP6T_CONTINUE; 57 return IP6T_CONTINUE;
59} 58}
diff --git a/net/netfilter/xt_CLASSIFY.c b/net/netfilter/xt_CLASSIFY.c
index 50de965bb104..195e92990da7 100644
--- a/net/netfilter/xt_CLASSIFY.c
+++ b/net/netfilter/xt_CLASSIFY.c
@@ -33,9 +33,7 @@ target(struct sk_buff **pskb,
33{ 33{
34 const struct xt_classify_target_info *clinfo = targinfo; 34 const struct xt_classify_target_info *clinfo = targinfo;
35 35
36 if ((*pskb)->priority != clinfo->priority) 36 (*pskb)->priority = clinfo->priority;
37 (*pskb)->priority = clinfo->priority;
38
39 return XT_CONTINUE; 37 return XT_CONTINUE;
40} 38}
41 39
diff --git a/net/netfilter/xt_CONNMARK.c b/net/netfilter/xt_CONNMARK.c
index 0534bfa65cce..795c058b16a5 100644
--- a/net/netfilter/xt_CONNMARK.c
+++ b/net/netfilter/xt_CONNMARK.c
@@ -61,7 +61,7 @@ target(struct sk_buff **pskb,
61#else 61#else
62 nf_conntrack_event_cache(IPCT_MARK, *pskb); 62 nf_conntrack_event_cache(IPCT_MARK, *pskb);
63#endif 63#endif
64 } 64 }
65 break; 65 break;
66 case XT_CONNMARK_SAVE: 66 case XT_CONNMARK_SAVE:
67 newmark = (*ctmark & ~markinfo->mask) | 67 newmark = (*ctmark & ~markinfo->mask) |
@@ -78,8 +78,7 @@ target(struct sk_buff **pskb,
78 case XT_CONNMARK_RESTORE: 78 case XT_CONNMARK_RESTORE:
79 mark = (*pskb)->mark; 79 mark = (*pskb)->mark;
80 diff = (*ctmark ^ mark) & markinfo->mask; 80 diff = (*ctmark ^ mark) & markinfo->mask;
81 if (diff != 0) 81 (*pskb)->mark = mark ^ diff;
82 (*pskb)->mark = mark ^ diff;
83 break; 82 break;
84 } 83 }
85 } 84 }
diff --git a/net/netfilter/xt_CONNSECMARK.c b/net/netfilter/xt_CONNSECMARK.c
index a3fe3c334b09..1ab0db641f96 100644
--- a/net/netfilter/xt_CONNSECMARK.c
+++ b/net/netfilter/xt_CONNSECMARK.c
@@ -41,8 +41,7 @@ static void secmark_save(struct sk_buff *skb)
41 41
42 connsecmark = nf_ct_get_secmark(skb, &ctinfo); 42 connsecmark = nf_ct_get_secmark(skb, &ctinfo);
43 if (connsecmark && !*connsecmark) 43 if (connsecmark && !*connsecmark)
44 if (*connsecmark != skb->secmark) 44 *connsecmark = skb->secmark;
45 *connsecmark = skb->secmark;
46 } 45 }
47} 46}
48 47
@@ -58,8 +57,7 @@ static void secmark_restore(struct sk_buff *skb)
58 57
59 connsecmark = nf_ct_get_secmark(skb, &ctinfo); 58 connsecmark = nf_ct_get_secmark(skb, &ctinfo);
60 if (connsecmark && *connsecmark) 59 if (connsecmark && *connsecmark)
61 if (skb->secmark != *connsecmark) 60 skb->secmark = *connsecmark;
62 skb->secmark = *connsecmark;
63 } 61 }
64} 62}
65 63
diff --git a/net/netfilter/xt_MARK.c b/net/netfilter/xt_MARK.c
index 0b48547e8d64..cfc45af357d5 100644
--- a/net/netfilter/xt_MARK.c
+++ b/net/netfilter/xt_MARK.c
@@ -31,9 +31,7 @@ target_v0(struct sk_buff **pskb,
31{ 31{
32 const struct xt_mark_target_info *markinfo = targinfo; 32 const struct xt_mark_target_info *markinfo = targinfo;
33 33
34 if((*pskb)->mark != markinfo->mark) 34 (*pskb)->mark = markinfo->mark;
35 (*pskb)->mark = markinfo->mark;
36
37 return XT_CONTINUE; 35 return XT_CONTINUE;
38} 36}
39 37
@@ -62,9 +60,7 @@ target_v1(struct sk_buff **pskb,
62 break; 60 break;
63 } 61 }
64 62
65 if((*pskb)->mark != mark) 63 (*pskb)->mark = mark;
66 (*pskb)->mark = mark;
67
68 return XT_CONTINUE; 64 return XT_CONTINUE;
69} 65}
70 66
diff --git a/net/netfilter/xt_SECMARK.c b/net/netfilter/xt_SECMARK.c
index add752196290..f1131c3a9db5 100644
--- a/net/netfilter/xt_SECMARK.c
+++ b/net/netfilter/xt_SECMARK.c
@@ -47,9 +47,7 @@ static unsigned int target(struct sk_buff **pskb, const struct net_device *in,
47 BUG(); 47 BUG();
48 } 48 }
49 49
50 if ((*pskb)->secmark != secmark) 50 (*pskb)->secmark = secmark;
51 (*pskb)->secmark = secmark;
52
53 return XT_CONTINUE; 51 return XT_CONTINUE;
54} 52}
55 53