Skip to content

Commit e05c82d

Browse files
Eric Dumazetdavem330
authored andcommitted
tcp: fix build error if !CONFIG_SYN_COOKIES
commit 946cedc (tcp: Change possible SYN flooding messages) added a build error if CONFIG_SYN_COOKIES=n Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b0e7031 commit e05c82d

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

include/net/tcp.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,17 +431,34 @@ extern int tcp_disconnect(struct sock *sk, int flags);
431431
extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];
432432
extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
433433
struct ip_options *opt);
434+
#ifdef CONFIG_SYN_COOKIES
434435
extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb,
435436
__u16 *mss);
437+
#else
438+
static inline __u32 cookie_v4_init_sequence(struct sock *sk,
439+
struct sk_buff *skb,
440+
__u16 *mss)
441+
{
442+
return 0;
443+
}
444+
#endif
436445

437446
extern __u32 cookie_init_timestamp(struct request_sock *req);
438447
extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *);
439448

440449
/* From net/ipv6/syncookies.c */
441450
extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
451+
#ifdef CONFIG_SYN_COOKIES
442452
extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb,
443453
__u16 *mss);
444-
454+
#else
455+
static inline __u32 cookie_v6_init_sequence(struct sock *sk,
456+
struct sk_buff *skb,
457+
__u16 *mss)
458+
{
459+
return 0;
460+
}
461+
#endif
445462
/* tcp_output.c */
446463

447464
extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,

0 commit comments

Comments
 (0)