diff options
author | Eric Dumazet <edumazet@google.com> | 2019-09-24 11:01:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-09-27 06:05:02 -0400 |
commit | 4f6570d7206bb052f42718d55fbe72977f0318ea (patch) | |
tree | b3c4209f2bbdf23725de9edae630d25e65f0c99b /net/ipv6 | |
parent | 2b6fd3ea438c742d162a40a124b0181922633163 (diff) |
ipv6: add priority parameter to ip6_xmit()
Currently, ip6_xmit() sets skb->priority based on sk->sk_priority
This is not desirable for TCP since TCP shares the same ctl socket
for a given netns. We want to be able to send RST or ACK packets
with a non zero skb->priority.
This patch has no functional change.
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/inet6_connection_sock.c | 2 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 4 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 6 |
3 files changed, 7 insertions, 5 deletions
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index 4da24aa6c696..0a0945a5b30d 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c | |||
@@ -133,7 +133,7 @@ int inet6_csk_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl_unused | |||
133 | fl6.daddr = sk->sk_v6_daddr; | 133 | fl6.daddr = sk->sk_v6_daddr; |
134 | 134 | ||
135 | res = ip6_xmit(sk, skb, &fl6, sk->sk_mark, rcu_dereference(np->opt), | 135 | res = ip6_xmit(sk, skb, &fl6, sk->sk_mark, rcu_dereference(np->opt), |
136 | np->tclass); | 136 | np->tclass, sk->sk_priority); |
137 | rcu_read_unlock(); | 137 | rcu_read_unlock(); |
138 | return res; | 138 | return res; |
139 | } | 139 | } |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 89a4c7c2e25d..edadee4a7e76 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -193,7 +193,7 @@ bool ip6_autoflowlabel(struct net *net, const struct ipv6_pinfo *np) | |||
193 | * which are using proper atomic operations or spinlocks. | 193 | * which are using proper atomic operations or spinlocks. |
194 | */ | 194 | */ |
195 | int ip6_xmit(const struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, | 195 | int ip6_xmit(const struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, |
196 | __u32 mark, struct ipv6_txoptions *opt, int tclass) | 196 | __u32 mark, struct ipv6_txoptions *opt, int tclass, u32 priority) |
197 | { | 197 | { |
198 | struct net *net = sock_net(sk); | 198 | struct net *net = sock_net(sk); |
199 | const struct ipv6_pinfo *np = inet6_sk(sk); | 199 | const struct ipv6_pinfo *np = inet6_sk(sk); |
@@ -258,7 +258,7 @@ int ip6_xmit(const struct sock *sk, struct sk_buff *skb, struct flowi6 *fl6, | |||
258 | hdr->daddr = *first_hop; | 258 | hdr->daddr = *first_hop; |
259 | 259 | ||
260 | skb->protocol = htons(ETH_P_IPV6); | 260 | skb->protocol = htons(ETH_P_IPV6); |
261 | skb->priority = sk->sk_priority; | 261 | skb->priority = priority; |
262 | skb->mark = mark; | 262 | skb->mark = mark; |
263 | 263 | ||
264 | mtu = dst_mtu(dst); | 264 | mtu = dst_mtu(dst); |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 87f44d3250ee..806064c28867 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -512,7 +512,8 @@ static int tcp_v6_send_synack(const struct sock *sk, struct dst_entry *dst, | |||
512 | opt = ireq->ipv6_opt; | 512 | opt = ireq->ipv6_opt; |
513 | if (!opt) | 513 | if (!opt) |
514 | opt = rcu_dereference(np->opt); | 514 | opt = rcu_dereference(np->opt); |
515 | err = ip6_xmit(sk, skb, fl6, sk->sk_mark, opt, np->tclass); | 515 | err = ip6_xmit(sk, skb, fl6, sk->sk_mark, opt, np->tclass, |
516 | sk->sk_priority); | ||
516 | rcu_read_unlock(); | 517 | rcu_read_unlock(); |
517 | err = net_xmit_eval(err); | 518 | err = net_xmit_eval(err); |
518 | } | 519 | } |
@@ -907,7 +908,8 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 | |||
907 | dst = ip6_dst_lookup_flow(ctl_sk, &fl6, NULL); | 908 | dst = ip6_dst_lookup_flow(ctl_sk, &fl6, NULL); |
908 | if (!IS_ERR(dst)) { | 909 | if (!IS_ERR(dst)) { |
909 | skb_dst_set(buff, dst); | 910 | skb_dst_set(buff, dst); |
910 | 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); | ||
911 | TCP_INC_STATS(net, TCP_MIB_OUTSEGS); | 913 | TCP_INC_STATS(net, TCP_MIB_OUTSEGS); |
912 | if (rst) | 914 | if (rst) |
913 | TCP_INC_STATS(net, TCP_MIB_OUTRSTS); | 915 | TCP_INC_STATS(net, TCP_MIB_OUTRSTS); |