mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
net: ipv4: tcp: Fix crash in tcp_nuke_addr
ip_route_output_key can return an ERR_PTR, don't dereference it. Change-Id: I6b86a451b2bdb33873d79b3cf90c11dbe72bc081 Signed-off-by: Colin Cross <ccross@android.com>
This commit is contained in:
@@ -3334,7 +3334,7 @@ static int tcp_is_local(struct net *net, __be32 addr) {
|
||||
struct rtable *rt;
|
||||
struct flowi4 fl4 = { .daddr = addr };
|
||||
rt = ip_route_output_key(net, &fl4);
|
||||
if (!rt)
|
||||
if (IS_ERR_OR_NULL(rt))
|
||||
return 0;
|
||||
return rt->dst.dev && (rt->dst.dev->flags & IFF_LOOPBACK);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user