Skip to content

Commit

Permalink
net: evaluate net.ipvX.conf.all.disable_policy and disable_xfrm
Browse files Browse the repository at this point in the history
[ Upstream commit 62679a8 ]

The disable_policy and disable_xfrm are a per-interface sysctl to
disable IPsec policy or encryption on an interface. However, while a
"all" variant is exposed, it was a noop since it was never evaluated.
We use the usual "or" logic for this kind of sysctls.

Signed-off-by: Vincent Bernat <vincent@bernat.ch>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
vincentbernat authored and gregkh committed May 25, 2022
1 parent 1bc27eb commit 243e72e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
flags |= RTCF_LOCAL;

rth = rt_dst_alloc(dev_net(dev)->loopback_dev, flags, RTN_MULTICAST,
IN_DEV_CONF_GET(in_dev, NOPOLICY), false);
IN_DEV_ORCONF(in_dev, NOPOLICY), false);
if (!rth)
return -ENOBUFS;

Expand Down Expand Up @@ -1893,8 +1893,8 @@ static int __mkroute_input(struct sk_buff *skb,
}

rth = rt_dst_alloc(out_dev->dev, 0, res->type,
IN_DEV_CONF_GET(in_dev, NOPOLICY),
IN_DEV_CONF_GET(out_dev, NOXFRM));
IN_DEV_ORCONF(in_dev, NOPOLICY),
IN_DEV_ORCONF(out_dev, NOXFRM));
if (!rth) {
err = -ENOBUFS;
goto cleanup;
Expand Down Expand Up @@ -2276,7 +2276,7 @@ out: return err;

rth = rt_dst_alloc(ip_rt_get_dev(net, res),
flags | RTCF_LOCAL, res->type,
IN_DEV_CONF_GET(in_dev, NOPOLICY), false);
IN_DEV_ORCONF(in_dev, NOPOLICY), false);
if (!rth)
goto e_nobufs;

Expand Down Expand Up @@ -2499,8 +2499,8 @@ static struct rtable *__mkroute_output(const struct fib_result *res,

add:
rth = rt_dst_alloc(dev_out, flags, type,
IN_DEV_CONF_GET(in_dev, NOPOLICY),
IN_DEV_CONF_GET(in_dev, NOXFRM));
IN_DEV_ORCONF(in_dev, NOPOLICY),
IN_DEV_ORCONF(in_dev, NOXFRM));
if (!rth)
return ERR_PTR(-ENOBUFS);

Expand Down

0 comments on commit 243e72e

Please sign in to comment.