aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@computergmbh.de>2008-04-14 05:15:53 -0400
committerPatrick McHardy <kaber@trash.net>2008-04-14 05:15:53 -0400
commit5f2b4c9006fc667c4614f0b079efab3721f68316 (patch)
tree828631ee4bcbe4ba58ddfe24d95b2615f763c042 /net
parent09f263cd39751cada63dec2dccc71e67c00bc38c (diff)
[NETFILTER]: nf_conntrack: use bool type in struct nf_conntrack_tuple.h
Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nf_conntrack_core.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 21ab0c3846ac..a3fe9db412d3 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -94,7 +94,7 @@ static inline u_int32_t hash_conntrack(const struct nf_conntrack_tuple *tuple)
94 nf_conntrack_hash_rnd); 94 nf_conntrack_hash_rnd);
95} 95}
96 96
97int 97bool
98nf_ct_get_tuple(const struct sk_buff *skb, 98nf_ct_get_tuple(const struct sk_buff *skb,
99 unsigned int nhoff, 99 unsigned int nhoff,
100 unsigned int dataoff, 100 unsigned int dataoff,
@@ -108,7 +108,7 @@ nf_ct_get_tuple(const struct sk_buff *skb,
108 108
109 tuple->src.l3num = l3num; 109 tuple->src.l3num = l3num;
110 if (l3proto->pkt_to_tuple(skb, nhoff, tuple) == 0) 110 if (l3proto->pkt_to_tuple(skb, nhoff, tuple) == 0)
111 return 0; 111 return false;
112 112
113 tuple->dst.protonum = protonum; 113 tuple->dst.protonum = protonum;
114 tuple->dst.dir = IP_CT_DIR_ORIGINAL; 114 tuple->dst.dir = IP_CT_DIR_ORIGINAL;
@@ -117,10 +117,8 @@ nf_ct_get_tuple(const struct sk_buff *skb,
117} 117}
118EXPORT_SYMBOL_GPL(nf_ct_get_tuple); 118EXPORT_SYMBOL_GPL(nf_ct_get_tuple);
119 119
120int nf_ct_get_tuplepr(const struct sk_buff *skb, 120bool nf_ct_get_tuplepr(const struct sk_buff *skb, unsigned int nhoff,
121 unsigned int nhoff, 121 u_int16_t l3num, struct nf_conntrack_tuple *tuple)
122 u_int16_t l3num,
123 struct nf_conntrack_tuple *tuple)
124{ 122{
125 struct nf_conntrack_l3proto *l3proto; 123 struct nf_conntrack_l3proto *l3proto;
126 struct nf_conntrack_l4proto *l4proto; 124 struct nf_conntrack_l4proto *l4proto;
@@ -134,7 +132,7 @@ int nf_ct_get_tuplepr(const struct sk_buff *skb,
134 ret = l3proto->get_l4proto(skb, nhoff, &protoff, &protonum); 132 ret = l3proto->get_l4proto(skb, nhoff, &protoff, &protonum);
135 if (ret != NF_ACCEPT) { 133 if (ret != NF_ACCEPT) {
136 rcu_read_unlock(); 134 rcu_read_unlock();
137 return 0; 135 return false;
138 } 136 }
139 137
140 l4proto = __nf_ct_l4proto_find(l3num, protonum); 138 l4proto = __nf_ct_l4proto_find(l3num, protonum);
@@ -147,7 +145,7 @@ int nf_ct_get_tuplepr(const struct sk_buff *skb,
147} 145}
148EXPORT_SYMBOL_GPL(nf_ct_get_tuplepr); 146EXPORT_SYMBOL_GPL(nf_ct_get_tuplepr);
149 147
150int 148bool
151nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse, 149nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
152 const struct nf_conntrack_tuple *orig, 150 const struct nf_conntrack_tuple *orig,
153 const struct nf_conntrack_l3proto *l3proto, 151 const struct nf_conntrack_l3proto *l3proto,
@@ -157,7 +155,7 @@ nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse,
157 155
158 inverse->src.l3num = orig->src.l3num; 156 inverse->src.l3num = orig->src.l3num;
159 if (l3proto->invert_tuple(inverse, orig) == 0) 157 if (l3proto->invert_tuple(inverse, orig) == 0)
160 return 0; 158 return false;
161 159
162 inverse->dst.dir = !orig->dst.dir; 160 inverse->dst.dir = !orig->dst.dir;
163 161
@@ -738,10 +736,10 @@ nf_conntrack_in(int pf, unsigned int hooknum, struct sk_buff *skb)
738} 736}
739EXPORT_SYMBOL_GPL(nf_conntrack_in); 737EXPORT_SYMBOL_GPL(nf_conntrack_in);
740 738
741int nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse, 739bool nf_ct_invert_tuplepr(struct nf_conntrack_tuple *inverse,
742 const struct nf_conntrack_tuple *orig) 740 const struct nf_conntrack_tuple *orig)
743{ 741{
744 int ret; 742 bool ret;
745 743
746 rcu_read_lock(); 744 rcu_read_lock();
747 ret = nf_ct_invert_tuple(inverse, orig, 745 ret = nf_ct_invert_tuple(inverse, orig,