diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2019-06-17 09:15:04 -0400 |
|---|---|---|
| committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2019-06-21 11:21:11 -0400 |
| commit | 43a38c3f318082839d7e613352d4dae7bbdfcdec (patch) | |
| tree | 7d5e9f6fe2e357bc404554923c265b2a2721a3d3 | |
| parent | 7e6daf50e1f4ea0ecd56406beb64ffc66e1e94db (diff) | |
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: 764dd163ac92 ("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>
| -rw-r--r-- | include/linux/netfilter_ipv6.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 22e6398bc482..7beb681e1ce5 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
| @@ -75,8 +75,10 @@ static inline int nf_ipv6_chk_addr(struct net *net, const struct in6_addr *addr, | |||
| 75 | return 1; | 75 | return 1; |
| 76 | 76 | ||
| 77 | return v6_ops->chk_addr(net, addr, dev, strict); | 77 | return v6_ops->chk_addr(net, addr, dev, strict); |
| 78 | #else | 78 | #elif IS_BUILTIN(CONFIG_IPV6) |
| 79 | return ipv6_chk_addr(net, addr, dev, strict); | 79 | return ipv6_chk_addr(net, addr, dev, strict); |
| 80 | #else | ||
| 81 | return 1; | ||
| 80 | #endif | 82 | #endif |
| 81 | } | 83 | } |
| 82 | 84 | ||
| @@ -113,8 +115,10 @@ static inline int nf_ipv6_br_defrag(struct net *net, struct sk_buff *skb, | |||
| 113 | return 1; | 115 | return 1; |
| 114 | 116 | ||
| 115 | return v6_ops->br_defrag(net, skb, user); | 117 | return v6_ops->br_defrag(net, skb, user); |
| 116 | #else | 118 | #elif IS_BUILTIN(CONFIG_IPV6) |
| 117 | return nf_ct_frag6_gather(net, skb, user); | 119 | return nf_ct_frag6_gather(net, skb, user); |
| 120 | #else | ||
| 121 | return 1; | ||
| 118 | #endif | 122 | #endif |
| 119 | } | 123 | } |
| 120 | 124 | ||
| @@ -138,8 +142,10 @@ static inline int nf_br_ip6_fragment(struct net *net, struct sock *sk, | |||
| 138 | return 1; | 142 | return 1; |
| 139 | 143 | ||
| 140 | return v6_ops->br_fragment(net, sk, skb, data, output); | 144 | return v6_ops->br_fragment(net, sk, skb, data, output); |
| 141 | #else | 145 | #elif IS_BUILTIN(CONFIG_IPV6) |
| 142 | return br_ip6_fragment(net, sk, skb, data, output); | 146 | return br_ip6_fragment(net, sk, skb, data, output); |
| 147 | #else | ||
| 148 | return 1; | ||
| 143 | #endif | 149 | #endif |
| 144 | } | 150 | } |
| 145 | 151 | ||
| @@ -154,8 +160,10 @@ static inline int nf_ip6_route_me_harder(struct net *net, struct sk_buff *skb) | |||
| 154 | return -EHOSTUNREACH; | 160 | return -EHOSTUNREACH; |
| 155 | 161 | ||
| 156 | return v6_ops->route_me_harder(net, skb); | 162 | return v6_ops->route_me_harder(net, skb); |
| 157 | #else | 163 | #elif IS_BUILTIN(CONFIG_IPV6) |
| 158 | return ip6_route_me_harder(net, skb); | 164 | return ip6_route_me_harder(net, skb); |
| 165 | #else | ||
| 166 | return -EHOSTUNREACH; | ||
| 159 | #endif | 167 | #endif |
| 160 | } | 168 | } |
| 161 | 169 | ||
