diff options
author | Eric Dumazet <edumazet@google.com> | 2012-05-18 14:57:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-19 01:08:16 -0400 |
commit | a50feda546ac03415707a9bbcac8d6b20714db21 (patch) | |
tree | 3c1f5d64399e713c97545ca39984d4d2efe6ca5d /net/ipv6/icmp.c | |
parent | 32e9072b92a1c556a303d8d0e0d64feb667e601d (diff) |
ipv6: bool/const conversions phase2
Mostly bool conversions, some inline removals and const additions.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/icmp.c')
-rw-r--r-- | net/ipv6/icmp.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index 23c56ce9e86b..091a2971c7b7 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c | |||
@@ -131,7 +131,7 @@ void icmpv6_param_prob(struct sk_buff *skb, u8 code, int pos) | |||
131 | * --ANK (980726) | 131 | * --ANK (980726) |
132 | */ | 132 | */ |
133 | 133 | ||
134 | static int is_ineligible(struct sk_buff *skb) | 134 | static bool is_ineligible(const struct sk_buff *skb) |
135 | { | 135 | { |
136 | int ptr = (u8 *)(ipv6_hdr(skb) + 1) - skb->data; | 136 | int ptr = (u8 *)(ipv6_hdr(skb) + 1) - skb->data; |
137 | int len = skb->len - ptr; | 137 | int len = skb->len - ptr; |
@@ -139,11 +139,11 @@ static int is_ineligible(struct sk_buff *skb) | |||
139 | __be16 frag_off; | 139 | __be16 frag_off; |
140 | 140 | ||
141 | if (len < 0) | 141 | if (len < 0) |
142 | return 1; | 142 | return true; |
143 | 143 | ||
144 | ptr = ipv6_skip_exthdr(skb, ptr, &nexthdr, &frag_off); | 144 | ptr = ipv6_skip_exthdr(skb, ptr, &nexthdr, &frag_off); |
145 | if (ptr < 0) | 145 | if (ptr < 0) |
146 | return 0; | 146 | return false; |
147 | if (nexthdr == IPPROTO_ICMPV6) { | 147 | if (nexthdr == IPPROTO_ICMPV6) { |
148 | u8 _type, *tp; | 148 | u8 _type, *tp; |
149 | tp = skb_header_pointer(skb, | 149 | tp = skb_header_pointer(skb, |
@@ -151,9 +151,9 @@ static int is_ineligible(struct sk_buff *skb) | |||
151 | sizeof(_type), &_type); | 151 | sizeof(_type), &_type); |
152 | if (tp == NULL || | 152 | if (tp == NULL || |
153 | !(*tp & ICMPV6_INFOMSG_MASK)) | 153 | !(*tp & ICMPV6_INFOMSG_MASK)) |
154 | return 1; | 154 | return true; |
155 | } | 155 | } |
156 | return 0; | 156 | return false; |
157 | } | 157 | } |
158 | 158 | ||
159 | /* | 159 | /* |
@@ -208,14 +208,14 @@ static inline bool icmpv6_xrlim_allow(struct sock *sk, u8 type, | |||
208 | * highest-order two bits set to 10 | 208 | * highest-order two bits set to 10 |
209 | */ | 209 | */ |
210 | 210 | ||
211 | static __inline__ int opt_unrec(struct sk_buff *skb, __u32 offset) | 211 | static bool opt_unrec(struct sk_buff *skb, __u32 offset) |
212 | { | 212 | { |
213 | u8 _optval, *op; | 213 | u8 _optval, *op; |
214 | 214 | ||
215 | offset += skb_network_offset(skb); | 215 | offset += skb_network_offset(skb); |
216 | op = skb_header_pointer(skb, offset, sizeof(_optval), &_optval); | 216 | op = skb_header_pointer(skb, offset, sizeof(_optval), &_optval); |
217 | if (op == NULL) | 217 | if (op == NULL) |
218 | return 1; | 218 | return true; |
219 | return (*op & 0xC0) == 0x80; | 219 | return (*op & 0xC0) == 0x80; |
220 | } | 220 | } |
221 | 221 | ||