lwtunnel: valid encap attr check should return 0 when lwtunnel is disabled
Subsystems (3)
PATCH 1/1 lwtunnel: valid encap attr check should return 0 when lwtunnel is disabled
An error was reported upgrading to 4.9.8:
root@Typhoon:~# ip route add default table 210 nexthop dev eth0 via 10.68.64.1
weight 1 nexthop dev eth0 via 10.68.64.2 weight 1
RTNETLINK answers: Operation not supportedThe problem occurs when CONFIG_LWTUNNEL is not enabled and a multipath route is submitted.
The point of lwtunnel_valid_encap_type_attr is catch modules that need to be loaded before any references are taken with rntl held. With CONFIG_LWTUNNEL disabled, there will be no modules to load so the lwtunnel_valid_encap_type_attr stub should just return 0.
--- include/net/lwtunnel.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/net/lwtunnel.h +4 -1
@@ -178,7 +178,10 @@ static inline int lwtunnel_valid_encap_type(u16 encap_type) }static inline int lwtunnel_valid_encap_type_attr (struct nlattr *attr,int len) { -return -EOPNOTSUPP ; +/* return 0 since we are not walking attr looking for +* RTA_ENCAP_TYPE attribute on nexthops. +*/ +return 0 ; } static inline int lwtunnel_build_state(struct net_device *dev, u16 encap_type,
Signature · 1 line
2.1.4
David Miller
maintainerFrom: David Ahern <[email protected]>
Date: Wed, 8 Feb 2017 09:29:00 -0800
Quoted 8 lines
An error was reported upgrading to 4.9.8:
root@Typhoon:~# ip route add default table 210 nexthop dev eth0 via 10.68.64.1 weight 1 nexthop dev eth0 via 10.68.64.2 weight 1 RTNETLINK answers: Operation not supportedThe problem occurs when
CONFIG_LWTUNNELis not enabled and a multipath route is submitted.
Quoted 8 lines
The point of
lwtunnel_valid_encap_type_attris catch modules that need to be loaded before any references are taken with rntl held. WithCONFIG_LWTUNNELdisabled, there will be no modules to load so thelwtunnel_valid_encap_type_attrstub should just return 0.Fixes 9ed59592e3e3 ("lwtunnel: fix autoload of lwt modules")Reported-by [email protected]Signed-off-by David Ahern <[email protected]>
Applied and queued up for -stable, thanks for fixing this so quickly David.