very little code, so it really doesn't make sense to have extra modules or even a kconfig knob for this. Merge them and make functionality available unconditionally. The merge makes inet family route support trivial, so add it as well here. Before: text data bss dec hex filename 835 832 0 1667 683 nft_chain_route_ipv4.ko 870 832 0 1702 6a6 nft_chain_route_ipv6.ko 111568 2556 529 114653 1bfdd nf_tables.ko After: text data bss dec hex filename 113133 2556 529 116218 1c5fa nf_tables.ko
Showing the changes to include/linux (1 of 12 files). Show all
Unified · Split
| @@ -87,6 +87,21 @@ static inline int nf_ip6_route(struct net *net, struct dst_entry **dst, · 86 unmodified lines | |||
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | int ip6_route_me_harder(struct net *net, struct sk_buff *skb); | 89 | int ip6_route_me_harder(struct net *net, struct sk_buff *skb); |
| 90 | |||
| 91 | static inline int nf_ip6_route_me_harder(struct net *net, struct sk_buff *skb) | ||
| 92 | { | ||
| 93 | #if IS_MODULE(CONFIG_IPV6) | ||
| 94 | const struct nf_ipv6_ops *v6_ops = nf_get_ipv6_ops(); | ||
| 95 | |||
| 96 | if (!v6_ops) | ||
| 97 | return -EHOSTUNREACH; | ||
| 98 | |||
| 99 | return v6_ops->route_me_harder(net, skb); | ||
| 100 | #else | ||
| 101 | return ip6_route_me_harder(net, skb); | ||
| 102 | #endif | ||
| 103 | } | ||
| 104 | |||
| 90 | __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, | 105 | __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, |
| 91 | unsigned int dataoff, u_int8_t protocol); | 106 | unsigned int dataoff, u_int8_t protocol); |
| 92 | 107 | ||