diff options
author | Patrick McHardy <kaber@trash.net> | 2008-04-14 05:15:52 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-04-14 05:15:52 -0400 |
commit | 5e8fbe2ac8a3f1e34e7004c5750ef59bf9304f82 (patch) | |
tree | 7a42f4fa1825e215e3ca3f2d3b2f66a865294ce0 /net/ipv4 | |
parent | 5f7da4d26d421f3bdf10c3bbdb86ffc3a12a84f2 (diff) |
[NETFILTER]: nf_conntrack: add tuplehash l3num/protonum accessors
Add accessors for l3num and protonum and get rid of some overly long
expressions.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c index e60b885d2dcd..40a46d482490 100644 --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c | |||
@@ -106,21 +106,16 @@ static int ct_seq_show(struct seq_file *s, void *v) | |||
106 | /* we only want to print DIR_ORIGINAL */ | 106 | /* we only want to print DIR_ORIGINAL */ |
107 | if (NF_CT_DIRECTION(hash)) | 107 | if (NF_CT_DIRECTION(hash)) |
108 | return 0; | 108 | return 0; |
109 | if (ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.l3num != AF_INET) | 109 | if (nf_ct_l3num(ct) != AF_INET) |
110 | return 0; | 110 | return 0; |
111 | 111 | ||
112 | l3proto = __nf_ct_l3proto_find(ct->tuplehash[IP_CT_DIR_ORIGINAL] | 112 | l3proto = __nf_ct_l3proto_find(nf_ct_l3num(ct)); |
113 | .tuple.src.l3num); | ||
114 | NF_CT_ASSERT(l3proto); | 113 | NF_CT_ASSERT(l3proto); |
115 | l4proto = __nf_ct_l4proto_find(ct->tuplehash[IP_CT_DIR_ORIGINAL] | 114 | l4proto = __nf_ct_l4proto_find(nf_ct_l3num(ct), nf_ct_protonum(ct)); |
116 | .tuple.src.l3num, | ||
117 | ct->tuplehash[IP_CT_DIR_ORIGINAL] | ||
118 | .tuple.dst.protonum); | ||
119 | NF_CT_ASSERT(l4proto); | 115 | NF_CT_ASSERT(l4proto); |
120 | 116 | ||
121 | if (seq_printf(s, "%-8s %u %ld ", | 117 | if (seq_printf(s, "%-8s %u %ld ", |
122 | l4proto->name, | 118 | l4proto->name, nf_ct_protonum(ct), |
123 | ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.protonum, | ||
124 | timer_pending(&ct->timeout) | 119 | timer_pending(&ct->timeout) |
125 | ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0) | 120 | ? (long)(ct->timeout.expires - jiffies)/HZ : 0) != 0) |
126 | return -ENOSPC; | 121 | return -ENOSPC; |