aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/netfilter/ip6t_rt.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@gmx.de>2007-07-08 01:15:35 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-07-11 01:16:57 -0400
commit1d93a9cbad608f6398ba6c5b588c504ccd35a2ca (patch)
treedf02632a70f0438efb0e5baab9900f4f2acf98a1 /net/ipv6/netfilter/ip6t_rt.c
parentcff533ac12494fa002e2c46acc94d670e5f636a2 (diff)
[NETFILTER]: x_tables: switch xt_match->match to bool
Switch the return type of match functions to boolean 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/ipv6/netfilter/ip6t_rt.c')
-rw-r--r--net/ipv6/netfilter/ip6t_rt.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/net/ipv6/netfilter/ip6t_rt.c b/net/ipv6/netfilter/ip6t_rt.c
index 2bb88214cfd..7966f4a5e9b 100644
--- a/net/ipv6/netfilter/ip6t_rt.c
+++ b/net/ipv6/netfilter/ip6t_rt.c
@@ -31,10 +31,10 @@ MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>");
31#endif 31#endif
32 32
33/* Returns 1 if the id is matched by the range, 0 otherwise */ 33/* Returns 1 if the id is matched by the range, 0 otherwise */
34static inline int 34static inline bool
35segsleft_match(u_int32_t min, u_int32_t max, u_int32_t id, int invert) 35segsleft_match(u_int32_t min, u_int32_t max, u_int32_t id, bool invert)
36{ 36{
37 int r = 0; 37 bool r;
38 DEBUGP("rt segsleft_match:%c 0x%x <= 0x%x <= 0x%x", 38 DEBUGP("rt segsleft_match:%c 0x%x <= 0x%x <= 0x%x",
39 invert ? '!' : ' ', min, id, max); 39 invert ? '!' : ' ', min, id, max);
40 r = (id >= min && id <= max) ^ invert; 40 r = (id >= min && id <= max) ^ invert;
@@ -42,7 +42,7 @@ segsleft_match(u_int32_t min, u_int32_t max, u_int32_t id, int invert)
42 return r; 42 return r;
43} 43}
44 44
45static int 45static bool
46match(const struct sk_buff *skb, 46match(const struct sk_buff *skb,
47 const struct net_device *in, 47 const struct net_device *in,
48 const struct net_device *out, 48 const struct net_device *out,
@@ -57,7 +57,7 @@ match(const struct sk_buff *skb,
57 unsigned int temp; 57 unsigned int temp;
58 unsigned int ptr; 58 unsigned int ptr;
59 unsigned int hdrlen = 0; 59 unsigned int hdrlen = 0;
60 unsigned int ret = 0; 60 bool ret = false;
61 struct in6_addr *ap, _addr; 61 struct in6_addr *ap, _addr;
62 int err; 62 int err;
63 63
@@ -65,19 +65,19 @@ match(const struct sk_buff *skb,
65 if (err < 0) { 65 if (err < 0) {
66 if (err != -ENOENT) 66 if (err != -ENOENT)
67 *hotdrop = true; 67 *hotdrop = true;
68 return 0; 68 return false;
69 } 69 }
70 70
71 rh = skb_header_pointer(skb, ptr, sizeof(_route), &_route); 71 rh = skb_header_pointer(skb, ptr, sizeof(_route), &_route);
72 if (rh == NULL) { 72 if (rh == NULL) {
73 *hotdrop = true; 73 *hotdrop = true;
74 return 0; 74 return false;
75 } 75 }
76 76
77 hdrlen = ipv6_optlen(rh); 77 hdrlen = ipv6_optlen(rh);
78 if (skb->len - ptr < hdrlen) { 78 if (skb->len - ptr < hdrlen) {
79 /* Pcket smaller than its length field */ 79 /* Pcket smaller than its length field */
80 return 0; 80 return false;
81 } 81 }
82 82
83 DEBUGP("IPv6 RT LEN %u %u ", hdrlen, rh->hdrlen); 83 DEBUGP("IPv6 RT LEN %u %u ", hdrlen, rh->hdrlen);
@@ -136,7 +136,7 @@ match(const struct sk_buff *skb,
136 DEBUGP("Not strict "); 136 DEBUGP("Not strict ");
137 if (rtinfo->addrnr > (unsigned int)((hdrlen - 8) / 16)) { 137 if (rtinfo->addrnr > (unsigned int)((hdrlen - 8) / 16)) {
138 DEBUGP("There isn't enough space\n"); 138 DEBUGP("There isn't enough space\n");
139 return 0; 139 return false;
140 } else { 140 } else {
141 unsigned int i = 0; 141 unsigned int i = 0;
142 142
@@ -164,13 +164,13 @@ match(const struct sk_buff *skb,
164 if (i == rtinfo->addrnr) 164 if (i == rtinfo->addrnr)
165 return ret; 165 return ret;
166 else 166 else
167 return 0; 167 return false;
168 } 168 }
169 } else { 169 } else {
170 DEBUGP("Strict "); 170 DEBUGP("Strict ");
171 if (rtinfo->addrnr > (unsigned int)((hdrlen - 8) / 16)) { 171 if (rtinfo->addrnr > (unsigned int)((hdrlen - 8) / 16)) {
172 DEBUGP("There isn't enough space\n"); 172 DEBUGP("There isn't enough space\n");
173 return 0; 173 return false;
174 } else { 174 } else {
175 DEBUGP("#%d ", rtinfo->addrnr); 175 DEBUGP("#%d ", rtinfo->addrnr);
176 for (temp = 0; temp < rtinfo->addrnr; temp++) { 176 for (temp = 0; temp < rtinfo->addrnr; temp++) {
@@ -190,11 +190,11 @@ match(const struct sk_buff *skb,
190 (temp == (unsigned int)((hdrlen - 8) / 16))) 190 (temp == (unsigned int)((hdrlen - 8) / 16)))
191 return ret; 191 return ret;
192 else 192 else
193 return 0; 193 return false;
194 } 194 }
195 } 195 }
196 196
197 return 0; 197 return false;
198} 198}
199 199
200/* Called when user tries to insert an entry of this type. */ 200/* Called when user tries to insert an entry of this type. */