diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-09-27 02:20:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-09-27 02:20:08 -0400 |
commit | b82d1bb4fd206ed305f9e955eeffc4a678149442 (patch) | |
tree | b0790dcc52f9b070e0b646eb6c0b7a16ac8c4a1a | |
parent | 3f192795cf1a0098df7bd655f7a72eee26bd63c3 (diff) |
tcp: unalias tcp_skb_cb flags and ip_dsfield
struct tcp_skb_cb contains a "flags" field containing either tcp flags
or IP dsfield depending on context (input or output path)
Introduce ip_dsfield to make the difference clear and ease maintenance.
If later we want to save space, we can union flags/ip_dsfield
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/tcp.h | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 702aefc8d43d..28a9997d783a 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -642,7 +642,8 @@ struct tcp_skb_cb { | |||
642 | #define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */ | 642 | #define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */ |
643 | #define TCPCB_LOST 0x04 /* SKB is lost */ | 643 | #define TCPCB_LOST 0x04 /* SKB is lost */ |
644 | #define TCPCB_TAGBITS 0x07 /* All tag bits */ | 644 | #define TCPCB_TAGBITS 0x07 /* All tag bits */ |
645 | 645 | __u8 ip_dsfield; /* IPv4 tos or IPv6 dsfield */ | |
646 | /* 1 byte hole */ | ||
646 | #define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */ | 647 | #define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */ |
647 | #define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS) | 648 | #define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS) |
648 | 649 | ||
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 5a4408c55155..7008fccc164f 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -222,7 +222,7 @@ static inline void TCP_ECN_check_ce(struct tcp_sock *tp, const struct sk_buff *s | |||
222 | if (!(tp->ecn_flags & TCP_ECN_OK)) | 222 | if (!(tp->ecn_flags & TCP_ECN_OK)) |
223 | return; | 223 | return; |
224 | 224 | ||
225 | switch (TCP_SKB_CB(skb)->flags & INET_ECN_MASK) { | 225 | switch (TCP_SKB_CB(skb)->ip_dsfield & INET_ECN_MASK) { |
226 | case INET_ECN_NOT_ECT: | 226 | case INET_ECN_NOT_ECT: |
227 | /* Funny extension: if ECT is not set on a segment, | 227 | /* Funny extension: if ECT is not set on a segment, |
228 | * and we already seen ECT on a previous segment, | 228 | * and we already seen ECT on a previous segment, |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index c29912cd83a0..dd3fad9fb633 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1677,7 +1677,7 @@ int tcp_v4_rcv(struct sk_buff *skb) | |||
1677 | skb->len - th->doff * 4); | 1677 | skb->len - th->doff * 4); |
1678 | TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); | 1678 | TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); |
1679 | TCP_SKB_CB(skb)->when = 0; | 1679 | TCP_SKB_CB(skb)->when = 0; |
1680 | TCP_SKB_CB(skb)->flags = iph->tos; | 1680 | TCP_SKB_CB(skb)->ip_dsfield = ipv4_get_dsfield(iph); |
1681 | TCP_SKB_CB(skb)->sacked = 0; | 1681 | TCP_SKB_CB(skb)->sacked = 0; |
1682 | 1682 | ||
1683 | sk = __inet_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest); | 1683 | sk = __inet_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest); |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 12bdb9af96e5..00797d857667 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1717,7 +1717,7 @@ static int tcp_v6_rcv(struct sk_buff *skb) | |||
1717 | skb->len - th->doff*4); | 1717 | skb->len - th->doff*4); |
1718 | TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); | 1718 | TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); |
1719 | TCP_SKB_CB(skb)->when = 0; | 1719 | TCP_SKB_CB(skb)->when = 0; |
1720 | TCP_SKB_CB(skb)->flags = ipv6_get_dsfield(hdr); | 1720 | TCP_SKB_CB(skb)->ip_dsfield = ipv6_get_dsfield(hdr); |
1721 | TCP_SKB_CB(skb)->sacked = 0; | 1721 | TCP_SKB_CB(skb)->sacked = 0; |
1722 | 1722 | ||
1723 | sk = __inet6_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest); | 1723 | sk = __inet6_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest); |