Skip to content

Commit e7582ba

Browse files
borkmanndavem330
authored andcommitted
net: dev: reduce both ingress hook ifdefs
Reduce ifdef pollution slightly, no functional change. We can simply remove the extra alternative definition of handle_ing() and nf_ingress(). Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent eb93447 commit e7582ba

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

net/core/dev.c

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3627,11 +3627,11 @@ int (*br_fdb_test_addr_hook)(struct net_device *dev,
36273627
EXPORT_SYMBOL_GPL(br_fdb_test_addr_hook);
36283628
#endif
36293629

3630-
#ifdef CONFIG_NET_CLS_ACT
36313630
static inline struct sk_buff *handle_ing(struct sk_buff *skb,
36323631
struct packet_type **pt_prev,
36333632
int *ret, struct net_device *orig_dev)
36343633
{
3634+
#ifdef CONFIG_NET_CLS_ACT
36353635
struct tcf_proto *cl = rcu_dereference_bh(skb->dev->ingress_cl_list);
36363636
struct tcf_result cl_res;
36373637

@@ -3665,17 +3665,9 @@ static inline struct sk_buff *handle_ing(struct sk_buff *skb,
36653665
default:
36663666
break;
36673667
}
3668-
3669-
return skb;
3670-
}
3671-
#else
3672-
static inline struct sk_buff *handle_ing(struct sk_buff *skb,
3673-
struct packet_type **pt_prev,
3674-
int *ret, struct net_device *orig_dev)
3675-
{
3668+
#endif /* CONFIG_NET_CLS_ACT */
36763669
return skb;
36773670
}
3678-
#endif
36793671

36803672
/**
36813673
* netdev_rx_handler_register - register receive handler
@@ -3748,10 +3740,10 @@ static bool skb_pfmemalloc_protocol(struct sk_buff *skb)
37483740
}
37493741
}
37503742

3751-
#ifdef CONFIG_NETFILTER_INGRESS
37523743
static inline int nf_ingress(struct sk_buff *skb, struct packet_type **pt_prev,
37533744
int *ret, struct net_device *orig_dev)
37543745
{
3746+
#ifdef CONFIG_NETFILTER_INGRESS
37553747
if (nf_hook_ingress_active(skb)) {
37563748
if (*pt_prev) {
37573749
*ret = deliver_skb(skb, *pt_prev, orig_dev);
@@ -3760,15 +3752,9 @@ static inline int nf_ingress(struct sk_buff *skb, struct packet_type **pt_prev,
37603752

37613753
return nf_hook_ingress(skb);
37623754
}
3755+
#endif /* CONFIG_NETFILTER_INGRESS */
37633756
return 0;
37643757
}
3765-
#else
3766-
static inline int nf_ingress(struct sk_buff *skb, struct packet_type **pt_prev,
3767-
int *ret, struct net_device *orig_dev)
3768-
{
3769-
return 0;
3770-
}
3771-
#endif
37723758

37733759
static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc)
37743760
{

0 commit comments

Comments
 (0)