diff options
author | Patrick McHardy <kaber@trash.net> | 2008-01-15 02:47:09 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:02:36 -0500 |
commit | efe9f68afeaf2ce12636990a8c811fb1cc23b12b (patch) | |
tree | 0e37bbd059d1945edec0912aa4d82ef6045e1da1 /net | |
parent | b37e933ac7bdad2d587a6048babb8db2718460de (diff) |
[NETFILTER]: nf_conntrack_sctp: rename "newconntrack" variable
The name is misleading, it holds the new connection state, so rename it
to "newstate". Also rename "oldsctpstate" to "oldstate" for consistency.
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.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c index e52b6b95b304..7baabc045342 100644 --- a/net/netfilter/nf_conntrack_proto_sctp.c +++ b/net/netfilter/nf_conntrack_proto_sctp.c | |||
@@ -231,9 +231,9 @@ static int do_basic_checks(struct nf_conn *ct, | |||
231 | return count == 0; | 231 | return count == 0; |
232 | } | 232 | } |
233 | 233 | ||
234 | static int new_state(enum ip_conntrack_dir dir, | 234 | static int sctp_new_state(enum ip_conntrack_dir dir, |
235 | enum sctp_conntrack cur_state, | 235 | enum sctp_conntrack cur_state, |
236 | int chunk_type) | 236 | int chunk_type) |
237 | { | 237 | { |
238 | int i; | 238 | int i; |
239 | 239 | ||
@@ -299,7 +299,7 @@ static int sctp_packet(struct nf_conn *ct, | |||
299 | int pf, | 299 | int pf, |
300 | unsigned int hooknum) | 300 | unsigned int hooknum) |
301 | { | 301 | { |
302 | enum sctp_conntrack newconntrack, oldsctpstate; | 302 | enum sctp_conntrack new_state, old_state; |
303 | enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); | 303 | enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo); |
304 | sctp_sctphdr_t _sctph, *sh; | 304 | sctp_sctphdr_t _sctph, *sh; |
305 | sctp_chunkhdr_t _sch, *sch; | 305 | sctp_chunkhdr_t _sch, *sch; |
@@ -324,7 +324,7 @@ static int sctp_packet(struct nf_conn *ct, | |||
324 | goto out; | 324 | goto out; |
325 | } | 325 | } |
326 | 326 | ||
327 | oldsctpstate = newconntrack = SCTP_CONNTRACK_MAX; | 327 | old_state = new_state = SCTP_CONNTRACK_MAX; |
328 | for_each_sctp_chunk (skb, sch, _sch, offset, dataoff, count) { | 328 | for_each_sctp_chunk (skb, sch, _sch, offset, dataoff, count) { |
329 | write_lock_bh(&sctp_lock); | 329 | write_lock_bh(&sctp_lock); |
330 | 330 | ||
@@ -350,14 +350,14 @@ static int sctp_packet(struct nf_conn *ct, | |||
350 | goto out_unlock; | 350 | goto out_unlock; |
351 | } | 351 | } |
352 | 352 | ||
353 | oldsctpstate = ct->proto.sctp.state; | 353 | old_state = ct->proto.sctp.state; |
354 | newconntrack = new_state(dir, oldsctpstate, sch->type); | 354 | new_state = sctp_new_state(dir, old_state, sch->type); |
355 | 355 | ||
356 | /* Invalid */ | 356 | /* Invalid */ |
357 | if (newconntrack == SCTP_CONNTRACK_MAX) { | 357 | if (new_state == SCTP_CONNTRACK_MAX) { |
358 | pr_debug("nf_conntrack_sctp: Invalid dir=%i ctype=%u " | 358 | pr_debug("nf_conntrack_sctp: Invalid dir=%i ctype=%u " |
359 | "conntrack=%u\n", | 359 | "conntrack=%u\n", |
360 | dir, sch->type, oldsctpstate); | 360 | dir, sch->type, old_state); |
361 | goto out_unlock; | 361 | goto out_unlock; |
362 | } | 362 | } |
363 | 363 | ||
@@ -375,17 +375,17 @@ static int sctp_packet(struct nf_conn *ct, | |||
375 | ct->proto.sctp.vtag[!dir] = ih->init_tag; | 375 | ct->proto.sctp.vtag[!dir] = ih->init_tag; |
376 | } | 376 | } |
377 | 377 | ||
378 | ct->proto.sctp.state = newconntrack; | 378 | ct->proto.sctp.state = new_state; |
379 | if (oldsctpstate != newconntrack) | 379 | if (old_state != new_state) |
380 | nf_conntrack_event_cache(IPCT_PROTOINFO, skb); | 380 | nf_conntrack_event_cache(IPCT_PROTOINFO, skb); |
381 | write_unlock_bh(&sctp_lock); | 381 | write_unlock_bh(&sctp_lock); |
382 | } | 382 | } |
383 | 383 | ||
384 | nf_ct_refresh_acct(ct, ctinfo, skb, *sctp_timeouts[newconntrack]); | 384 | nf_ct_refresh_acct(ct, ctinfo, skb, *sctp_timeouts[new_state]); |
385 | 385 | ||
386 | if (oldsctpstate == SCTP_CONNTRACK_COOKIE_ECHOED && | 386 | if (old_state == SCTP_CONNTRACK_COOKIE_ECHOED && |
387 | dir == IP_CT_DIR_REPLY && | 387 | dir == IP_CT_DIR_REPLY && |
388 | newconntrack == SCTP_CONNTRACK_ESTABLISHED) { | 388 | new_state == SCTP_CONNTRACK_ESTABLISHED) { |
389 | pr_debug("Setting assured bit\n"); | 389 | pr_debug("Setting assured bit\n"); |
390 | set_bit(IPS_ASSURED_BIT, &ct->status); | 390 | set_bit(IPS_ASSURED_BIT, &ct->status); |
391 | nf_conntrack_event_cache(IPCT_STATUS, skb); | 391 | nf_conntrack_event_cache(IPCT_STATUS, skb); |
@@ -403,7 +403,7 @@ out: | |||
403 | static int sctp_new(struct nf_conn *ct, const struct sk_buff *skb, | 403 | static int sctp_new(struct nf_conn *ct, const struct sk_buff *skb, |
404 | unsigned int dataoff) | 404 | unsigned int dataoff) |
405 | { | 405 | { |
406 | enum sctp_conntrack newconntrack; | 406 | enum sctp_conntrack new_state; |
407 | sctp_sctphdr_t _sctph, *sh; | 407 | sctp_sctphdr_t _sctph, *sh; |
408 | sctp_chunkhdr_t _sch, *sch; | 408 | sctp_chunkhdr_t _sch, *sch; |
409 | u_int32_t offset, count; | 409 | u_int32_t offset, count; |
@@ -422,15 +422,15 @@ static int sctp_new(struct nf_conn *ct, const struct sk_buff *skb, | |||
422 | test_bit(SCTP_CID_COOKIE_ACK, map)) | 422 | test_bit(SCTP_CID_COOKIE_ACK, map)) |
423 | return 0; | 423 | return 0; |
424 | 424 | ||
425 | newconntrack = SCTP_CONNTRACK_MAX; | 425 | new_state = SCTP_CONNTRACK_MAX; |
426 | for_each_sctp_chunk (skb, sch, _sch, offset, dataoff, count) { | 426 | for_each_sctp_chunk (skb, sch, _sch, offset, dataoff, count) { |
427 | /* Don't need lock here: this conntrack not in circulation yet */ | 427 | /* Don't need lock here: this conntrack not in circulation yet */ |
428 | newconntrack = new_state(IP_CT_DIR_ORIGINAL, | 428 | new_state = sctp_new_state(IP_CT_DIR_ORIGINAL, |
429 | SCTP_CONNTRACK_NONE, sch->type); | 429 | SCTP_CONNTRACK_NONE, sch->type); |
430 | 430 | ||
431 | /* Invalid: delete conntrack */ | 431 | /* Invalid: delete conntrack */ |
432 | if (newconntrack == SCTP_CONNTRACK_NONE || | 432 | if (new_state == SCTP_CONNTRACK_NONE || |
433 | newconntrack == SCTP_CONNTRACK_MAX) { | 433 | new_state == SCTP_CONNTRACK_MAX) { |
434 | pr_debug("nf_conntrack_sctp: invalid new deleting.\n"); | 434 | pr_debug("nf_conntrack_sctp: invalid new deleting.\n"); |
435 | return 0; | 435 | return 0; |
436 | } | 436 | } |
@@ -463,7 +463,7 @@ static int sctp_new(struct nf_conn *ct, const struct sk_buff *skb, | |||
463 | ct->proto.sctp.vtag[IP_CT_DIR_REPLY] = sh->vtag; | 463 | ct->proto.sctp.vtag[IP_CT_DIR_REPLY] = sh->vtag; |
464 | } | 464 | } |
465 | 465 | ||
466 | ct->proto.sctp.state = newconntrack; | 466 | ct->proto.sctp.state = new_state; |
467 | } | 467 | } |
468 | 468 | ||
469 | return 1; | 469 | return 1; |