aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/af_inet.c1
-rw-r--r--net/ipv4/ip_sockglue.c4
-rw-r--r--net/ipv4/tcp_ipv4.c1
3 files changed, 6 insertions, 0 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index f7b5670744f0..e588a34e85c2 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -381,6 +381,7 @@ lookup_protocol:
381 inet->mc_all = 1; 381 inet->mc_all = 1;
382 inet->mc_index = 0; 382 inet->mc_index = 0;
383 inet->mc_list = NULL; 383 inet->mc_list = NULL;
384 inet->rcv_tos = 0;
384 385
385 sk_refcnt_debug_inc(sk); 386 sk_refcnt_debug_inc(sk);
386 387
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 9125529dab95..ca50d9f9f8c1 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -1289,6 +1289,10 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
1289 int hlim = inet->mc_ttl; 1289 int hlim = inet->mc_ttl;
1290 put_cmsg(&msg, SOL_IP, IP_TTL, sizeof(hlim), &hlim); 1290 put_cmsg(&msg, SOL_IP, IP_TTL, sizeof(hlim), &hlim);
1291 } 1291 }
1292 if (inet->cmsg_flags & IP_CMSG_TOS) {
1293 int tos = inet->rcv_tos;
1294 put_cmsg(&msg, SOL_IP, IP_TOS, sizeof(tos), &tos);
1295 }
1292 len -= msg.msg_controllen; 1296 len -= msg.msg_controllen;
1293 return put_user(len, optlen); 1297 return put_user(len, optlen);
1294 } 1298 }
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 4d6f81c818dc..94abee8cf563 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1463,6 +1463,7 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
1463 ireq->opt = NULL; 1463 ireq->opt = NULL;
1464 newinet->mc_index = inet_iif(skb); 1464 newinet->mc_index = inet_iif(skb);
1465 newinet->mc_ttl = ip_hdr(skb)->ttl; 1465 newinet->mc_ttl = ip_hdr(skb)->ttl;
1466 newinet->rcv_tos = ip_hdr(skb)->tos;
1466 inet_csk(newsk)->icsk_ext_hdr_len = 0; 1467 inet_csk(newsk)->icsk_ext_hdr_len = 0;
1467 if (inet_opt) 1468 if (inet_opt)
1468 inet_csk(newsk)->icsk_ext_hdr_len = inet_opt->opt.optlen; 1469 inet_csk(newsk)->icsk_ext_hdr_len = inet_opt->opt.optlen;