Skip to content

Refine the nat helper codes

[email protected] netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4netfilter: amanda: Correct the return value comparison of the func nf_nat_mangle_udp_packetnet/netfilter/nf_nat_amanda.c+5 -62 replies
2/4netfilter: irc: Correct the return value comparison of the func nf_nat_mangle_tcp_packetnet/netfilter/nf_nat_irc.c+4 -50 replies
3/4netfilter: helper: Use the bool instead of int typeinclude/net/netfilter/nf_nat_helper.h net/netfilter/nf_nat_helper.c+38 -380 replies
4/4netfilter: sip: Use NF_DROP and NF_ACCEPT instead of 0 and 1net/netfilter/nf_nat_sip.c+3 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH nf-next 0/4] Refine the nat helper codes

From: Gao Feng <[email protected]>

There are some netfilter functions which return the literal 1 and 0 as the bool value. We should use bool instead of them.
And even though some calleris treat the return value as Neftiler action. For example, the caller would compare the return value with NF_ACCEPT.

Luckily the value of NF_ACCEPT is 1, so there is no any real issue.

Gao Feng (4):
netfilter: amanda: Correct the return value comparison of the func
nf_nat_mangle_udp_packet
netfilter: irc: Correct the return value comparison of the func
nf_nat_mangle_tcp_packet
netfilter: helper: Use the bool instead of int type
netfilter: sip: Use NF_DROP and NF_ACCEPT instead of 0 and 1

 include/net/netfilter/nf_nat_helper.h | 36 +++++++++++++++----------------
 net/netfilter/nf_nat_amanda.c         | 11 +++++-----
 net/netfilter/nf_nat_helper.c         | 40 +++++++++++++++++------------------
 net/netfilter/nf_nat_irc.c            |  9 ++++----
 net/netfilter/nf_nat_sip.c            |  6 +++---
 5 files changed, 50 insertions(+), 52 deletions(-)
Signature · 1 line
1.9.1