mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fernando Fernandez Mancera <fmancera@suse.de>
To: Carlos Grillet <carlos@carlosgrillet.me>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	Florian Westphal <fw@strlen.de>, Phil Sutter <phil@nwl.cc>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>
Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH nf-next] netfilter: nf_nat: replace u_int16_t with u16
Date: Mon, 5 Oct 2026 14:09:56 +0200	[thread overview]
Message-ID: <bea33147-1a2e-4fba-93ac-7521dd7b6556@suse.de> (raw)
In-Reply-To: <20261002201057.132466-1-carlos@carlosgrillet.me>

On 10/2/26 10:10 PM, Carlos Grillet wrote:
> Use the preferred kernel type u16 instead of the POSIX u_int16_t
> variant across the NAT helpers.
> 
> No functional change.
> 
> Signed-off-by: Carlos Grillet <carlos@carlosgrillet.me>
> ---
> This supersedes the nf_nat_amanda one-liner from batch 3, which was
> dropped in favour of a larger changeset:
> 
>    https://lore.kernel.org/netfilter-devel/ak5lH1UnFth6oreP@strlen.de/
> 
> nf_nat is now converted in one patch, as suggested. The remaining
> families (nfnetlink, nf_log, x_tables, ...) will follow the same way.

Hi Carlos,

given that this is a mechanical change that is not a risk, can they all 
be handled in a single patch for the netfilter subsystem?

Thanks,
Fernando.

