summaryrefslogtreecommitdiff
path: root/net/ipv6/inet6_connection_sock.c
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2014-03-31 16:23:51 +0900
committerSimon Wilson <simonwilson@google.com>2014-09-04 17:41:23 -0700
commitdbd37aae078b14794161b5e37a700d9847c7f95f (patch)
tree54933cfadb7ef633b7b6955d0486265fdf31163b /net/ipv6/inet6_connection_sock.c
parent8440dace67872c28b11c1a438a0ec0501e2effcc (diff)
downloadolio-linux-3.10-dbd37aae078b14794161b5e37a700d9847c7f95f.tar.xz
olio-linux-3.10-dbd37aae078b14794161b5e37a700d9847c7f95f.zip
net: core: Support UID-based routing.
This contains the following commits: 1. cc2f522 net: core: Add a UID range to fib rules. 2. d7ed2bd net: core: Use the socket UID in routing lookups. 3. 2f9306a net: core: Add a RTA_UID attribute to routes. This is so that userspace can do per-UID route lookups. 4. 8e46efb net: ipv6: Use the UID in IPv6 PMTUD IPv4 PMTUD already does this because ipv4_sk_update_pmtu uses __build_flow_key, which includes the UID. Bug: 15413527 Change-Id: I81bd31dae655de9cce7d7a1f9a905dc1c2feba7c Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Diffstat (limited to 'net/ipv6/inet6_connection_sock.c')
-rw-r--r--net/ipv6/inet6_connection_sock.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c
index f1493138d21..65a46058c85 100644
--- a/net/ipv6/inet6_connection_sock.c
+++ b/net/ipv6/inet6_connection_sock.c
@@ -84,6 +84,7 @@ struct dst_entry *inet6_csk_route_req(struct sock *sk,
fl6->flowi6_mark = inet_rsk(req)->ir_mark;
fl6->fl6_dport = inet_rsk(req)->rmt_port;
fl6->fl6_sport = inet_rsk(req)->loc_port;
+ fl6->flowi6_uid = sock_i_uid(sk);
security_req_classify_flow(req, flowi6_to_flowi(fl6));
dst = ip6_dst_lookup_flow(sk, fl6, final_p, false);
@@ -211,6 +212,7 @@ static struct dst_entry *inet6_csk_route_socket(struct sock *sk,
fl6->flowi6_mark = sk->sk_mark;
fl6->fl6_sport = inet->inet_sport;
fl6->fl6_dport = inet->inet_dport;
+ fl6->flowi6_uid = sock_i_uid(sk);
security_sk_classify_flow(sk, flowi6_to_flowi(fl6));
final_p = fl6_update_dst(fl6, np->opt, &final);