aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2008-01-15 02:46:05 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:02:34 -0500
commit35c6d3cbe1b97b860087f6082e764ac8da2a12b2 (patch)
tree954973fc06badbba45a7428802253469e270c2f1 /net
parent5447d4777c48218e90844fa6f6e544119075faad (diff)
[NETFILTER]: nf_conntrack_sctp: use proper types for bitops
Use unsigned long instead of char for the bitmap and removed lots of casts. 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/netfilter/nf_conntrack_proto_sctp.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
index 689cc505bf6e..5166bb388ff0 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -195,7 +195,7 @@ for ((offset) = (dataoff) + sizeof(sctp_sctphdr_t), (count) = 0; \
195static int do_basic_checks(struct nf_conn *conntrack, 195static int do_basic_checks(struct nf_conn *conntrack,
196 const struct sk_buff *skb, 196 const struct sk_buff *skb,
197 unsigned int dataoff, 197 unsigned int dataoff,
198 char *map) 198 unsigned long *map)
199{ 199{
200 u_int32_t offset, count; 200 u_int32_t offset, count;
201 sctp_chunkhdr_t _sch, *sch; 201 sctp_chunkhdr_t _sch, *sch;
@@ -225,7 +225,7 @@ static int do_basic_checks(struct nf_conn *conntrack,
225 } 225 }
226 226
227 if (map) 227 if (map)
228 set_bit(sch->type, (void *)map); 228 set_bit(sch->type, map);
229 } 229 }
230 230
231 pr_debug("Basic checks passed\n"); 231 pr_debug("Basic checks passed\n");
@@ -304,7 +304,7 @@ static int sctp_packet(struct nf_conn *conntrack,
304 sctp_sctphdr_t _sctph, *sh; 304 sctp_sctphdr_t _sctph, *sh;
305 sctp_chunkhdr_t _sch, *sch; 305 sctp_chunkhdr_t _sch, *sch;
306 u_int32_t offset, count; 306 u_int32_t offset, count;
307 char map[256 / sizeof (char)] = {0}; 307 unsigned long map[256 / sizeof(unsigned long)] = { 0 };
308 308
309 sh = skb_header_pointer(skb, dataoff, sizeof(_sctph), &_sctph); 309 sh = skb_header_pointer(skb, dataoff, sizeof(_sctph), &_sctph);
310 if (sh == NULL) 310 if (sh == NULL)
@@ -314,11 +314,11 @@ static int sctp_packet(struct nf_conn *conntrack,
314 return -1; 314 return -1;
315 315
316 /* Check the verification tag (Sec 8.5) */ 316 /* Check the verification tag (Sec 8.5) */
317 if (!test_bit(SCTP_CID_INIT, (void *)map) && 317 if (!test_bit(SCTP_CID_INIT, map) &&
318 !test_bit(SCTP_CID_SHUTDOWN_COMPLETE, (void *)map) && 318 !test_bit(SCTP_CID_SHUTDOWN_COMPLETE, map) &&
319 !test_bit(SCTP_CID_COOKIE_ECHO, (void *)map) && 319 !test_bit(SCTP_CID_COOKIE_ECHO, map) &&
320 !test_bit(SCTP_CID_ABORT, (void *)map) && 320 !test_bit(SCTP_CID_ABORT, map) &&
321 !test_bit(SCTP_CID_SHUTDOWN_ACK, (void *)map) && 321 !test_bit(SCTP_CID_SHUTDOWN_ACK, map) &&
322 sh->vtag != conntrack->proto.sctp.vtag[CTINFO2DIR(ctinfo)]) { 322 sh->vtag != conntrack->proto.sctp.vtag[CTINFO2DIR(ctinfo)]) {
323 pr_debug("Verification tag check failed\n"); 323 pr_debug("Verification tag check failed\n");
324 return -1; 324 return -1;
@@ -413,7 +413,7 @@ static int sctp_new(struct nf_conn *conntrack, const struct sk_buff *skb,
413 sctp_sctphdr_t _sctph, *sh; 413 sctp_sctphdr_t _sctph, *sh;
414 sctp_chunkhdr_t _sch, *sch; 414 sctp_chunkhdr_t _sch, *sch;
415 u_int32_t offset, count; 415 u_int32_t offset, count;
416 char map[256 / sizeof (char)] = {0}; 416 unsigned long map[256 / sizeof(unsigned long)] = { 0 };
417 417
418 sh = skb_header_pointer(skb, dataoff, sizeof(_sctph), &_sctph); 418 sh = skb_header_pointer(skb, dataoff, sizeof(_sctph), &_sctph);
419 if (sh == NULL) 419 if (sh == NULL)
@@ -423,9 +423,9 @@ static int sctp_new(struct nf_conn *conntrack, const struct sk_buff *skb,
423 return 0; 423 return 0;
424 424
425 /* If an OOTB packet has any of these chunks discard (Sec 8.4) */ 425 /* If an OOTB packet has any of these chunks discard (Sec 8.4) */
426 if (test_bit (SCTP_CID_ABORT, (void *)map) || 426 if (test_bit(SCTP_CID_ABORT, map) ||
427 test_bit (SCTP_CID_SHUTDOWN_COMPLETE, (void *)map) || 427 test_bit(SCTP_CID_SHUTDOWN_COMPLETE, map) ||
428 test_bit (SCTP_CID_COOKIE_ACK, (void *)map)) 428 test_bit(SCTP_CID_COOKIE_ACK, map))
429 return 0; 429 return 0;
430 430
431 newconntrack = SCTP_CONNTRACK_MAX; 431 newconntrack = SCTP_CONNTRACK_MAX;