Skip to content

Commit 1f0772f

Browse files
committed
Merge git://github.com/davem330/net
* git://github.com/davem330/net: tcp: fix validation of D-SACK tcp: fix build error if !CONFIG_SYN_COOKIES
2 parents 6bf3b0d + f779b2d commit 1f0772f

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

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,

net/ipv4/tcp_input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ static int tcp_is_sackblock_valid(struct tcp_sock *tp, int is_dsack,
11241124
return 0;
11251125

11261126
/* ...Then it's D-SACK, and must reside below snd_una completely */
1127-
if (!after(end_seq, tp->snd_una))
1127+
if (after(end_seq, tp->snd_una))
11281128
return 0;
11291129

11301130
if (!before(start_seq, tp->undo_marker))

0 commit comments

Comments
 (0)