Revert "Handle 'sk' being NULL in UID-based routing."
authorStricted <info@stricted.net>
Fri, 7 Sep 2018 09:46:22 +0000 (11:46 +0200)
committerStricted <info@stricted.net>
Tue, 6 Aug 2019 11:33:34 +0000 (11:33 +0000)
This reverts commit 455b09d66a9ccfc572497ae88375ae343ff9ae66.

Change-Id: I1d95864d8b48ae3ca418cfd790cfd62c07f54f66

include/net/route.h
net/ipv4/route.c

index 4546e3d1f7938dd22a83758761093f56452c0fa6..b5b44875543e86768a7fe110520157077b0c9d22 100644 (file)
@@ -142,8 +142,7 @@ static inline struct rtable *ip_route_output_ports(struct net *net, struct flowi
        flowi4_init_output(fl4, oif, sk ? sk->sk_mark : 0, tos,
                           RT_SCOPE_UNIVERSE, proto,
                           sk ? inet_sk_flowi_flags(sk) : 0,
-                          daddr, saddr, dport, sport, sk ? sock_i_uid(sk) :
-                          GLOBAL_ROOT_UID);
+                          daddr, saddr, dport, sport, sock_i_uid(sk));
        if (sk)
                security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
        return ip_route_output_flow(net, fl4, sk);
index c94cda09614c2c7964fac583d34cabc3a51dbf5d..dd1a3c567af670a577d9da5f2fe28706e3610598 100644 (file)
@@ -532,7 +532,7 @@ static void __build_flow_key(struct flowi4 *fl4, struct sock *sk,
                           RT_SCOPE_UNIVERSE, prot,
                           flow_flags,
                           iph->daddr, iph->saddr, 0, 0,
-                          sk ? sock_i_uid(sk) : GLOBAL_ROOT_UID);
+                          sock_i_uid(sk));
 }
 
 static void build_skb_flow_key(struct flowi4 *fl4, const struct sk_buff *skb,