]> git.pld-linux.org Git - packages/kernel.git/blame - kernel-zph.patch
- up to 4.9.217
[packages/kernel.git] / kernel-zph.patch
CommitLineData
2380c486
JR
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
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
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 @@
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
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 @@
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.
c06a8ce3 51@@ -4915,5 +4923,7 @@
89d792b8 52 struct inet_connection_sock *icsk = inet_csk(sk);
f94a416f 53 struct tcp_sock *tp = tcp_sk(sk);
89d792b8 54+ struct inet_sock *inet = inet_sk(sk);
55+ struct iphdr *iph = ip_hdr(skb);
93cc874f 56 struct tcp_fastopen_cookie foc = { .len = -1 };
89d792b8 57 int saved_clamp = tp->rx_opt.mss_clamp;
58
2380c486 59@@ -4973,6 +4983,15 @@
89d792b8 60
61 TCP_ECN_rcv_synack(tp, th);
62
63+ /* ZPH:
2380c486
JR
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.
89d792b8 69+ */
70+ inet->zph_tos = iph->tos;
71+
537831f9 72 tcp_init_wl(tp, TCP_SKB_CB(skb)->seq);
89d792b8 73 tcp_ack(sk, skb, FLAG_SLOWPATH);
2380c486 74
This page took 0.775892 seconds and 4 git commands to generate.