diff options
author | Ian Morris <ipm@chirality.org.uk> | 2015-10-26 05:10:43 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2015-11-23 11:54:41 -0500 |
commit | c1bc1d257bd06943413f9b0e943028c028eb34a6 (patch) | |
tree | 17614200a01b1bd29234d0b25084a74105e0fd4b /net | |
parent | abcdd9a6239d42851faac86ba32158fbfee71b22 (diff) |
netfilter-bridge: layout of if statements
Eliminate some checkpatch issues by improved layout of if statements.
No changes detected by objdiff.
Signed-off-by: Ian Morris <ipm@chirality.org.uk>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/netfilter/ebt_ip6.c | 4 | ||||
-rw-r--r-- | net/bridge/netfilter/ebtables.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/net/bridge/netfilter/ebt_ip6.c b/net/bridge/netfilter/ebt_ip6.c index 17fd5f2cb4b8..98de6e7fd86d 100644 --- a/net/bridge/netfilter/ebt_ip6.c +++ b/net/bridge/netfilter/ebt_ip6.c | |||
@@ -65,8 +65,8 @@ ebt_ip6_mt(const struct sk_buff *skb, struct xt_action_param *par) | |||
65 | return false; | 65 | return false; |
66 | if (FWINV(info->protocol != nexthdr, EBT_IP6_PROTO)) | 66 | if (FWINV(info->protocol != nexthdr, EBT_IP6_PROTO)) |
67 | return false; | 67 | return false; |
68 | if (!(info->bitmask & ( EBT_IP6_DPORT | | 68 | if (!(info->bitmask & (EBT_IP6_DPORT | |
69 | EBT_IP6_SPORT | EBT_IP6_ICMP6))) | 69 | EBT_IP6_SPORT | EBT_IP6_ICMP6))) |
70 | return true; | 70 | return true; |
71 | 71 | ||
72 | /* min icmpv6 headersize is 4, so sizeof(_pkthdr) is ok. */ | 72 | /* min icmpv6 headersize is 4, so sizeof(_pkthdr) is ok. */ |
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index b13ea69c1bc1..67b2e27999aa 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c | |||
@@ -161,7 +161,7 @@ ebt_basic_match(const struct ebt_entry *e, const struct sk_buff *skb, | |||
161 | for (i = 0; i < 6; i++) | 161 | for (i = 0; i < 6; i++) |
162 | verdict |= (h->h_source[i] ^ e->sourcemac[i]) & | 162 | verdict |= (h->h_source[i] ^ e->sourcemac[i]) & |
163 | e->sourcemsk[i]; | 163 | e->sourcemsk[i]; |
164 | if (FWINV2(verdict != 0, EBT_ISOURCE) ) | 164 | if (FWINV2(verdict != 0, EBT_ISOURCE)) |
165 | return 1; | 165 | return 1; |
166 | } | 166 | } |
167 | if (e->bitmask & EBT_DESTMAC) { | 167 | if (e->bitmask & EBT_DESTMAC) { |
@@ -169,7 +169,7 @@ ebt_basic_match(const struct ebt_entry *e, const struct sk_buff *skb, | |||
169 | for (i = 0; i < 6; i++) | 169 | for (i = 0; i < 6; i++) |
170 | verdict |= (h->h_dest[i] ^ e->destmac[i]) & | 170 | verdict |= (h->h_dest[i] ^ e->destmac[i]) & |
171 | e->destmsk[i]; | 171 | e->destmsk[i]; |
172 | if (FWINV2(verdict != 0, EBT_IDEST) ) | 172 | if (FWINV2(verdict != 0, EBT_IDEST)) |
173 | return 1; | 173 | return 1; |
174 | } | 174 | } |
175 | return 0; | 175 | return 0; |
@@ -673,7 +673,7 @@ ebt_check_entry(struct ebt_entry *e, struct net *net, | |||
673 | BUGPRINT("Unknown flag for inv bitmask\n"); | 673 | BUGPRINT("Unknown flag for inv bitmask\n"); |
674 | return -EINVAL; | 674 | return -EINVAL; |
675 | } | 675 | } |
676 | if ( (e->bitmask & EBT_NOPROTO) && (e->bitmask & EBT_802_3) ) { | 676 | if ((e->bitmask & EBT_NOPROTO) && (e->bitmask & EBT_802_3)) { |
677 | BUGPRINT("NOPROTO & 802_3 not allowed\n"); | 677 | BUGPRINT("NOPROTO & 802_3 not allowed\n"); |
678 | return -EINVAL; | 678 | return -EINVAL; |
679 | } | 679 | } |
@@ -1370,7 +1370,7 @@ static inline int ebt_make_watchername(const struct ebt_entry_watcher *w, | |||
1370 | char name[EBT_FUNCTION_MAXNAMELEN] = {}; | 1370 | char name[EBT_FUNCTION_MAXNAMELEN] = {}; |
1371 | 1371 | ||
1372 | strlcpy(name, w->u.watcher->name, sizeof(name)); | 1372 | strlcpy(name, w->u.watcher->name, sizeof(name)); |
1373 | if (copy_to_user(hlp , name, EBT_FUNCTION_MAXNAMELEN)) | 1373 | if (copy_to_user(hlp, name, EBT_FUNCTION_MAXNAMELEN)) |
1374 | return -EFAULT; | 1374 | return -EFAULT; |
1375 | return 0; | 1375 | return 0; |
1376 | } | 1376 | } |