diff options
Diffstat (limited to 'include/net/tcp_ecn.h')
-rw-r--r-- | include/net/tcp_ecn.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/net/tcp_ecn.h b/include/net/tcp_ecn.h index 4629d77173f2..89eb3e05116d 100644 --- a/include/net/tcp_ecn.h +++ b/include/net/tcp_ecn.h | |||
@@ -27,9 +27,10 @@ static inline void TCP_ECN_send_synack(struct tcp_sock *tp, | |||
27 | TCP_SKB_CB(skb)->flags &= ~TCPCB_FLAG_ECE; | 27 | TCP_SKB_CB(skb)->flags &= ~TCPCB_FLAG_ECE; |
28 | } | 28 | } |
29 | 29 | ||
30 | static inline void TCP_ECN_send_syn(struct sock *sk, struct tcp_sock *tp, | 30 | static inline void TCP_ECN_send_syn(struct sock *sk, struct sk_buff *skb) |
31 | struct sk_buff *skb) | ||
32 | { | 31 | { |
32 | struct tcp_sock *tp = tcp_sk(sk); | ||
33 | |||
33 | tp->ecn_flags = 0; | 34 | tp->ecn_flags = 0; |
34 | if (sysctl_tcp_ecn) { | 35 | if (sysctl_tcp_ecn) { |
35 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_ECE|TCPCB_FLAG_CWR; | 36 | TCP_SKB_CB(skb)->flags |= TCPCB_FLAG_ECE|TCPCB_FLAG_CWR; |
@@ -44,9 +45,11 @@ TCP_ECN_make_synack(struct request_sock *req, struct tcphdr *th) | |||
44 | th->ece = 1; | 45 | th->ece = 1; |
45 | } | 46 | } |
46 | 47 | ||
47 | static inline void TCP_ECN_send(struct sock *sk, struct tcp_sock *tp, | 48 | static inline void TCP_ECN_send(struct sock *sk, struct sk_buff *skb, |
48 | struct sk_buff *skb, int tcp_header_len) | 49 | int tcp_header_len) |
49 | { | 50 | { |
51 | struct tcp_sock *tp = tcp_sk(sk); | ||
52 | |||
50 | if (tp->ecn_flags & TCP_ECN_OK) { | 53 | if (tp->ecn_flags & TCP_ECN_OK) { |
51 | /* Not-retransmitted data segment: set ECT and inject CWR. */ | 54 | /* Not-retransmitted data segment: set ECT and inject CWR. */ |
52 | if (skb->len != tcp_header_len && | 55 | if (skb->len != tcp_header_len && |
@@ -54,7 +57,7 @@ static inline void TCP_ECN_send(struct sock *sk, struct tcp_sock *tp, | |||
54 | INET_ECN_xmit(sk); | 57 | INET_ECN_xmit(sk); |
55 | if (tp->ecn_flags&TCP_ECN_QUEUE_CWR) { | 58 | if (tp->ecn_flags&TCP_ECN_QUEUE_CWR) { |
56 | tp->ecn_flags &= ~TCP_ECN_QUEUE_CWR; | 59 | tp->ecn_flags &= ~TCP_ECN_QUEUE_CWR; |
57 | skb->h.th->cwr = 1; | 60 | tcp_hdr(skb)->cwr = 1; |
58 | skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN; | 61 | skb_shinfo(skb)->gso_type |= SKB_GSO_TCP_ECN; |
59 | } | 62 | } |
60 | } else { | 63 | } else { |
@@ -62,7 +65,7 @@ static inline void TCP_ECN_send(struct sock *sk, struct tcp_sock *tp, | |||
62 | INET_ECN_dontxmit(sk); | 65 | INET_ECN_dontxmit(sk); |
63 | } | 66 | } |
64 | if (tp->ecn_flags & TCP_ECN_DEMAND_CWR) | 67 | if (tp->ecn_flags & TCP_ECN_DEMAND_CWR) |
65 | skb->h.th->ece = 1; | 68 | tcp_hdr(skb)->ece = 1; |
66 | } | 69 | } |
67 | } | 70 | } |
68 | 71 | ||
@@ -70,7 +73,7 @@ static inline void TCP_ECN_send(struct sock *sk, struct tcp_sock *tp, | |||
70 | 73 | ||
71 | static inline void TCP_ECN_accept_cwr(struct tcp_sock *tp, struct sk_buff *skb) | 74 | static inline void TCP_ECN_accept_cwr(struct tcp_sock *tp, struct sk_buff *skb) |
72 | { | 75 | { |
73 | if (skb->h.th->cwr) | 76 | if (tcp_hdr(skb)->cwr) |
74 | tp->ecn_flags &= ~TCP_ECN_DEMAND_CWR; | 77 | tp->ecn_flags &= ~TCP_ECN_DEMAND_CWR; |
75 | } | 78 | } |
76 | 79 | ||