]> git.pld-linux.org Git - packages/kernel.git/blame_incremental - kernel-zph.patch
- up to 4.9.86
[packages/kernel.git] / kernel-zph.patch
... / ...
CommitLineData
1diff -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
4@@ -157,6 +157,7 @@
5 __be32 mc_addr;
6 struct ip_mc_socklist __rcu *mc_list;
7 struct inet_cork_full cork;
8+ __u16 zph_tos; /* ZPH TOS received on connect */
9 };
10
11 #define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */
12diff -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 @@
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) {
20+ int hlim = inet->zph_tos & 0xFF;
21+ put_cmsg(&msg, SOL_IP, IP_TOS, sizeof(hlim), &hlim);
22+ }
23 len -= msg.msg_controllen;
24 return put_user(len, optlen);
25 }
26diff -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 @@
30 struct tcp_sock *tp = tcp_sk(sk);
31 int eaten = -1;
32 bool fragstolen = false;
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,5 +4923,7 @@
52 struct inet_connection_sock *icsk = inet_csk(sk);
53 struct tcp_sock *tp = tcp_sk(sk);
54+ struct inet_sock *inet = inet_sk(sk);
55+ struct iphdr *iph = ip_hdr(skb);
56 struct tcp_fastopen_cookie foc = { .len = -1 };
57 int saved_clamp = tp->rx_opt.mss_clamp;
58
59@@ -4973,6 +4983,15 @@
60
61 TCP_ECN_rcv_synack(tp, th);
62
63+ /* ZPH:
64+ * Copy TOS field from the SYNACK packet to zph_tos field of the af_inet
65+ * member of sock structure. This value shall be overwritten when the first
66+ * data segment is received from the peer. However, for completeness in
67+ * case the socket TOS is being asked befor that, we copy the TOS value from
68+ * the SYNACK packet.
69+ */
70+ inet->zph_tos = iph->tos;
71+
72 tcp_init_wl(tp, TCP_SKB_CB(skb)->seq);
73 tcp_ack(sk, skb, FLAG_SLOWPATH);
74
This page took 0.028 seconds and 4 git commands to generate.