]> git.baikalelectronics.ru Git - kernel.git/commit
lwtunnel: valid encap attr check should return 0 when lwtunnel is disabled
authorDavid Ahern <dsa@cumulusnetworks.com>
Wed, 8 Feb 2017 17:29:00 +0000 (09:29 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Feb 2017 17:52:11 +0000 (12:52 -0500)
commitfba29c2e2ab085a5f663222bc8478e6a2cb1a41a
tree7c352cf2a83c4bc7f47ea612f8deee36638b36c2
parent8f24ce039c9d0149aa1367055bc4ae76461f864f
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 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: 394d4c5abed7 ("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>
include/net/lwtunnel.h