> 
>   include/linux/netfilter/nf_conntrack_sip.h |  2 +-
>   net/ipv4/netfilter/nf_nat_h323.c           | 10 +++++-----
>   net/ipv4/netfilter/nf_nat_pptp.c           |  4 ++--
>   net/netfilter/nf_nat_amanda.c              |  2 +-
>   net/netfilter/nf_nat_ftp.c                 |  2 +-
>   net/netfilter/nf_nat_irc.c                 |  2 +-
>   net/netfilter/nf_nat_sip.c                 |  6 +++---
>   7 files changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h
> index aafa0c04f917..3b66ec4b20c8 100644
> --- a/include/linux/netfilter/nf_conntrack_sip.h
> +++ b/include/linux/netfilter/nf_conntrack_sip.h
> @@ -143,7 +143,7 @@ struct nf_nat_sip_hooks {
>   				 unsigned int *datalen,
>   				 unsigned int matchoff,
>   				 unsigned int matchlen,
> -				 u_int16_t port);
> +				 u16 port);
>   
>   	unsigned int (*sdp_session)(struct sk_buff *skb,
>   				    unsigned int protoff,
> diff --git a/net/ipv4/netfilter/nf_nat_h323.c b/net/ipv4/netfilter/nf_nat_h323.c
> index 6bcd6734769b..265c1ba5b348 100644
> --- a/net/ipv4/netfilter/nf_nat_h323.c
> +++ b/net/ipv4/netfilter/nf_nat_h323.c
> @@ -186,7 +186,7 @@ static int nat_rtp_rtcp(struct sk_buff *skb, struct nf_conn *ct,
>   	struct nf_ct_h323_master *info = nfct_help_data(ct);
>   	int dir = CTINFO2DIR(ctinfo);
>   	int i;
> -	u_int16_t nated_port;
> +	u16 nated_port;
>   
>   	if (!info)
>   		return -1;
> @@ -282,7 +282,7 @@ static int nat_t120(struct sk_buff *skb, struct nf_conn *ct,
>   		    struct nf_conntrack_expect *exp)
>   {
>   	int dir = CTINFO2DIR(ctinfo);
> -	u_int16_t nated_port = ntohs(port);
> +	u16 nated_port = ntohs(port);
>   
>   	/* Set expectations for NAT */
>   	exp->saved_proto.tcp.port = exp->tuple.dst.u.tcp.port;
> @@ -321,7 +321,7 @@ static int nat_h245(struct sk_buff *skb, struct nf_conn *ct,
>   {
>   	struct nf_ct_h323_master *info = nfct_help_data(ct);
>   	int dir = CTINFO2DIR(ctinfo);
> -	u_int16_t nated_port = ntohs(port);
> +	u16 nated_port = ntohs(port);
>   
>   	if (!info)
>   		return -1;
> @@ -402,7 +402,7 @@ static int nat_q931(struct sk_buff *skb, struct nf_conn *ct,
>   {
>   	struct nf_ct_h323_master *info = nfct_help_data(ct);
>   	int dir = CTINFO2DIR(ctinfo);
> -	u_int16_t nated_port = ntohs(port);
> +	u16 nated_port = ntohs(port);
>   	union nf_inet_addr addr;
>   
>   	if (!info)
> @@ -488,7 +488,7 @@ static int nat_callforwarding(struct sk_buff *skb, struct nf_conn *ct,
>   			      struct nf_conntrack_expect *exp)
>   {
>   	int dir = CTINFO2DIR(ctinfo);
> -	u_int16_t nated_port;
> +	u16 nated_port;
>   
>   	/* Set expectations for NAT */
>   	exp->saved_addr = exp->tuple.dst.u3;
> diff --git a/net/ipv4/netfilter/nf_nat_pptp.c b/net/ipv4/netfilter/nf_nat_pptp.c
> index fed5249001a4..5387c288c348 100644
> --- a/net/ipv4/netfilter/nf_nat_pptp.c
> +++ b/net/ipv4/netfilter/nf_nat_pptp.c
> @@ -130,7 +130,7 @@ pptp_outbound_pkt(struct sk_buff *skb,
>   	struct nf_ct_pptp_master *ct_pptp_info;
>   	struct nf_conn_nat *nat = nfct_nat(ct);
>   	struct nf_nat_pptp *nat_pptp_info;
> -	u_int16_t msg;
> +	u16 msg;
>   	__be16 new_callid;
>   	unsigned int cid_off;
>   
> @@ -243,7 +243,7 @@ pptp_inbound_pkt(struct sk_buff *skb,
>   {
>   	const struct nf_nat_pptp *nat_pptp_info;
>   	struct nf_conn_nat *nat = nfct_nat(ct);
> -	u_int16_t msg;
> +	u16 msg;
>   	__be16 new_pcid;
>   	unsigned int pcid_off;
>   
> diff --git a/net/netfilter/nf_nat_amanda.c b/net/netfilter/nf_nat_amanda.c
> index 330415809425..17b0c1c8d4e1 100644
> --- a/net/netfilter/nf_nat_amanda.c
> +++ b/net/netfilter/nf_nat_amanda.c
> @@ -34,7 +34,7 @@ static unsigned int help(struct sk_buff *skb,
>   			 struct nf_conntrack_expect *exp)
>   {
>   	char buffer[sizeof("65535")];
> -	u_int16_t port;
> +	u16 port;
>   
>   	/* Connection comes from client. */
>   	exp->saved_proto.tcp.port = exp->tuple.dst.u.tcp.port;
> diff --git a/net/netfilter/nf_nat_ftp.c b/net/netfilter/nf_nat_ftp.c
> index 25d20e2970ae..0c90165040e0 100644
> --- a/net/netfilter/nf_nat_ftp.c
> +++ b/net/netfilter/nf_nat_ftp.c
> @@ -70,7 +70,7 @@ static unsigned int nf_nat_ftp(struct sk_buff *skb,
>   			       struct nf_conntrack_expect *exp)
>   {
>   	union nf_inet_addr newaddr;
> -	u_int16_t port;
> +	u16 port;
>   	int dir = CTINFO2DIR(ctinfo);
>   	char buffer[sizeof("|1||65535|") + INET6_ADDRSTRLEN];
>   	unsigned int buflen;
> diff --git a/net/netfilter/nf_nat_irc.c b/net/netfilter/nf_nat_irc.c
> index 89b31fe932ba..140b7d99a887 100644
> --- a/net/netfilter/nf_nat_irc.c
> +++ b/net/netfilter/nf_nat_irc.c
> @@ -39,7 +39,7 @@ static unsigned int help(struct sk_buff *skb,
>   {
>   	char buffer[sizeof("4294967296 65635")];
>   	union nf_inet_addr newaddr;
> -	u_int16_t port;
> +	u16 port;
>   
>   	/* Reply comes from server. */
>   	newaddr = ct->tuplehash[IP_CT_DIR_REPLY].tuple.dst.u3;
> diff --git a/net/netfilter/nf_nat_sip.c b/net/netfilter/nf_nat_sip.c
> index 8c412bcf6cff..e27c9744054e 100644
> --- a/net/netfilter/nf_nat_sip.c
> +++ b/net/netfilter/nf_nat_sip.c
> @@ -410,7 +410,7 @@ static unsigned int nf_nat_sip_expect(struct sk_buff *skb, unsigned int protoff,
>   	enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo);
>   	struct nf_ct_sip_master *ct_sip_info = nfct_help_data(ct);
>   	union nf_inet_addr newaddr;
> -	u_int16_t port;
> +	u16 port;
>   	__be16 srcport;
>   	char buffer[INET6_ADDRSTRLEN + sizeof("[]:nnnnn")];
>   	unsigned int buflen;
> @@ -536,7 +536,7 @@ static unsigned int nf_nat_sdp_port(struct sk_buff *skb, unsigned int protoff,
>   				    const char **dptr, unsigned int *datalen,
>   				    unsigned int matchoff,
>   				    unsigned int matchlen,
> -				    u_int16_t port)
> +				    u16 port)
>   {
>   	char buffer[sizeof("nnnnn")];
>   	unsigned int buflen;
> @@ -601,7 +601,7 @@ static unsigned int nf_nat_sdp_media(struct sk_buff *skb, unsigned int protoff,
>   	enum ip_conntrack_info ctinfo;
>   	struct nf_conn *ct = nf_ct_get(skb, &ctinfo);
>   	enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo);
> -	u_int16_t port;
> +	u16 port;
>   
>   	/* Connection will come from reply */
>   	if (nf_inet_addr_cmp(&ct->tuplehash[dir].tuple.src.u3,


      reply	other threads:[~2026-10-05 12:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 20:10 Carlos Grillet
2026-10-05 12:09 ` Fernando Fernandez Mancera [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bea33147-1a2e-4fba-93ac-7521dd7b6556@suse.de \
    --to=fmancera@suse.de \
    --cc=carlos@carlosgrillet.me \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=phil@nwl.cc \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®