summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-09-24 11:01:15 -0400
committerDavid S. Miller <davem@davemloft.net>2019-09-27 06:05:02 -0400
commite9a5dceee56cb527a3498f1a59bd8726baa1e717 (patch)
tree5cf9fed816402805777d480e49a5691cd90dc879 /net/ipv6
parent4f6570d7206bb052f42718d55fbe72977f0318ea (diff)
ipv6: tcp: provide sk->sk_priority to ctl packets
We can populate skb->priority for some ctl packets instead of always using zero. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/tcp_ipv6.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 806064c28867..5f557bf27da2 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -804,7 +804,7 @@ static const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = {
804static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 seq, 804static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 seq,
805 u32 ack, u32 win, u32 tsval, u32 tsecr, 805 u32 ack, u32 win, u32 tsval, u32 tsecr,
806 int oif, struct tcp_md5sig_key *key, int rst, 806 int oif, struct tcp_md5sig_key *key, int rst,
807 u8 tclass, __be32 label) 807 u8 tclass, __be32 label, u32 priority)
808{ 808{
809 const struct tcphdr *th = tcp_hdr(skb); 809 const struct tcphdr *th = tcp_hdr(skb);
810 struct tcphdr *t1; 810 struct tcphdr *t1;
@@ -909,7 +909,7 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
909 if (!IS_ERR(dst)) { 909 if (!IS_ERR(dst)) {
910 skb_dst_set(buff, dst); 910 skb_dst_set(buff, dst);
911 ip6_xmit(ctl_sk, buff, &fl6, fl6.flowi6_mark, NULL, tclass, 911 ip6_xmit(ctl_sk, buff, &fl6, fl6.flowi6_mark, NULL, tclass,
912 0); 912 priority);
913 TCP_INC_STATS(net, TCP_MIB_OUTSEGS); 913 TCP_INC_STATS(net, TCP_MIB_OUTSEGS);
914 if (rst) 914 if (rst)
915 TCP_INC_STATS(net, TCP_MIB_OUTRSTS); 915 TCP_INC_STATS(net, TCP_MIB_OUTRSTS);
@@ -932,6 +932,7 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb)
932 struct sock *sk1 = NULL; 932 struct sock *sk1 = NULL;
933#endif 933#endif
934 __be32 label = 0; 934 __be32 label = 0;
935 u32 priority = 0;
935 struct net *net; 936 struct net *net;
936 int oif = 0; 937 int oif = 0;
937 938
@@ -992,6 +993,7 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb)
992 trace_tcp_send_reset(sk, skb); 993 trace_tcp_send_reset(sk, skb);
993 if (np->repflow) 994 if (np->repflow)
994 label = ip6_flowlabel(ipv6h); 995 label = ip6_flowlabel(ipv6h);
996 priority = sk->sk_priority;
995 } 997 }
996 if (sk->sk_state == TCP_TIME_WAIT) 998 if (sk->sk_state == TCP_TIME_WAIT)
997 label = cpu_to_be32(inet_twsk(sk)->tw_flowlabel); 999 label = cpu_to_be32(inet_twsk(sk)->tw_flowlabel);
@@ -1001,7 +1003,7 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb)
1001 } 1003 }
1002 1004
1003 tcp_v6_send_response(sk, skb, seq, ack_seq, 0, 0, 0, oif, key, 1, 0, 1005 tcp_v6_send_response(sk, skb, seq, ack_seq, 0, 0, 0, oif, key, 1, 0,
1004 label); 1006 label, priority);
1005 1007
1006#ifdef CONFIG_TCP_MD5SIG 1008#ifdef CONFIG_TCP_MD5SIG
1007out: 1009out:
@@ -1012,10 +1014,10 @@ out:
1012static void tcp_v6_send_ack(const struct sock *sk, struct sk_buff *skb, u32 seq, 1014static void tcp_v6_send_ack(const struct sock *sk, struct sk_buff *skb, u32 seq,
1013 u32 ack, u32 win, u32 tsval, u32 tsecr, int oif, 1015 u32 ack, u32 win, u32 tsval, u32 tsecr, int oif,
1014 struct tcp_md5sig_key *key, u8 tclass, 1016 struct tcp_md5sig_key *key, u8 tclass,
1015 __be32 label) 1017 __be32 label, u32 priority)
1016{ 1018{
1017 tcp_v6_send_response(sk, skb, seq, ack, win, tsval, tsecr, oif, key, 0, 1019 tcp_v6_send_response(sk, skb, seq, ack, win, tsval, tsecr, oif, key, 0,
1018 tclass, label); 1020 tclass, label, priority);
1019} 1021}
1020 1022
1021static void tcp_v6_timewait_ack(struct sock *sk, struct sk_buff *skb) 1023static void tcp_v6_timewait_ack(struct sock *sk, struct sk_buff *skb)
@@ -1027,7 +1029,7 @@ static void tcp_v6_timewait_ack(struct sock *sk, struct sk_buff *skb)
1027 tcptw->tw_rcv_wnd >> tw->tw_rcv_wscale, 1029 tcptw->tw_rcv_wnd >> tw->tw_rcv_wscale,
1028 tcp_time_stamp_raw() + tcptw->tw_ts_offset, 1030 tcp_time_stamp_raw() + tcptw->tw_ts_offset,
1029 tcptw->tw_ts_recent, tw->tw_bound_dev_if, tcp_twsk_md5_key(tcptw), 1031 tcptw->tw_ts_recent, tw->tw_bound_dev_if, tcp_twsk_md5_key(tcptw),
1030 tw->tw_tclass, cpu_to_be32(tw->tw_flowlabel)); 1032 tw->tw_tclass, cpu_to_be32(tw->tw_flowlabel), 0);
1031 1033
1032 inet_twsk_put(tw); 1034 inet_twsk_put(tw);
1033} 1035}
@@ -1050,7 +1052,7 @@ static void tcp_v6_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb,
1050 tcp_time_stamp_raw() + tcp_rsk(req)->ts_off, 1052 tcp_time_stamp_raw() + tcp_rsk(req)->ts_off,
1051 req->ts_recent, sk->sk_bound_dev_if, 1053 req->ts_recent, sk->sk_bound_dev_if,
1052 tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->saddr), 1054 tcp_v6_md5_do_lookup(sk, &ipv6_hdr(skb)->saddr),
1053 0, 0); 1055 0, 0, sk->sk_priority);
1054} 1056}
1055 1057
1056 1058