diff options
author | Gao Feng <fgao@ikuai8.com> | 2017-03-27 23:12:08 +0800 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-04-06 22:01:38 +0200 |
commit | cba81cc4c95fefa4805163bb19c0f43d2a8ca52c (patch) | |
tree | 315bc9c377c4b17ae9aedf06ae6e2b97b6d85431 /net/netfilter/nf_nat_amanda.c | |
parent | ec0e3f01114ad327112432a4da8840eb22fed577 (diff) | |
download | op-kernel-dev-cba81cc4c95fefa4805163bb19c0f43d2a8ca52c.zip op-kernel-dev-cba81cc4c95fefa4805163bb19c0f43d2a8ca52c.tar.gz |
netfilter: nat: nf_nat_mangle_{udp,tcp}_packet returns boolean
nf_nat_mangle_{udp,tcp}_packet() returns int. However, it is used as
bool type in many spots. Fix this by consistently handle this return
value as a boolean.
Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_nat_amanda.c')
-rw-r--r-- | net/netfilter/nf_nat_amanda.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/netfilter/nf_nat_amanda.c b/net/netfilter/nf_nat_amanda.c index eb77238..e4d61a7 100644 --- a/net/netfilter/nf_nat_amanda.c +++ b/net/netfilter/nf_nat_amanda.c @@ -33,7 +33,6 @@ static unsigned int help(struct sk_buff *skb, { char buffer[sizeof("65535")]; u_int16_t port; - unsigned int ret; /* Connection comes from client. */ exp->saved_proto.tcp.port = exp->tuple.dst.u.tcp.port; @@ -63,14 +62,14 @@ static unsigned int help(struct sk_buff *skb, } sprintf(buffer, "%u", port); - ret = nf_nat_mangle_udp_packet(skb, exp->master, ctinfo, - protoff, matchoff, matchlen, - buffer, strlen(buffer)); - if (ret != NF_ACCEPT) { + if (!nf_nat_mangle_udp_packet(skb, exp->master, ctinfo, + protoff, matchoff, matchlen, + buffer, strlen(buffer))) { nf_ct_helper_log(skb, exp->master, "cannot mangle packet"); nf_ct_unexpect_related(exp); + return NF_DROP; } - return ret; + return NF_ACCEPT; } static void __exit nf_nat_amanda_fini(void) |