]>
Commit | Line | Data |
---|---|---|
2380c486 JR |
1 | diff -Nur linux-2.6.26.3/include/net/inet_sock.h linux-2.6.26.3-zph/include/net/inet_sock.h |
2 | --- linux-2.6.26.3/include/net/inet_sock.h 2008-08-20 21:11:37.000000000 +0300 | |
3 | +++ linux-2.6.26.3-zph/include/net/inet_sock.h 2008-08-21 16:51:59.000000000 +0300 | |
bd014f2d AM |
4 | @@ -157,6 +157,7 @@ |
5 | __be32 mc_addr; | |
6 | struct ip_mc_socklist __rcu *mc_list; | |
1221cc69 | 7 | struct inet_cork_full cork; |
bd014f2d | 8 | + __u16 zph_tos; /* ZPH TOS received on connect */ |
89d792b8 | 9 | }; |
10 | ||
11 | #define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */ | |
2380c486 JR |
12 | diff -Nur linux-2.6.26.3/net/ipv4/ip_sockglue.c linux-2.6.26.3-zph/net/ipv4/ip_sockglue.c |
13 | --- linux-2.6.26.3/net/ipv4/ip_sockglue.c 2008-08-20 21:11:37.000000000 +0300 | |
14 | +++ linux-2.6.26.3-zph/net/ipv4/ip_sockglue.c 2008-08-21 16:54:21.000000000 +0300 | |
15 | @@ -1126,6 +1126,10 @@ | |
89d792b8 | 16 | int hlim = inet->mc_ttl; |
17 | put_cmsg(&msg, SOL_IP, IP_TTL, sizeof(hlim), &hlim); | |
18 | } | |
19 | + if (inet->cmsg_flags&IP_CMSG_TOS) { | |
2380c486 JR |
20 | + int hlim = inet->zph_tos & 0xFF; |
21 | + put_cmsg(&msg, SOL_IP, IP_TOS, sizeof(hlim), &hlim); | |
22 | + } | |
89d792b8 | 23 | len -= msg.msg_controllen; |
24 | return put_user(len, optlen); | |
25 | } | |
2380c486 JR |
26 | diff -Nur linux-2.6.26.3/net/ipv4/tcp_input.c linux-2.6.26.3-zph/net/ipv4/tcp_input.c |
27 | --- linux-2.6.26.3/net/ipv4/tcp_input.c 2008-08-20 21:11:37.000000000 +0300 | |
28 | +++ linux-2.6.26.3-zph/net/ipv4/tcp_input.c 2008-08-21 17:06:55.000000000 +0300 | |
29 | @@ -3900,6 +3900,8 @@ | |
2380c486 JR |
30 | struct tcp_sock *tp = tcp_sk(sk); |
31 | int eaten = -1; | |
42d62c0a | 32 | bool fragstolen = false; |
2380c486 JR |
33 | + struct inet_sock *inet = inet_sk(sk); |
34 | + struct iphdr *iph = ip_hdr(skb); | |
35 | ||
36 | if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq) | |
37 | goto drop; | |
38 | @@ -3914,6 +3916,12 @@ | |
39 | 4 - tp->rx_opt.tstamp_ok); | |
40 | } | |
41 | ||
42 | + // ZPH: Copy the TOS value of the first data ACK segment | |
43 | + // received from the remote peer. | |
44 | + if (0==(inet->zph_tos & 0x8000)) { | |
45 | + inet->zph_tos = 0x8000 | iph->tos; | |
46 | + } | |
47 | + | |
48 | /* Queue data for delivery to the user. | |
49 | * Packets in sequence go to the receive queue. | |
50 | * Out of sequence packets to the out_of_order_queue. | |
51 | @@ -4915,6 +4923,8 @@ | |
89d792b8 | 52 | struct inet_connection_sock *icsk = inet_csk(sk); |
f94a416f AM |
53 | struct tcp_sock *tp = tcp_sk(sk); |
54 | struct tcp_cookie_values *cvp = tp->cookie_values; | |
89d792b8 | 55 | + struct inet_sock *inet = inet_sk(sk); |
56 | + struct iphdr *iph = ip_hdr(skb); | |
93cc874f | 57 | struct tcp_fastopen_cookie foc = { .len = -1 }; |
89d792b8 | 58 | int saved_clamp = tp->rx_opt.mss_clamp; |
59 | ||
2380c486 | 60 | @@ -4973,6 +4983,15 @@ |
89d792b8 | 61 | |
62 | TCP_ECN_rcv_synack(tp, th); | |
63 | ||
64 | + /* ZPH: | |
2380c486 JR |
65 | + * Copy TOS field from the SYNACK packet to zph_tos field of the af_inet |
66 | + * member of sock structure. This value shall be overwritten when the first | |
67 | + * data segment is received from the peer. However, for completeness in | |
68 | + * case the socket TOS is being asked befor that, we copy the TOS value from | |
69 | + * the SYNACK packet. | |
89d792b8 | 70 | + */ |
71 | + inet->zph_tos = iph->tos; | |
72 | + | |
73 | tp->snd_wl1 = TCP_SKB_CB(skb)->seq; | |
74 | tcp_ack(sk, skb, FLAG_SLOWPATH); | |
2380c486 | 75 |