When either CONFIG_IPV6 or CONFIG_SYN_COOKIES are disabled, the kernel fails to build: include/linux/netfilter_ipv6.h:180:9: error: implicit declaration of function '__cookie_v6_init_sequence' [-Werror,-Wimplicit-function-declaration] return __cookie_v6_init_sequence(iph, th, mssp); include/linux/netfilter_ipv6.h:194:9: error: implicit declaration of function '__cookie_v6_check' [-Werror,-Wimplicit-function-declaration] return __cookie_v6_check(iph, th, cookie); net/ipv6/netfilter.c:237:26: error: use of undeclared identifier '__cookie_v6_init_sequence'; did you mean 'cookie_init_sequence'? net/ipv6/netfilter.c:238:21: error: use of undeclared identifier '__cookie_v6_check'; did you mean '__cookie_v4_check'? Fix the IS_ENABLED() checks to match the function declaration and definitions for these.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -163,31 +163,33 @@ static inline u32 nf_ipv6_cookie_init_sequence(const struct ipv6hdr *iph, · 162 unmodified lines | |||
| 163 | const struct tcphdr *th, | 163 | const struct tcphdr *th, |
| 164 | u16 *mssp) | 164 | u16 *mssp) |
| 165 | { | 165 | { |
| 166 | #if IS_ENABLED(CONFIG_SYN_COOKIES) | ||
| 166 | #if IS_MODULE(CONFIG_IPV6) | 167 | #if IS_MODULE(CONFIG_IPV6) |
| 167 | const struct nf_ipv6_ops *v6_ops = nf_get_ipv6_ops(); | 168 | const struct nf_ipv6_ops *v6_ops = nf_get_ipv6_ops(); |
| 168 | 169 | ||
| 169 | if (v6_ops) | 170 | if (v6_ops) |
| 170 | return v6_ops->cookie_init_sequence(iph, th, mssp); | 171 | return v6_ops->cookie_init_sequence(iph, th, mssp); |
| 171 | 172 | #elif IS_BUILTIN(CONFIG_IPV6) | |
| 172 | return 0; | ||
| 173 | #else | ||
| 174 | return __cookie_v6_init_sequence(iph, th, mssp); | 173 | return __cookie_v6_init_sequence(iph, th, mssp); |
| 175 | #endif | 174 | #endif |
| 175 | #endif | ||
| 176 | return 0; | ||
| 176 | } | 177 | } |
| 177 | 178 | ||
| 178 | static inline int nf_cookie_v6_check(const struct ipv6hdr *iph, | 179 | static inline int nf_cookie_v6_check(const struct ipv6hdr *iph, |
| 179 | const struct tcphdr *th, __u32 cookie) | 180 | const struct tcphdr *th, __u32 cookie) |
| 180 | { | 181 | { |
| 182 | #if IS_ENABLED(CONFIG_SYN_COOKIES) | ||
| 181 | #if IS_MODULE(CONFIG_IPV6) | 183 | #if IS_MODULE(CONFIG_IPV6) |
| 182 | const struct nf_ipv6_ops *v6_ops = nf_get_ipv6_ops(); | 184 | const struct nf_ipv6_ops *v6_ops = nf_get_ipv6_ops(); |
| 183 | 185 | ||
| 184 | if (v6_ops) | 186 | if (v6_ops) |
| 185 | return v6_ops->cookie_v6_check(iph, th, cookie); | 187 | return v6_ops->cookie_v6_check(iph, th, cookie); |
| 186 | 188 | #elif IS_BUILTIN(CONFIG_IPV6) | |
| 187 | return 0; | ||
| 188 | #else | ||
| 189 | return __cookie_v6_check(iph, th, cookie); | 189 | return __cookie_v6_check(iph, th, cookie); |
| 190 | #endif | 190 | #endif |
| 191 | #endif | ||
| 192 | return 0; | ||
| 191 | } | 193 | } |
| 192 | 194 | ||
| 193 | __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, | 195 | __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, |