Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netfilter: ipv4: remove useless export_symbol

Only one caller; place it where needed and get rid of the EXPORT_SYMBOL.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>

authored by

Florian Westphal and committed by
Pablo Neira Ayuso
83f52928 ac088a88

+19 -24
-6
include/linux/netfilter_ipv4.h
··· 25 25 unsigned int dataoff, u_int8_t protocol); 26 26 int nf_ip_route(struct net *net, struct dst_entry **dst, struct flowi *fl, 27 27 bool strict); 28 - int nf_ip_reroute(struct sk_buff *skb, const struct nf_queue_entry *entry); 29 28 #else 30 29 static inline __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook, 31 30 unsigned int dataoff, u_int8_t protocol) ··· 33 34 } 34 35 static inline int nf_ip_route(struct net *net, struct dst_entry **dst, 35 36 struct flowi *fl, bool strict) 36 - { 37 - return -EOPNOTSUPP; 38 - } 39 - static inline int nf_ip_reroute(struct sk_buff *skb, 40 - const struct nf_queue_entry *entry) 41 37 { 42 38 return -EOPNOTSUPP; 43 39 }
-18
net/ipv4/netfilter.c
··· 80 80 } 81 81 EXPORT_SYMBOL(ip_route_me_harder); 82 82 83 - int nf_ip_reroute(struct sk_buff *skb, const struct nf_queue_entry *entry) 84 - { 85 - const struct ip_rt_info *rt_info = nf_queue_entry_reroute(entry); 86 - 87 - if (entry->state.hook == NF_INET_LOCAL_OUT) { 88 - const struct iphdr *iph = ip_hdr(skb); 89 - 90 - if (!(iph->tos == rt_info->tos && 91 - skb->mark == rt_info->mark && 92 - iph->daddr == rt_info->daddr && 93 - iph->saddr == rt_info->saddr)) 94 - return ip_route_me_harder(entry->state.net, skb, 95 - RTN_UNSPEC); 96 - } 97 - return 0; 98 - } 99 - EXPORT_SYMBOL_GPL(nf_ip_reroute); 100 - 101 83 int nf_ip_route(struct net *net, struct dst_entry **dst, struct flowi *fl, 102 84 bool strict __always_unused) 103 85 {
+19
net/netfilter/utils.c
··· 180 180 } 181 181 EXPORT_SYMBOL_GPL(nf_route); 182 182 183 + static int nf_ip_reroute(struct sk_buff *skb, const struct nf_queue_entry *entry) 184 + { 185 + #ifdef CONFIG_INET 186 + const struct ip_rt_info *rt_info = nf_queue_entry_reroute(entry); 187 + 188 + if (entry->state.hook == NF_INET_LOCAL_OUT) { 189 + const struct iphdr *iph = ip_hdr(skb); 190 + 191 + if (!(iph->tos == rt_info->tos && 192 + skb->mark == rt_info->mark && 193 + iph->daddr == rt_info->daddr && 194 + iph->saddr == rt_info->saddr)) 195 + return ip_route_me_harder(entry->state.net, skb, 196 + RTN_UNSPEC); 197 + } 198 + #endif 199 + return 0; 200 + } 201 + 183 202 int nf_reroute(struct sk_buff *skb, struct nf_queue_entry *entry) 184 203 { 185 204 const struct nf_ipv6_ops *v6ops;