History

netfilter: synproxy: fix building syncookie calls

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.

Arnd Bergmann committed 7 years ago

Commit 8527fa61 parent 79ebb5b2 files · +10 −6Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/netfilter_ipv6.h+8−6
@@ -163,31 +163,33 @@ static inline u32 nf_ipv6_cookie_init_sequence(const struct ipv6hdr *iph, · 162 unmodified lines
163163 const struct tcphdr *th,
164164 u16 *mssp)
165165 {
166+#if IS_ENABLED(CONFIG_SYN_COOKIES)
166167 #if IS_MODULE(CONFIG_IPV6)
167168 const struct nf_ipv6_ops *v6_ops = nf_get_ipv6_ops();
168169
169170 if (v6_ops)
170171 return v6_ops->cookie_init_sequence(iph, th, mssp);
171−
172− return 0;
173−#else
172+#elif IS_BUILTIN(CONFIG_IPV6)
174173 return __cookie_v6_init_sequence(iph, th, mssp);
175174 #endif
175+#endif
176+ return 0;
176177 }
177178
178179 static inline int nf_cookie_v6_check(const struct ipv6hdr *iph,
179180 const struct tcphdr *th, __u32 cookie)
180181 {
182+#if IS_ENABLED(CONFIG_SYN_COOKIES)
181183 #if IS_MODULE(CONFIG_IPV6)
182184 const struct nf_ipv6_ops *v6_ops = nf_get_ipv6_ops();
183185
184186 if (v6_ops)
185187 return v6_ops->cookie_v6_check(iph, th, cookie);
186−
187− return 0;
188−#else
188+#elif IS_BUILTIN(CONFIG_IPV6)
189189 return __cookie_v6_check(iph, th, cookie);
190190 #endif
191+#endif
192+ return 0;
191193 }
192194
193195 __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t