You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
netfilter: Use unsigned types for hooknum and pf vars
and (try to) consistently use u_int8_t for the L3 family. Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
committed by
Patrick McHardy
parent
be713a443e
commit
76108cea06
@@ -657,7 +657,7 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff *skb,
|
||||
{
|
||||
struct nf_bridge_info *nf_bridge;
|
||||
struct net_device *parent;
|
||||
int pf;
|
||||
u_int8_t pf;
|
||||
|
||||
if (!skb->nf_bridge)
|
||||
return NF_ACCEPT;
|
||||
@@ -791,7 +791,7 @@ static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff *skb,
|
||||
{
|
||||
struct nf_bridge_info *nf_bridge = skb->nf_bridge;
|
||||
struct net_device *realoutdev = bridge_parent(skb->dev);
|
||||
int pf;
|
||||
u_int8_t pf;
|
||||
|
||||
#ifdef CONFIG_NETFILTER_DEBUG
|
||||
/* Be very paranoid. This probably won't happen anymore, but let's
|
||||
|
||||
@@ -84,7 +84,7 @@ print_ports(const struct sk_buff *skb, uint8_t protocol, int offset)
|
||||
|
||||
#define myNIPQUAD(a) a[0], a[1], a[2], a[3]
|
||||
static void
|
||||
ebt_log_packet(unsigned int pf, unsigned int hooknum,
|
||||
ebt_log_packet(u_int8_t pf, unsigned int hooknum,
|
||||
const struct sk_buff *skb, const struct net_device *in,
|
||||
const struct net_device *out, const struct nf_loginfo *loginfo,
|
||||
const char *prefix)
|
||||
|
||||
@@ -223,7 +223,7 @@ alloc_failure:
|
||||
}
|
||||
|
||||
/* this function is registered with the netfilter core */
|
||||
static void ebt_log_packet(unsigned int pf, unsigned int hooknum,
|
||||
static void ebt_log_packet(u_int8_t pf, unsigned int hooknum,
|
||||
const struct sk_buff *skb, const struct net_device *in,
|
||||
const struct net_device *out, const struct nf_loginfo *li,
|
||||
const char *prefix)
|
||||
|
||||
@@ -375,7 +375,7 @@ static struct nf_loginfo default_loginfo = {
|
||||
};
|
||||
|
||||
static void
|
||||
ipt_log_packet(unsigned int pf,
|
||||
ipt_log_packet(u_int8_t pf,
|
||||
unsigned int hooknum,
|
||||
const struct sk_buff *skb,
|
||||
const struct net_device *in,
|
||||
|
||||
@@ -292,7 +292,7 @@ ulog_tg(struct sk_buff *skb, const struct net_device *in,
|
||||
return XT_CONTINUE;
|
||||
}
|
||||
|
||||
static void ipt_logfn(unsigned int pf,
|
||||
static void ipt_logfn(u_int8_t pf,
|
||||
unsigned int hooknum,
|
||||
const struct sk_buff *skb,
|
||||
const struct net_device *in,
|
||||
|
||||
@@ -79,7 +79,7 @@ static int icmp_packet(struct nf_conn *ct,
|
||||
const struct sk_buff *skb,
|
||||
unsigned int dataoff,
|
||||
enum ip_conntrack_info ctinfo,
|
||||
int pf,
|
||||
u_int8_t pf,
|
||||
unsigned int hooknum)
|
||||
{
|
||||
/* Try to delete connection immediately after all replies:
|
||||
@@ -173,7 +173,7 @@ icmp_error_message(struct sk_buff *skb,
|
||||
/* Small and modified version of icmp_rcv */
|
||||
static int
|
||||
icmp_error(struct sk_buff *skb, unsigned int dataoff,
|
||||
enum ip_conntrack_info *ctinfo, int pf, unsigned int hooknum)
|
||||
enum ip_conntrack_info *ctinfo, u_int8_t pf, unsigned int hooknum)
|
||||
{
|
||||
const struct icmphdr *icmph;
|
||||
struct icmphdr _ih;
|
||||
|
||||
@@ -385,7 +385,7 @@ static struct nf_loginfo default_loginfo = {
|
||||
};
|
||||
|
||||
static void
|
||||
ip6t_log_packet(unsigned int pf,
|
||||
ip6t_log_packet(u_int8_t pf,
|
||||
unsigned int hooknum,
|
||||
const struct sk_buff *skb,
|
||||
const struct net_device *in,
|
||||
|
||||
@@ -81,7 +81,7 @@ static int icmpv6_packet(struct nf_conn *ct,
|
||||
const struct sk_buff *skb,
|
||||
unsigned int dataoff,
|
||||
enum ip_conntrack_info ctinfo,
|
||||
int pf,
|
||||
u_int8_t pf,
|
||||
unsigned int hooknum)
|
||||
{
|
||||
/* Try to delete connection immediately after all replies:
|
||||
@@ -173,7 +173,7 @@ icmpv6_error_message(struct sk_buff *skb,
|
||||
|
||||
static int
|
||||
icmpv6_error(struct sk_buff *skb, unsigned int dataoff,
|
||||
enum ip_conntrack_info *ctinfo, int pf, unsigned int hooknum)
|
||||
enum ip_conntrack_info *ctinfo, u_int8_t pf, unsigned int hooknum)
|
||||
{
|
||||
const struct icmp6hdr *icmp6h;
|
||||
struct icmp6hdr _ih;
|
||||
|
||||
@@ -113,7 +113,7 @@ EXPORT_SYMBOL(nf_unregister_hooks);
|
||||
|
||||
unsigned int nf_iterate(struct list_head *head,
|
||||
struct sk_buff *skb,
|
||||
int hook,
|
||||
unsigned int hook,
|
||||
const struct net_device *indev,
|
||||
const struct net_device *outdev,
|
||||
struct list_head **i,
|
||||
@@ -155,7 +155,7 @@ unsigned int nf_iterate(struct list_head *head,
|
||||
|
||||
/* Returns 1 if okfn() needs to be executed by the caller,
|
||||
* -EPERM for NF_DROP, 0 otherwise. */
|
||||
int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
|
||||
int nf_hook_slow(u_int8_t pf, unsigned int hook, struct sk_buff *skb,
|
||||
struct net_device *indev,
|
||||
struct net_device *outdev,
|
||||
int (*okfn)(struct sk_buff *),
|
||||
|
||||
@@ -665,7 +665,7 @@ resolve_normal_ct(struct sk_buff *skb,
|
||||
}
|
||||
|
||||
unsigned int
|
||||
nf_conntrack_in(int pf, unsigned int hooknum, struct sk_buff *skb)
|
||||
nf_conntrack_in(u_int8_t pf, unsigned int hooknum, struct sk_buff *skb)
|
||||
{
|
||||
struct nf_conn *ct;
|
||||
enum ip_conntrack_info ctinfo;
|
||||
@@ -683,7 +683,7 @@ nf_conntrack_in(int pf, unsigned int hooknum, struct sk_buff *skb)
|
||||
}
|
||||
|
||||
/* rcu_read_lock()ed by nf_hook_slow */
|
||||
l3proto = __nf_ct_l3proto_find((u_int16_t)pf);
|
||||
l3proto = __nf_ct_l3proto_find(pf);
|
||||
ret = l3proto->get_l4proto(skb, skb_network_offset(skb),
|
||||
&dataoff, &protonum);
|
||||
if (ret <= 0) {
|
||||
@@ -693,7 +693,7 @@ nf_conntrack_in(int pf, unsigned int hooknum, struct sk_buff *skb)
|
||||
return -ret;
|
||||
}
|
||||
|
||||
l4proto = __nf_ct_l4proto_find((u_int16_t)pf, protonum);
|
||||
l4proto = __nf_ct_l4proto_find(pf, protonum);
|
||||
|
||||
/* It may be an special packet, error, unclean...
|
||||
* inverse of the return code tells to the netfilter
|
||||
|
||||
@@ -241,7 +241,7 @@ struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me)
|
||||
EXPORT_SYMBOL_GPL(nf_ct_expect_alloc);
|
||||
|
||||
void nf_ct_expect_init(struct nf_conntrack_expect *exp, unsigned int class,
|
||||
int family,
|
||||
u_int8_t family,
|
||||
const union nf_inet_addr *saddr,
|
||||
const union nf_inet_addr *daddr,
|
||||
u_int8_t proto, const __be16 *src, const __be16 *dst)
|
||||
|
||||
@@ -709,7 +709,8 @@ static int expect_h245(struct sk_buff *skb, struct nf_conn *ct,
|
||||
/* If the calling party is on the same side of the forward-to party,
|
||||
* we don't need to track the second call */
|
||||
static int callforward_do_filter(const union nf_inet_addr *src,
|
||||
const union nf_inet_addr *dst, int family)
|
||||
const union nf_inet_addr *dst,
|
||||
u_int8_t family)
|
||||
{
|
||||
const struct nf_afinfo *afinfo;
|
||||
struct flowi fl1, fl2;
|
||||
|
||||
@@ -461,7 +461,7 @@ static u64 dccp_ack_seq(const struct dccp_hdr *dh)
|
||||
|
||||
static int dccp_packet(struct nf_conn *ct, const struct sk_buff *skb,
|
||||
unsigned int dataoff, enum ip_conntrack_info ctinfo,
|
||||
int pf, unsigned int hooknum)
|
||||
u_int8_t pf, unsigned int hooknum)
|
||||
{
|
||||
enum ip_conntrack_dir dir = CTINFO2DIR(ctinfo);
|
||||
struct dccp_hdr _dh, *dh;
|
||||
@@ -546,7 +546,7 @@ static int dccp_packet(struct nf_conn *ct, const struct sk_buff *skb,
|
||||
}
|
||||
|
||||
static int dccp_error(struct sk_buff *skb, unsigned int dataoff,
|
||||
enum ip_conntrack_info *ctinfo, int pf,
|
||||
enum ip_conntrack_info *ctinfo, u_int8_t pf,
|
||||
unsigned int hooknum)
|
||||
{
|
||||
struct dccp_hdr _dh, *dh;
|
||||
|
||||
@@ -45,7 +45,7 @@ static int packet(struct nf_conn *ct,
|
||||
const struct sk_buff *skb,
|
||||
unsigned int dataoff,
|
||||
enum ip_conntrack_info ctinfo,
|
||||
int pf,
|
||||
u_int8_t pf,
|
||||
unsigned int hooknum)
|
||||
{
|
||||
nf_ct_refresh_acct(ct, ctinfo, skb, nf_ct_generic_timeout);
|
||||
|
||||
@@ -219,7 +219,7 @@ static int gre_packet(struct nf_conn *ct,
|
||||
const struct sk_buff *skb,
|
||||
unsigned int dataoff,
|
||||
enum ip_conntrack_info ctinfo,
|
||||
int pf,
|
||||
u_int8_t pf,
|
||||
unsigned int hooknum)
|
||||
{
|
||||
/* If we've seen traffic both ways, this is a GRE connection.
|
||||
|
||||
@@ -287,7 +287,7 @@ static int sctp_packet(struct nf_conn *ct,
|
||||
const struct sk_buff *skb,
|
||||
unsigned int dataoff,
|
||||
enum ip_conntrack_info ctinfo,
|
||||
int pf,
|
||||
u_int8_t pf,
|
||||
unsigned int hooknum)
|
||||
{
|
||||
enum sctp_conntrack new_state, old_state;
|
||||
|
||||
@@ -486,7 +486,7 @@ static bool tcp_in_window(const struct nf_conn *ct,
|
||||
const struct sk_buff *skb,
|
||||
unsigned int dataoff,
|
||||
const struct tcphdr *tcph,
|
||||
int pf)
|
||||
u_int8_t pf)
|
||||
{
|
||||
struct ip_ct_tcp_state *sender = &state->seen[dir];
|
||||
struct ip_ct_tcp_state *receiver = &state->seen[!dir];
|
||||
@@ -749,7 +749,7 @@ static const u8 tcp_valid_flags[(TH_FIN|TH_SYN|TH_RST|TH_ACK|TH_URG) + 1] =
|
||||
static int tcp_error(struct sk_buff *skb,
|
||||
unsigned int dataoff,
|
||||
enum ip_conntrack_info *ctinfo,
|
||||
int pf,
|
||||
u_int8_t pf,
|
||||
unsigned int hooknum)
|
||||
{
|
||||
const struct tcphdr *th;
|
||||
@@ -804,7 +804,7 @@ static int tcp_packet(struct nf_conn *ct,
|
||||
const struct sk_buff *skb,
|
||||
unsigned int dataoff,
|
||||
enum ip_conntrack_info ctinfo,
|
||||
int pf,
|
||||
u_int8_t pf,
|
||||
unsigned int hooknum)
|
||||
{
|
||||
struct nf_conntrack_tuple *tuple;
|
||||
|
||||
@@ -66,7 +66,7 @@ static int udp_packet(struct nf_conn *ct,
|
||||
const struct sk_buff *skb,
|
||||
unsigned int dataoff,
|
||||
enum ip_conntrack_info ctinfo,
|
||||
int pf,
|
||||
u_int8_t pf,
|
||||
unsigned int hooknum)
|
||||
{
|
||||
/* If we've seen traffic both ways, this is some kind of UDP
|
||||
@@ -91,7 +91,7 @@ static bool udp_new(struct nf_conn *ct, const struct sk_buff *skb,
|
||||
|
||||
static int udp_error(struct sk_buff *skb, unsigned int dataoff,
|
||||
enum ip_conntrack_info *ctinfo,
|
||||
int pf,
|
||||
u_int8_t pf,
|
||||
unsigned int hooknum)
|
||||
{
|
||||
unsigned int udplen = skb->len - dataoff;
|
||||
|
||||
@@ -65,7 +65,7 @@ static int udplite_packet(struct nf_conn *ct,
|
||||
const struct sk_buff *skb,
|
||||
unsigned int dataoff,
|
||||
enum ip_conntrack_info ctinfo,
|
||||
int pf,
|
||||
u_int8_t pf,
|
||||
unsigned int hooknum)
|
||||
{
|
||||
/* If we've seen traffic both ways, this is some kind of UDP
|
||||
@@ -91,7 +91,7 @@ static bool udplite_new(struct nf_conn *ct, const struct sk_buff *skb,
|
||||
|
||||
static int udplite_error(struct sk_buff *skb, unsigned int dataoff,
|
||||
enum ip_conntrack_info *ctinfo,
|
||||
int pf,
|
||||
u_int8_t pf,
|
||||
unsigned int hooknum)
|
||||
{
|
||||
unsigned int udplen = skb->len - dataoff;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/* core.c */
|
||||
extern unsigned int nf_iterate(struct list_head *head,
|
||||
struct sk_buff *skb,
|
||||
int hook,
|
||||
unsigned int hook,
|
||||
const struct net_device *indev,
|
||||
const struct net_device *outdev,
|
||||
struct list_head **i,
|
||||
@@ -25,7 +25,7 @@ extern unsigned int nf_iterate(struct list_head *head,
|
||||
/* nf_queue.c */
|
||||
extern int nf_queue(struct sk_buff *skb,
|
||||
struct list_head *elem,
|
||||
int pf, unsigned int hook,
|
||||
u_int8_t pf, unsigned int hook,
|
||||
struct net_device *indev,
|
||||
struct net_device *outdev,
|
||||
int (*okfn)(struct sk_buff *),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user