diff options
author | Florent Fourcot <florent.fourcot@enst-bretagne.fr> | 2013-12-08 09:46:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-09 21:03:49 -0500 |
commit | 82e9f105a28006e7ff864220a28cf62ea6d1e280 (patch) | |
tree | 02a492ba4d118b58309484ccf9d1327d9cd46f92 | |
parent | 37cfee909c5a396abccf43e3e0a63a5f5ac998af (diff) |
ipv6: remove rcv_tclass of ipv6_pinfo
tclass information in now already stored in rcv_flowinfo
We do not need to store the same information twice.
Signed-off-by: Florent Fourcot <florent.fourcot@enst-bretagne.fr>
Reviewed-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/ipv6.h | 1 | ||||
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 2 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 6 |
3 files changed, 2 insertions, 7 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 0b2ebfbbe0f4..3fde06645553 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -200,7 +200,6 @@ struct ipv6_pinfo { | |||
200 | dontfrag:1; | 200 | dontfrag:1; |
201 | __u8 min_hopcount; | 201 | __u8 min_hopcount; |
202 | __u8 tclass; | 202 | __u8 tclass; |
203 | __u8 rcv_tclass; | ||
204 | __be32 rcv_flowinfo; | 203 | __be32 rcv_flowinfo; |
205 | 204 | ||
206 | __u32 dst_cookie; | 205 | __u32 dst_cookie; |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index c2db1df46385..7d9391506856 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -1019,7 +1019,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
1019 | put_cmsg(&msg, SOL_IPV6, IPV6_HOPLIMIT, sizeof(hlim), &hlim); | 1019 | put_cmsg(&msg, SOL_IPV6, IPV6_HOPLIMIT, sizeof(hlim), &hlim); |
1020 | } | 1020 | } |
1021 | if (np->rxopt.bits.rxtclass) { | 1021 | if (np->rxopt.bits.rxtclass) { |
1022 | int tclass = np->rcv_tclass; | 1022 | int tclass = ntohl(np->rcv_flowinfo & IPV6_TCLASS_MASK) >> 20; |
1023 | put_cmsg(&msg, SOL_IPV6, IPV6_TCLASS, sizeof(tclass), &tclass); | 1023 | put_cmsg(&msg, SOL_IPV6, IPV6_TCLASS, sizeof(tclass), &tclass); |
1024 | } | 1024 | } |
1025 | if (np->rxopt.bits.rxoinfo) { | 1025 | if (np->rxopt.bits.rxoinfo) { |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 79a196369558..bd91e7ff482b 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1135,7 +1135,6 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1135 | newnp->opt = NULL; | 1135 | newnp->opt = NULL; |
1136 | newnp->mcast_oif = inet6_iif(skb); | 1136 | newnp->mcast_oif = inet6_iif(skb); |
1137 | newnp->mcast_hops = ipv6_hdr(skb)->hop_limit; | 1137 | newnp->mcast_hops = ipv6_hdr(skb)->hop_limit; |
1138 | newnp->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(skb)); | ||
1139 | newnp->rcv_flowinfo = ip6_flowinfo(ipv6_hdr(skb)); | 1138 | newnp->rcv_flowinfo = ip6_flowinfo(ipv6_hdr(skb)); |
1140 | 1139 | ||
1141 | /* | 1140 | /* |
@@ -1216,7 +1215,6 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1216 | newnp->opt = NULL; | 1215 | newnp->opt = NULL; |
1217 | newnp->mcast_oif = inet6_iif(skb); | 1216 | newnp->mcast_oif = inet6_iif(skb); |
1218 | newnp->mcast_hops = ipv6_hdr(skb)->hop_limit; | 1217 | newnp->mcast_hops = ipv6_hdr(skb)->hop_limit; |
1219 | newnp->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(skb)); | ||
1220 | newnp->rcv_flowinfo = ip6_flowinfo(ipv6_hdr(skb)); | 1218 | newnp->rcv_flowinfo = ip6_flowinfo(ipv6_hdr(skb)); |
1221 | 1219 | ||
1222 | /* Clone native IPv6 options from listening socket (if any) | 1220 | /* Clone native IPv6 options from listening socket (if any) |
@@ -1427,9 +1425,7 @@ ipv6_pktoptions: | |||
1427 | np->mcast_oif = inet6_iif(opt_skb); | 1425 | np->mcast_oif = inet6_iif(opt_skb); |
1428 | if (np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) | 1426 | if (np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) |
1429 | np->mcast_hops = ipv6_hdr(opt_skb)->hop_limit; | 1427 | np->mcast_hops = ipv6_hdr(opt_skb)->hop_limit; |
1430 | if (np->rxopt.bits.rxtclass) | 1428 | if (np->rxopt.bits.rxflow || np->rxopt.bits.rxtclass) |
1431 | np->rcv_tclass = ipv6_get_dsfield(ipv6_hdr(opt_skb)); | ||
1432 | if (np->rxopt.bits.rxflow) | ||
1433 | np->rcv_flowinfo = ip6_flowinfo(ipv6_hdr(opt_skb)); | 1429 | np->rcv_flowinfo = ip6_flowinfo(ipv6_hdr(opt_skb)); |
1434 | if (ipv6_opt_accepted(sk, opt_skb)) { | 1430 | if (ipv6_opt_accepted(sk, opt_skb)) { |
1435 | skb_set_owner_r(opt_skb, sk); | 1431 | skb_set_owner_r(opt_skb, sk); |