Skip to content

Commit 43a38c3

Browse files
arndbummakynes
authored andcommitted
netfilter: fix nf_conntrack_bridge/ipv6 link error
When CONFIG_IPV6 is disabled, the bridge netfilter code produces a link error: ERROR: "br_ip6_fragment" [net/bridge/netfilter/nf_conntrack_bridge.ko] undefined! ERROR: "nf_ct_frag6_gather" [net/bridge/netfilter/nf_conntrack_bridge.ko] undefined! The problem is that it assumes that whenever IPV6 is not a loadable module, we can call the functions direction. This is clearly not true when IPV6 is disabled. There are two other functions defined like this in linux/netfilter_ipv6.h, so change them all the same way. Fixes: 764dd16 ("netfilter: nf_conntrack_bridge: add support for IPv6") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent 7e6daf5 commit 43a38c3

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

‎include/linux/netfilter_ipv6.h‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ static inline int nf_ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
7575
return 1;
7676

7777
return v6_ops->chk_addr(net, addr, dev, strict);
78-
#else
78+
#elif IS_BUILTIN(CONFIG_IPV6)
7979
return ipv6_chk_addr(net, addr, dev, strict);
80+
#else
81+
return 1;
8082
#endif
8183
}
8284

@@ -113,8 +115,10 @@ static inline int nf_ipv6_br_defrag(struct net *net, struct sk_buff *skb,
113115
return 1;
114116

115117
return v6_ops->br_defrag(net, skb, user);
116-
#else
118+
#elif IS_BUILTIN(CONFIG_IPV6)
117119
return nf_ct_frag6_gather(net, skb, user);
120+
#else
121+
return 1;
118122
#endif
119123
}
120124

@@ -138,8 +142,10 @@ static inline int nf_br_ip6_fragment(struct net *net, struct sock *sk,
138142
return 1;
139143

140144
return v6_ops->br_fragment(net, sk, skb, data, output);
141-
#else
145+
#elif IS_BUILTIN(CONFIG_IPV6)
142146
return br_ip6_fragment(net, sk, skb, data, output);
147+
#else
148+
return 1;
143149
#endif
144150
}
145151

@@ -154,8 +160,10 @@ static inline int nf_ip6_route_me_harder(struct net *net, struct sk_buff *skb)
154160
return -EHOSTUNREACH;
155161

156162
return v6_ops->route_me_harder(net, skb);
157-
#else
163+
#elif IS_BUILTIN(CONFIG_IPV6)
158164
return ip6_route_me_harder(net, skb);
165+
#else
166+
return -EHOSTUNREACH;
159167
#endif
160168
}
161169

0 commit comments

Comments
 (0)