Use preferred kernel integer type u16 instead of the POSIX u_int16_t variant. No functional change. Signed-off-by: Carlos Grillet --- net/netfilter/nf_nat_ftp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nf_nat_ftp.c b/net/netfilter/nf_nat_ftp.c index c92a436d9c48..ab714629e2b1 100644 --- a/net/netfilter/nf_nat_ftp.c +++ b/net/netfilter/nf_nat_ftp.c @@ -69,7 +69,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); struct nf_conn *ct = exp->master; char buffer[sizeof("|1||65535|") + INET6_ADDRSTRLEN]; -- 2.54.0 Replace POSIX u_int16_t with preferred kernel type u16 No functional changes. Signed-off-by: Carlos Grillet --- net/netfilter/nf_nat_irc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nf_nat_irc.c b/net/netfilter/nf_nat_irc.c index 19c4fcc60c50..14b79cb0171b 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")]; struct nf_conn *ct = exp->master; 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; -- 2.54.0 Replace POSIX u_int8_t with preferred kernel type u8, update prototype and struct definition. No functional changes. Signed-off-by: Carlos Grillet --- include/linux/netfilter.h | 6 +++--- net/netfilter/nf_sockopt.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index efbbfa770d66..91b68bdba3f5 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h @@ -181,7 +181,7 @@ static inline void nf_hook_state_init(struct nf_hook_state *p, struct nf_sockopt_ops { struct list_head list; - u_int8_t pf; + u8 pf; /* Non-inclusive ranges: use 0/0/NULL to never get called. */ int set_optmin; @@ -357,9 +357,9 @@ NF_HOOK_LIST(uint8_t pf, unsigned int hook, struct net *net, struct sock *sk, } /* Call setsockopt() */ -int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, sockptr_t opt, +int nf_setsockopt(struct sock *sk, u8 pf, int optval, sockptr_t opt, unsigned int len); -int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, +int nf_getsockopt(struct sock *sk, u8 pf, int optval, char __user *opt, int *len); struct flowi; diff --git a/net/netfilter/nf_sockopt.c b/net/netfilter/nf_sockopt.c index 34afcd03b6f6..19a1d028158c 100644 --- a/net/netfilter/nf_sockopt.c +++ b/net/netfilter/nf_sockopt.c @@ -59,8 +59,8 @@ void nf_unregister_sockopt(struct nf_sockopt_ops *reg) } EXPORT_SYMBOL(nf_unregister_sockopt); -static struct nf_sockopt_ops *nf_sockopt_find(struct sock *sk, u_int8_t pf, - int val, int get) +static struct nf_sockopt_ops *nf_sockopt_find(struct sock *sk, u8 pf, + int val, int get) { struct nf_sockopt_ops *ops; @@ -89,7 +89,7 @@ static struct nf_sockopt_ops *nf_sockopt_find(struct sock *sk, u_int8_t pf, return ops; } -int nf_setsockopt(struct sock *sk, u_int8_t pf, int val, sockptr_t opt, +int nf_setsockopt(struct sock *sk, u8 pf, int val, sockptr_t opt, unsigned int len) { struct nf_sockopt_ops *ops; @@ -104,7 +104,7 @@ int nf_setsockopt(struct sock *sk, u_int8_t pf, int val, sockptr_t opt, } EXPORT_SYMBOL(nf_setsockopt); -int nf_getsockopt(struct sock *sk, u_int8_t pf, int val, char __user *opt, +int nf_getsockopt(struct sock *sk, u8 pf, int val, char __user *opt, int *len) { struct nf_sockopt_ops *ops; -- 2.54.0 Replace POSIX u_int8_t with preferred kernel type u8 No functional changes. Signed-off-by: Carlos Grillet --- net/netfilter/xt_DSCP.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/netfilter/xt_DSCP.c b/net/netfilter/xt_DSCP.c index cfa44515ab72..76231e1dc5b5 100644 --- a/net/netfilter/xt_DSCP.c +++ b/net/netfilter/xt_DSCP.c @@ -30,7 +30,7 @@ static unsigned int dscp_tg(struct sk_buff *skb, const struct xt_action_param *par) { const struct xt_DSCP_info *dinfo = par->targinfo; - u_int8_t dscp = ipv4_get_dsfield(ip_hdr(skb)) >> XT_DSCP_SHIFT; + u8 dscp = ipv4_get_dsfield(ip_hdr(skb)) >> XT_DSCP_SHIFT; if (dscp != dinfo->dscp) { if (skb_ensure_writable(skb, sizeof(struct iphdr))) @@ -47,7 +47,7 @@ static unsigned int dscp_tg6(struct sk_buff *skb, const struct xt_action_param *par) { const struct xt_DSCP_info *dinfo = par->targinfo; - u_int8_t dscp = ipv6_get_dsfield(ipv6_hdr(skb)) >> XT_DSCP_SHIFT; + u8 dscp = ipv6_get_dsfield(ipv6_hdr(skb)) >> XT_DSCP_SHIFT; if (dscp != dinfo->dscp) { if (skb_ensure_writable(skb, sizeof(struct ipv6hdr))) @@ -73,7 +73,7 @@ tos_tg(struct sk_buff *skb, const struct xt_action_param *par) { const struct xt_tos_target_info *info = par->targinfo; struct iphdr *iph = ip_hdr(skb); - u_int8_t orig, nv; + u8 orig, nv; orig = ipv4_get_dsfield(iph); nv = (orig & ~info->tos_mask) ^ info->tos_value; @@ -93,7 +93,7 @@ tos_tg6(struct sk_buff *skb, const struct xt_action_param *par) { const struct xt_tos_target_info *info = par->targinfo; struct ipv6hdr *iph = ipv6_hdr(skb); - u_int8_t orig, nv; + u8 orig, nv; orig = ipv6_get_dsfield(iph); nv = (orig & ~info->tos_mask) ^ info->tos_value; -- 2.54.0 Replace POSIX u_int8_t/u_int16_t with preferred kernel types u8/u16 No functional changes. Signed-off-by: Carlos Grillet --- net/netfilter/xt_TCPOPTSTRIP.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/netfilter/xt_TCPOPTSTRIP.c b/net/netfilter/xt_TCPOPTSTRIP.c index 93f064306901..265d21697847 100644 --- a/net/netfilter/xt_TCPOPTSTRIP.c +++ b/net/netfilter/xt_TCPOPTSTRIP.c @@ -16,7 +16,7 @@ #include #include -static inline unsigned int optlen(const u_int8_t *opt, unsigned int offset) +static inline unsigned int optlen(const u8 *opt, unsigned int offset) { /* Beware zero-length options: make finite progress */ if (opt[offset] <= TCPOPT_NOP || opt[offset+1] == 0) @@ -33,8 +33,8 @@ tcpoptstrip_mangle_packet(struct sk_buff *skb, const struct xt_tcpoptstrip_target_info *info = par->targinfo; struct tcphdr *tcph, _th; unsigned int optl, i, j; - u_int16_t n, o; - u_int8_t *opt; + u16 n, o; + u8 *opt; int tcp_hdrlen; /* This is a fragment, no TCP header is available */ @@ -97,7 +97,7 @@ tcpoptstrip_tg6(struct sk_buff *skb, const struct xt_action_param *par) { struct ipv6hdr *ipv6h = ipv6_hdr(skb); int tcphoff; - u_int8_t nexthdr; + u8 nexthdr; __be16 frag_off; nexthdr = ipv6h->nexthdr; -- 2.54.0 Replace POSIX u_int8_t with preferred kernel type u8 and update typedef and declaration in include/net/netfilter/nf_log.h No functional changes. Signed-off-by: Carlos Grillet --- include/net/netfilter/nf_log.h | 16 ++++++++-------- net/netfilter/nf_log.c | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/net/netfilter/nf_log.h b/include/net/netfilter/nf_log.h index 00506792a06d..cff636f29f45 100644 --- a/include/net/netfilter/nf_log.h +++ b/include/net/netfilter/nf_log.h @@ -37,7 +37,7 @@ struct nf_loginfo { }; typedef void nf_logfn(struct net *net, - u_int8_t pf, + u8 pf, unsigned int hooknum, const struct sk_buff *skb, const struct net_device *in, @@ -56,18 +56,18 @@ struct nf_logger { extern int sysctl_nf_log_all_netns; /* Function to register/unregister log function. */ -int nf_log_register(u_int8_t pf, struct nf_logger *logger); +int nf_log_register(u8 pf, struct nf_logger *logger); void nf_log_unregister(struct nf_logger *logger); /* Check if any logger is registered for a given protocol family. */ -bool nf_log_is_registered(u_int8_t pf); +bool nf_log_is_registered(u8 pf); -int nf_log_set(struct net *net, u_int8_t pf, const struct nf_logger *logger); +int nf_log_set(struct net *net, u8 pf, const struct nf_logger *logger); void nf_log_unset(struct net *net, const struct nf_logger *logger); -int nf_log_bind_pf(struct net *net, u_int8_t pf, +int nf_log_bind_pf(struct net *net, u8 pf, const struct nf_logger *logger); -void nf_log_unbind_pf(struct net *net, u_int8_t pf); +void nf_log_unbind_pf(struct net *net, u8 pf); int nf_logger_find_get(int pf, enum nf_log_type type); void nf_logger_put(int pf, enum nf_log_type type); @@ -78,7 +78,7 @@ void nf_logger_put(int pf, enum nf_log_type type); /* Calls the registered backend logging function */ __printf(8, 9) void nf_log_packet(struct net *net, - u_int8_t pf, + u8 pf, unsigned int hooknum, const struct sk_buff *skb, const struct net_device *in, @@ -88,7 +88,7 @@ void nf_log_packet(struct net *net, __printf(8, 9) void nf_log_trace(struct net *net, - u_int8_t pf, + u8 pf, unsigned int hooknum, const struct sk_buff *skb, const struct net_device *in, diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c index f4d80654dfe6..978e082a91b5 100644 --- a/net/netfilter/nf_log.c +++ b/net/netfilter/nf_log.c @@ -42,7 +42,7 @@ static struct nf_logger *__find_logger(int pf, const char *str_logger) return NULL; } -int nf_log_set(struct net *net, u_int8_t pf, const struct nf_logger *logger) +int nf_log_set(struct net *net, u8 pf, const struct nf_logger *logger) { const struct nf_logger *log; @@ -76,7 +76,7 @@ void nf_log_unset(struct net *net, const struct nf_logger *logger) EXPORT_SYMBOL(nf_log_unset); /* return EEXIST if the same logger is registered, 0 on success. */ -int nf_log_register(u_int8_t pf, struct nf_logger *logger) +int nf_log_register(u8 pf, struct nf_logger *logger) { int i; int ret = 0; @@ -133,7 +133,7 @@ EXPORT_SYMBOL(nf_log_unregister); * * Returns: true if at least one logger is active for @pf, false otherwise. */ -bool nf_log_is_registered(u_int8_t pf) +bool nf_log_is_registered(u8 pf) { int i; @@ -151,7 +151,7 @@ bool nf_log_is_registered(u_int8_t pf) } EXPORT_SYMBOL(nf_log_is_registered); -int nf_log_bind_pf(struct net *net, u_int8_t pf, +int nf_log_bind_pf(struct net *net, u8 pf, const struct nf_logger *logger) { if (pf >= ARRAY_SIZE(net->nf.nf_loggers)) @@ -167,7 +167,7 @@ int nf_log_bind_pf(struct net *net, u_int8_t pf, } EXPORT_SYMBOL(nf_log_bind_pf); -void nf_log_unbind_pf(struct net *net, u_int8_t pf) +void nf_log_unbind_pf(struct net *net, u8 pf) { if (pf >= ARRAY_SIZE(net->nf.nf_loggers)) return; @@ -235,7 +235,7 @@ void nf_logger_put(int pf, enum nf_log_type type) EXPORT_SYMBOL_GPL(nf_logger_put); void nf_log_packet(struct net *net, - u_int8_t pf, + u8 pf, unsigned int hooknum, const struct sk_buff *skb, const struct net_device *in, @@ -264,7 +264,7 @@ void nf_log_packet(struct net *net, EXPORT_SYMBOL(nf_log_packet); void nf_log_trace(struct net *net, - u_int8_t pf, + u8 pf, unsigned int hooknum, const struct sk_buff *skb, const struct net_device *in, -- 2.54.0