Skip to content

Commit 83f5292

Browse files
Florian Westphalummakynes
authored andcommitted
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>
1 parent ac088a8 commit 83f5292

3 files changed

Lines changed: 19 additions & 24 deletions

File tree

‎include/linux/netfilter_ipv4.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook,
2525
unsigned int dataoff, u_int8_t protocol);
2626
int nf_ip_route(struct net *net, struct dst_entry **dst, struct flowi *fl,
2727
bool strict);
28-
int nf_ip_reroute(struct sk_buff *skb, const struct nf_queue_entry *entry);
2928
#else
3029
static inline __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook,
3130
unsigned int dataoff, u_int8_t protocol)
@@ -37,11 +36,6 @@ static inline int nf_ip_route(struct net *net, struct dst_entry **dst,
3736
{
3837
return -EOPNOTSUPP;
3938
}
40-
static inline int nf_ip_reroute(struct sk_buff *skb,
41-
const struct nf_queue_entry *entry)
42-
{
43-
return -EOPNOTSUPP;
44-
}
4539
#endif /* CONFIG_INET */
4640

4741
#endif /*__LINUX_IP_NETFILTER_H*/

‎net/ipv4/netfilter.c‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,6 @@ int ip_route_me_harder(struct net *net, struct sk_buff *skb, unsigned int addr_t
8080
}
8181
EXPORT_SYMBOL(ip_route_me_harder);
8282

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-
10183
int nf_ip_route(struct net *net, struct dst_entry **dst, struct flowi *fl,
10284
bool strict __always_unused)
10385
{

‎net/netfilter/utils.c‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,25 @@ int nf_route(struct net *net, struct dst_entry **dst, struct flowi *fl,
180180
}
181181
EXPORT_SYMBOL_GPL(nf_route);
182182

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+
183202
int nf_reroute(struct sk_buff *skb, struct nf_queue_entry *entry)
184203
{
185204
const struct nf_ipv6_ops *v6ops;

0 commit comments

Comments
 (0)