aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-07-01 05:43:06 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-01 19:11:15 -0400
commit181b1e9ce1b9e705d4cd27b542ce05bc43abdab0 (patch)
tree548d47da8a2fe693873e15b684c4abc63c9c6f81 /net/netfilter
parent1d67a51682443ffd1209d76dcc2f24a685259530 (diff)
netfilter: Reduce switch/case indent
Make the case labels the same indent as the switch. git diff -w shows miscellaneous 80 column wrapping, comment reflowing and a comment for a useless gcc warning for an otherwise unused default: case. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/xt_HL.c64
-rw-r--r--net/netfilter/xt_hl.c32
2 files changed, 48 insertions, 48 deletions
diff --git a/net/netfilter/xt_HL.c b/net/netfilter/xt_HL.c
index 95b084800fcc..1535e87ed9bd 100644
--- a/net/netfilter/xt_HL.c
+++ b/net/netfilter/xt_HL.c
@@ -38,22 +38,22 @@ ttl_tg(struct sk_buff *skb, const struct xt_action_param *par)
38 iph = ip_hdr(skb); 38 iph = ip_hdr(skb);
39 39
40 switch (info->mode) { 40 switch (info->mode) {
41 case IPT_TTL_SET: 41 case IPT_TTL_SET:
42 new_ttl = info->ttl; 42 new_ttl = info->ttl;
43 break; 43 break;
44 case IPT_TTL_INC: 44 case IPT_TTL_INC:
45 new_ttl = iph->ttl + info->ttl; 45 new_ttl = iph->ttl + info->ttl;
46 if (new_ttl > 255) 46 if (new_ttl > 255)
47 new_ttl = 255; 47 new_ttl = 255;
48 break; 48 break;
49 case IPT_TTL_DEC: 49 case IPT_TTL_DEC:
50 new_ttl = iph->ttl - info->ttl; 50 new_ttl = iph->ttl - info->ttl;
51 if (new_ttl < 0) 51 if (new_ttl < 0)
52 new_ttl = 0; 52 new_ttl = 0;
53 break; 53 break;
54 default: 54 default:
55 new_ttl = iph->ttl; 55 new_ttl = iph->ttl;
56 break; 56 break;
57 } 57 }
58 58
59 if (new_ttl != iph->ttl) { 59 if (new_ttl != iph->ttl) {
@@ -78,22 +78,22 @@ hl_tg6(struct sk_buff *skb, const struct xt_action_param *par)
78 ip6h = ipv6_hdr(skb); 78 ip6h = ipv6_hdr(skb);
79 79
80 switch (info->mode) { 80 switch (info->mode) {
81 case IP6T_HL_SET: 81 case IP6T_HL_SET:
82 new_hl = info->hop_limit; 82 new_hl = info->hop_limit;
83 break; 83 break;
84 case IP6T_HL_INC: 84 case IP6T_HL_INC:
85 new_hl = ip6h->hop_limit + info->hop_limit; 85 new_hl = ip6h->hop_limit + info->hop_limit;
86 if (new_hl > 255) 86 if (new_hl > 255)
87 new_hl = 255; 87 new_hl = 255;
88 break; 88 break;
89 case IP6T_HL_DEC: 89 case IP6T_HL_DEC:
90 new_hl = ip6h->hop_limit - info->hop_limit; 90 new_hl = ip6h->hop_limit - info->hop_limit;
91 if (new_hl < 0) 91 if (new_hl < 0)
92 new_hl = 0; 92 new_hl = 0;
93 break; 93 break;
94 default: 94 default:
95 new_hl = ip6h->hop_limit; 95 new_hl = ip6h->hop_limit;
96 break; 96 break;
97 } 97 }
98 98
99 ip6h->hop_limit = new_hl; 99 ip6h->hop_limit = new_hl;
diff --git a/net/netfilter/xt_hl.c b/net/netfilter/xt_hl.c
index 7d12221ead89..003951149c9e 100644
--- a/net/netfilter/xt_hl.c
+++ b/net/netfilter/xt_hl.c
@@ -31,14 +31,14 @@ static bool ttl_mt(const struct sk_buff *skb, struct xt_action_param *par)
31 const u8 ttl = ip_hdr(skb)->ttl; 31 const u8 ttl = ip_hdr(skb)->ttl;
32 32
33 switch (info->mode) { 33 switch (info->mode) {
34 case IPT_TTL_EQ: 34 case IPT_TTL_EQ:
35 return ttl == info->ttl; 35 return ttl == info->ttl;
36 case IPT_TTL_NE: 36 case IPT_TTL_NE:
37 return ttl != info->ttl; 37 return ttl != info->ttl;
38 case IPT_TTL_LT: 38 case IPT_TTL_LT:
39 return ttl < info->ttl; 39 return ttl < info->ttl;
40 case IPT_TTL_GT: 40 case IPT_TTL_GT:
41 return ttl > info->ttl; 41 return ttl > info->ttl;
42 } 42 }
43 43
44 return false; 44 return false;
@@ -50,14 +50,14 @@ static bool hl_mt6(const struct sk_buff *skb, struct xt_action_param *par)
50 const struct ipv6hdr *ip6h = ipv6_hdr(skb); 50 const struct ipv6hdr *ip6h = ipv6_hdr(skb);
51 51
52 switch (info->mode) { 52 switch (info->mode) {
53 case IP6T_HL_EQ: 53 case IP6T_HL_EQ:
54 return ip6h->hop_limit == info->hop_limit; 54 return ip6h->hop_limit == info->hop_limit;
55 case IP6T_HL_NE: 55 case IP6T_HL_NE:
56 return ip6h->hop_limit != info->hop_limit; 56 return ip6h->hop_limit != info->hop_limit;
57 case IP6T_HL_LT: 57 case IP6T_HL_LT:
58 return ip6h->hop_limit < info->hop_limit; 58 return ip6h->hop_limit < info->hop_limit;
59 case IP6T_HL_GT: 59 case IP6T_HL_GT:
60 return ip6h->hop_limit > info->hop_limit; 60 return ip6h->hop_limit > info->hop_limit;
61 } 61 }
62 62
63 return false; 63 return false;