Skip to content

Commit 2b7f50d

Browse files
David Aherngregkh
authored andcommitted
lwtunnel: valid encap attr check should return 0 when lwtunnel is disabled
[ Upstream commit 2bd137d ] 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 supported The 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. Fixes: 9ed5959 ("lwtunnel: fix autoload of lwt modules") Reported-by: pupilla@libero.it Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 00eff2e commit 2b7f50d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎include/net/lwtunnel.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@ static inline int lwtunnel_valid_encap_type(u16 encap_type)
176176
}
177177
static inline int lwtunnel_valid_encap_type_attr(struct nlattr *attr, int len)
178178
{
179-
return -EOPNOTSUPP;
179+
/* return 0 since we are not walking attr looking for
180+
* RTA_ENCAP_TYPE attribute on nexthops.
181+
*/
182+
return 0;
180183
}
181184

182185
static inline int lwtunnel_build_state(struct net_device *dev, u16 encap_type,

0 commit comments

Comments
 (0)