diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2006-10-12 17:09:16 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-10-16 02:14:11 -0400 |
commit | 9ea8cfd6aa74e710f0cb0731ecb9dee53fbebfb9 (patch) | |
tree | 2aa6b78441cf0e5232b041d1afc5b9b54bd13f88 /net/netfilter | |
parent | 82b985434c5e9ceee772ca206889a856a7a4a200 (diff) |
[NETFILTER]: ctnetlink: Remove debugging messages
Remove (compilation-breaking) debugging messages introduced at early
development stage.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 72 |
1 files changed, 3 insertions, 69 deletions
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 1721f7c78c7..bd0156a28ec 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -47,13 +47,6 @@ MODULE_LICENSE("GPL"); | |||
47 | 47 | ||
48 | static char __initdata version[] = "0.93"; | 48 | static char __initdata version[] = "0.93"; |
49 | 49 | ||
50 | #if 0 | ||
51 | #define DEBUGP printk | ||
52 | #else | ||
53 | #define DEBUGP(format, args...) | ||
54 | #endif | ||
55 | |||
56 | |||
57 | static inline int | 50 | static inline int |
58 | ctnetlink_dump_tuples_proto(struct sk_buff *skb, | 51 | ctnetlink_dump_tuples_proto(struct sk_buff *skb, |
59 | const struct nf_conntrack_tuple *tuple, | 52 | const struct nf_conntrack_tuple *tuple, |
@@ -410,7 +403,6 @@ static int ctnetlink_done(struct netlink_callback *cb) | |||
410 | { | 403 | { |
411 | if (cb->args[1]) | 404 | if (cb->args[1]) |
412 | nf_ct_put((struct nf_conn *)cb->args[1]); | 405 | nf_ct_put((struct nf_conn *)cb->args[1]); |
413 | DEBUGP("entered %s\n", __FUNCTION__); | ||
414 | return 0; | 406 | return 0; |
415 | } | 407 | } |
416 | 408 | ||
@@ -425,9 +417,6 @@ ctnetlink_dump_table(struct sk_buff *skb, struct netlink_callback *cb) | |||
425 | struct nfgenmsg *nfmsg = NLMSG_DATA(cb->nlh); | 417 | struct nfgenmsg *nfmsg = NLMSG_DATA(cb->nlh); |
426 | u_int8_t l3proto = nfmsg->nfgen_family; | 418 | u_int8_t l3proto = nfmsg->nfgen_family; |
427 | 419 | ||
428 | DEBUGP("entered %s, last bucket=%lu id=%u\n", __FUNCTION__, | ||
429 | cb->args[0], *id); | ||
430 | |||
431 | read_lock_bh(&nf_conntrack_lock); | 420 | read_lock_bh(&nf_conntrack_lock); |
432 | last = (struct nf_conn *)cb->args[1]; | 421 | last = (struct nf_conn *)cb->args[1]; |
433 | for (; cb->args[0] < nf_conntrack_htable_size; cb->args[0]++) { | 422 | for (; cb->args[0] < nf_conntrack_htable_size; cb->args[0]++) { |
@@ -471,7 +460,6 @@ out: | |||
471 | if (last) | 460 | if (last) |
472 | nf_ct_put(last); | 461 | nf_ct_put(last); |
473 | 462 | ||
474 | DEBUGP("leaving, last bucket=%lu id=%u\n", cb->args[0], *id); | ||
475 | return skb->len; | 463 | return skb->len; |
476 | } | 464 | } |
477 | 465 | ||
@@ -482,8 +470,6 @@ ctnetlink_parse_tuple_ip(struct nfattr *attr, struct nf_conntrack_tuple *tuple) | |||
482 | struct nf_conntrack_l3proto *l3proto; | 470 | struct nf_conntrack_l3proto *l3proto; |
483 | int ret = 0; | 471 | int ret = 0; |
484 | 472 | ||
485 | DEBUGP("entered %s\n", __FUNCTION__); | ||
486 | |||
487 | nfattr_parse_nested(tb, CTA_IP_MAX, attr); | 473 | nfattr_parse_nested(tb, CTA_IP_MAX, attr); |
488 | 474 | ||
489 | l3proto = nf_ct_l3proto_find_get(tuple->src.l3num); | 475 | l3proto = nf_ct_l3proto_find_get(tuple->src.l3num); |
@@ -493,8 +479,6 @@ ctnetlink_parse_tuple_ip(struct nfattr *attr, struct nf_conntrack_tuple *tuple) | |||
493 | 479 | ||
494 | nf_ct_l3proto_put(l3proto); | 480 | nf_ct_l3proto_put(l3proto); |
495 | 481 | ||
496 | DEBUGP("leaving\n"); | ||
497 | |||
498 | return ret; | 482 | return ret; |
499 | } | 483 | } |
500 | 484 | ||
@@ -510,8 +494,6 @@ ctnetlink_parse_tuple_proto(struct nfattr *attr, | |||
510 | struct nf_conntrack_protocol *proto; | 494 | struct nf_conntrack_protocol *proto; |
511 | int ret = 0; | 495 | int ret = 0; |
512 | 496 | ||
513 | DEBUGP("entered %s\n", __FUNCTION__); | ||
514 | |||
515 | nfattr_parse_nested(tb, CTA_PROTO_MAX, attr); | 497 | nfattr_parse_nested(tb, CTA_PROTO_MAX, attr); |
516 | 498 | ||
517 | if (nfattr_bad_size(tb, CTA_PROTO_MAX, cta_min_proto)) | 499 | if (nfattr_bad_size(tb, CTA_PROTO_MAX, cta_min_proto)) |
@@ -538,8 +520,6 @@ ctnetlink_parse_tuple(struct nfattr *cda[], struct nf_conntrack_tuple *tuple, | |||
538 | struct nfattr *tb[CTA_TUPLE_MAX]; | 520 | struct nfattr *tb[CTA_TUPLE_MAX]; |
539 | int err; | 521 | int err; |
540 | 522 | ||
541 | DEBUGP("entered %s\n", __FUNCTION__); | ||
542 | |||
543 | memset(tuple, 0, sizeof(*tuple)); | 523 | memset(tuple, 0, sizeof(*tuple)); |
544 | 524 | ||
545 | nfattr_parse_nested(tb, CTA_TUPLE_MAX, cda[type-1]); | 525 | nfattr_parse_nested(tb, CTA_TUPLE_MAX, cda[type-1]); |
@@ -566,10 +546,6 @@ ctnetlink_parse_tuple(struct nfattr *cda[], struct nf_conntrack_tuple *tuple, | |||
566 | else | 546 | else |
567 | tuple->dst.dir = IP_CT_DIR_ORIGINAL; | 547 | tuple->dst.dir = IP_CT_DIR_ORIGINAL; |
568 | 548 | ||
569 | NF_CT_DUMP_TUPLE(tuple); | ||
570 | |||
571 | DEBUGP("leaving\n"); | ||
572 | |||
573 | return 0; | 549 | return 0; |
574 | } | 550 | } |
575 | 551 | ||
@@ -586,8 +562,6 @@ static int ctnetlink_parse_nat_proto(struct nfattr *attr, | |||
586 | struct nfattr *tb[CTA_PROTONAT_MAX]; | 562 | struct nfattr *tb[CTA_PROTONAT_MAX]; |
587 | struct ip_nat_protocol *npt; | 563 | struct ip_nat_protocol *npt; |
588 | 564 | ||
589 | DEBUGP("entered %s\n", __FUNCTION__); | ||
590 | |||
591 | nfattr_parse_nested(tb, CTA_PROTONAT_MAX, attr); | 565 | nfattr_parse_nested(tb, CTA_PROTONAT_MAX, attr); |
592 | 566 | ||
593 | if (nfattr_bad_size(tb, CTA_PROTONAT_MAX, cta_min_protonat)) | 567 | if (nfattr_bad_size(tb, CTA_PROTONAT_MAX, cta_min_protonat)) |
@@ -606,7 +580,6 @@ static int ctnetlink_parse_nat_proto(struct nfattr *attr, | |||
606 | 580 | ||
607 | ip_nat_proto_put(npt); | 581 | ip_nat_proto_put(npt); |
608 | 582 | ||
609 | DEBUGP("leaving\n"); | ||
610 | return 0; | 583 | return 0; |
611 | } | 584 | } |
612 | 585 | ||
@@ -622,8 +595,6 @@ ctnetlink_parse_nat(struct nfattr *nat, | |||
622 | struct nfattr *tb[CTA_NAT_MAX]; | 595 | struct nfattr *tb[CTA_NAT_MAX]; |
623 | int err; | 596 | int err; |
624 | 597 | ||
625 | DEBUGP("entered %s\n", __FUNCTION__); | ||
626 | |||
627 | memset(range, 0, sizeof(*range)); | 598 | memset(range, 0, sizeof(*range)); |
628 | 599 | ||
629 | nfattr_parse_nested(tb, CTA_NAT_MAX, nat); | 600 | nfattr_parse_nested(tb, CTA_NAT_MAX, nat); |
@@ -649,7 +620,6 @@ ctnetlink_parse_nat(struct nfattr *nat, | |||
649 | if (err < 0) | 620 | if (err < 0) |
650 | return err; | 621 | return err; |
651 | 622 | ||
652 | DEBUGP("leaving\n"); | ||
653 | return 0; | 623 | return 0; |
654 | } | 624 | } |
655 | #endif | 625 | #endif |
@@ -659,8 +629,6 @@ ctnetlink_parse_help(struct nfattr *attr, char **helper_name) | |||
659 | { | 629 | { |
660 | struct nfattr *tb[CTA_HELP_MAX]; | 630 | struct nfattr *tb[CTA_HELP_MAX]; |
661 | 631 | ||
662 | DEBUGP("entered %s\n", __FUNCTION__); | ||
663 | |||
664 | nfattr_parse_nested(tb, CTA_HELP_MAX, attr); | 632 | nfattr_parse_nested(tb, CTA_HELP_MAX, attr); |
665 | 633 | ||
666 | if (!tb[CTA_HELP_NAME-1]) | 634 | if (!tb[CTA_HELP_NAME-1]) |
@@ -690,8 +658,6 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
690 | u_int8_t u3 = nfmsg->nfgen_family; | 658 | u_int8_t u3 = nfmsg->nfgen_family; |
691 | int err = 0; | 659 | int err = 0; |
692 | 660 | ||
693 | DEBUGP("entered %s\n", __FUNCTION__); | ||
694 | |||
695 | if (nfattr_bad_size(cda, CTA_MAX, cta_min)) | 661 | if (nfattr_bad_size(cda, CTA_MAX, cta_min)) |
696 | return -EINVAL; | 662 | return -EINVAL; |
697 | 663 | ||
@@ -709,10 +675,8 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
709 | return err; | 675 | return err; |
710 | 676 | ||
711 | h = nf_conntrack_find_get(&tuple, NULL); | 677 | h = nf_conntrack_find_get(&tuple, NULL); |
712 | if (!h) { | 678 | if (!h) |
713 | DEBUGP("tuple not found in conntrack hash\n"); | ||
714 | return -ENOENT; | 679 | return -ENOENT; |
715 | } | ||
716 | 680 | ||
717 | ct = nf_ct_tuplehash_to_ctrack(h); | 681 | ct = nf_ct_tuplehash_to_ctrack(h); |
718 | 682 | ||
@@ -727,7 +691,6 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
727 | ct->timeout.function((unsigned long)ct); | 691 | ct->timeout.function((unsigned long)ct); |
728 | 692 | ||
729 | nf_ct_put(ct); | 693 | nf_ct_put(ct); |
730 | DEBUGP("leaving\n"); | ||
731 | 694 | ||
732 | return 0; | 695 | return 0; |
733 | } | 696 | } |
@@ -744,8 +707,6 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
744 | u_int8_t u3 = nfmsg->nfgen_family; | 707 | u_int8_t u3 = nfmsg->nfgen_family; |
745 | int err = 0; | 708 | int err = 0; |
746 | 709 | ||
747 | DEBUGP("entered %s\n", __FUNCTION__); | ||
748 | |||
749 | if (nlh->nlmsg_flags & NLM_F_DUMP) { | 710 | if (nlh->nlmsg_flags & NLM_F_DUMP) { |
750 | u32 rlen; | 711 | u32 rlen; |
751 | 712 | ||
@@ -779,11 +740,9 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
779 | return err; | 740 | return err; |
780 | 741 | ||
781 | h = nf_conntrack_find_get(&tuple, NULL); | 742 | h = nf_conntrack_find_get(&tuple, NULL); |
782 | if (!h) { | 743 | if (!h) |
783 | DEBUGP("tuple not found in conntrack hash"); | ||
784 | return -ENOENT; | 744 | return -ENOENT; |
785 | } | 745 | |
786 | DEBUGP("tuple found\n"); | ||
787 | ct = nf_ct_tuplehash_to_ctrack(h); | 746 | ct = nf_ct_tuplehash_to_ctrack(h); |
788 | 747 | ||
789 | err = -ENOMEM; | 748 | err = -ENOMEM; |
@@ -804,7 +763,6 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
804 | if (err < 0) | 763 | if (err < 0) |
805 | goto out; | 764 | goto out; |
806 | 765 | ||
807 | DEBUGP("leaving\n"); | ||
808 | return 0; | 766 | return 0; |
809 | 767 | ||
810 | free: | 768 | free: |
@@ -876,8 +834,6 @@ ctnetlink_change_helper(struct nf_conn *ct, struct nfattr *cda[]) | |||
876 | char *helpname; | 834 | char *helpname; |
877 | int err; | 835 | int err; |
878 | 836 | ||
879 | DEBUGP("entered %s\n", __FUNCTION__); | ||
880 | |||
881 | if (!help) { | 837 | if (!help) { |
882 | /* FIXME: we need to reallocate and rehash */ | 838 | /* FIXME: we need to reallocate and rehash */ |
883 | return -EBUSY; | 839 | return -EBUSY; |
@@ -954,8 +910,6 @@ ctnetlink_change_conntrack(struct nf_conn *ct, struct nfattr *cda[]) | |||
954 | { | 910 | { |
955 | int err; | 911 | int err; |
956 | 912 | ||
957 | DEBUGP("entered %s\n", __FUNCTION__); | ||
958 | |||
959 | if (cda[CTA_HELP-1]) { | 913 | if (cda[CTA_HELP-1]) { |
960 | err = ctnetlink_change_helper(ct, cda); | 914 | err = ctnetlink_change_helper(ct, cda); |
961 | if (err < 0) | 915 | if (err < 0) |
@@ -985,7 +939,6 @@ ctnetlink_change_conntrack(struct nf_conn *ct, struct nfattr *cda[]) | |||
985 | ct->mark = ntohl(*(u_int32_t *)NFA_DATA(cda[CTA_MARK-1])); | 939 | ct->mark = ntohl(*(u_int32_t *)NFA_DATA(cda[CTA_MARK-1])); |
986 | #endif | 940 | #endif |
987 | 941 | ||
988 | DEBUGP("all done\n"); | ||
989 | return 0; | 942 | return 0; |
990 | } | 943 | } |
991 | 944 | ||
@@ -997,8 +950,6 @@ ctnetlink_create_conntrack(struct nfattr *cda[], | |||
997 | struct nf_conn *ct; | 950 | struct nf_conn *ct; |
998 | int err = -EINVAL; | 951 | int err = -EINVAL; |
999 | 952 | ||
1000 | DEBUGP("entered %s\n", __FUNCTION__); | ||
1001 | |||
1002 | ct = nf_conntrack_alloc(otuple, rtuple); | 953 | ct = nf_conntrack_alloc(otuple, rtuple); |
1003 | if (ct == NULL || IS_ERR(ct)) | 954 | if (ct == NULL || IS_ERR(ct)) |
1004 | return -ENOMEM; | 955 | return -ENOMEM; |
@@ -1028,7 +979,6 @@ ctnetlink_create_conntrack(struct nfattr *cda[], | |||
1028 | add_timer(&ct->timeout); | 979 | add_timer(&ct->timeout); |
1029 | nf_conntrack_hash_insert(ct); | 980 | nf_conntrack_hash_insert(ct); |
1030 | 981 | ||
1031 | DEBUGP("conntrack with id %u inserted\n", ct->id); | ||
1032 | return 0; | 982 | return 0; |
1033 | 983 | ||
1034 | err: | 984 | err: |
@@ -1046,8 +996,6 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
1046 | u_int8_t u3 = nfmsg->nfgen_family; | 996 | u_int8_t u3 = nfmsg->nfgen_family; |
1047 | int err = 0; | 997 | int err = 0; |
1048 | 998 | ||
1049 | DEBUGP("entered %s\n", __FUNCTION__); | ||
1050 | |||
1051 | if (nfattr_bad_size(cda, CTA_MAX, cta_min)) | 999 | if (nfattr_bad_size(cda, CTA_MAX, cta_min)) |
1052 | return -EINVAL; | 1000 | return -EINVAL; |
1053 | 1001 | ||
@@ -1071,7 +1019,6 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
1071 | 1019 | ||
1072 | if (h == NULL) { | 1020 | if (h == NULL) { |
1073 | write_unlock_bh(&nf_conntrack_lock); | 1021 | write_unlock_bh(&nf_conntrack_lock); |
1074 | DEBUGP("no such conntrack, create new\n"); | ||
1075 | err = -ENOENT; | 1022 | err = -ENOENT; |
1076 | if (nlh->nlmsg_flags & NLM_F_CREATE) | 1023 | if (nlh->nlmsg_flags & NLM_F_CREATE) |
1077 | err = ctnetlink_create_conntrack(cda, &otuple, &rtuple); | 1024 | err = ctnetlink_create_conntrack(cda, &otuple, &rtuple); |
@@ -1087,7 +1034,6 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
1087 | 1034 | ||
1088 | /* We manipulate the conntrack inside the global conntrack table lock, | 1035 | /* We manipulate the conntrack inside the global conntrack table lock, |
1089 | * so there's no need to increase the refcount */ | 1036 | * so there's no need to increase the refcount */ |
1090 | DEBUGP("conntrack found\n"); | ||
1091 | err = -EEXIST; | 1037 | err = -EEXIST; |
1092 | if (!(nlh->nlmsg_flags & NLM_F_EXCL)) | 1038 | if (!(nlh->nlmsg_flags & NLM_F_EXCL)) |
1093 | err = ctnetlink_change_conntrack(nf_ct_tuplehash_to_ctrack(h), cda); | 1039 | err = ctnetlink_change_conntrack(nf_ct_tuplehash_to_ctrack(h), cda); |
@@ -1268,8 +1214,6 @@ ctnetlink_exp_dump_table(struct sk_buff *skb, struct netlink_callback *cb) | |||
1268 | struct nfgenmsg *nfmsg = NLMSG_DATA(cb->nlh); | 1214 | struct nfgenmsg *nfmsg = NLMSG_DATA(cb->nlh); |
1269 | u_int8_t l3proto = nfmsg->nfgen_family; | 1215 | u_int8_t l3proto = nfmsg->nfgen_family; |
1270 | 1216 | ||
1271 | DEBUGP("entered %s, last id=%llu\n", __FUNCTION__, *id); | ||
1272 | |||
1273 | read_lock_bh(&nf_conntrack_lock); | 1217 | read_lock_bh(&nf_conntrack_lock); |
1274 | list_for_each_prev(i, &nf_conntrack_expect_list) { | 1218 | list_for_each_prev(i, &nf_conntrack_expect_list) { |
1275 | exp = (struct nf_conntrack_expect *) i; | 1219 | exp = (struct nf_conntrack_expect *) i; |
@@ -1287,8 +1231,6 @@ ctnetlink_exp_dump_table(struct sk_buff *skb, struct netlink_callback *cb) | |||
1287 | out: | 1231 | out: |
1288 | read_unlock_bh(&nf_conntrack_lock); | 1232 | read_unlock_bh(&nf_conntrack_lock); |
1289 | 1233 | ||
1290 | DEBUGP("leaving, last id=%llu\n", *id); | ||
1291 | |||
1292 | return skb->len; | 1234 | return skb->len; |
1293 | } | 1235 | } |
1294 | 1236 | ||
@@ -1308,8 +1250,6 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb, | |||
1308 | u_int8_t u3 = nfmsg->nfgen_family; | 1250 | u_int8_t u3 = nfmsg->nfgen_family; |
1309 | int err = 0; | 1251 | int err = 0; |
1310 | 1252 | ||
1311 | DEBUGP("entered %s\n", __FUNCTION__); | ||
1312 | |||
1313 | if (nfattr_bad_size(cda, CTA_EXPECT_MAX, cta_min_exp)) | 1253 | if (nfattr_bad_size(cda, CTA_EXPECT_MAX, cta_min_exp)) |
1314 | return -EINVAL; | 1254 | return -EINVAL; |
1315 | 1255 | ||
@@ -1460,8 +1400,6 @@ ctnetlink_create_expect(struct nfattr *cda[], u_int8_t u3) | |||
1460 | struct nf_conn_help *help; | 1400 | struct nf_conn_help *help; |
1461 | int err = 0; | 1401 | int err = 0; |
1462 | 1402 | ||
1463 | DEBUGP("entered %s\n", __FUNCTION__); | ||
1464 | |||
1465 | /* caller guarantees that those three CTA_EXPECT_* exist */ | 1403 | /* caller guarantees that those three CTA_EXPECT_* exist */ |
1466 | err = ctnetlink_parse_tuple(cda, &tuple, CTA_EXPECT_TUPLE, u3); | 1404 | err = ctnetlink_parse_tuple(cda, &tuple, CTA_EXPECT_TUPLE, u3); |
1467 | if (err < 0) | 1405 | if (err < 0) |
@@ -1516,8 +1454,6 @@ ctnetlink_new_expect(struct sock *ctnl, struct sk_buff *skb, | |||
1516 | u_int8_t u3 = nfmsg->nfgen_family; | 1454 | u_int8_t u3 = nfmsg->nfgen_family; |
1517 | int err = 0; | 1455 | int err = 0; |
1518 | 1456 | ||
1519 | DEBUGP("entered %s\n", __FUNCTION__); | ||
1520 | |||
1521 | if (nfattr_bad_size(cda, CTA_EXPECT_MAX, cta_min_exp)) | 1457 | if (nfattr_bad_size(cda, CTA_EXPECT_MAX, cta_min_exp)) |
1522 | return -EINVAL; | 1458 | return -EINVAL; |
1523 | 1459 | ||
@@ -1546,8 +1482,6 @@ ctnetlink_new_expect(struct sock *ctnl, struct sk_buff *skb, | |||
1546 | err = ctnetlink_change_expect(exp, cda); | 1482 | err = ctnetlink_change_expect(exp, cda); |
1547 | write_unlock_bh(&nf_conntrack_lock); | 1483 | write_unlock_bh(&nf_conntrack_lock); |
1548 | 1484 | ||
1549 | DEBUGP("leaving\n"); | ||
1550 | |||
1551 | return err; | 1485 | return err; |
1552 | } | 1486 | } |
1553 | 1487 | ||