]> git.itanic.dy.fi Git - linux-stable/commitdiff
mpls: Send route delete notifications when router module is unloaded
authorDavid Ahern <dsa@cumulusnetworks.com>
Fri, 10 Mar 2017 17:46:15 +0000 (09:46 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2017 11:04:16 +0000 (12:04 +0100)
[ Upstream commit e37791ec1ad785b59022ae211f63a16189bacebf ]

When the mpls_router module is unloaded, mpls routes are deleted but
notifications are not sent to userspace leaving userspace caches
out of sync. Add the call to mpls_notify_route in mpls_net_exit as
routes are freed.

Fixes: 0189197f44160 ("mpls: Basic routing support")
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>
net/mpls/af_mpls.c

index 881bc20728097f7e42831399393c3dea34304e39..52cfc4478511413f4852e521068c6f7386040830 100644 (file)
@@ -1567,6 +1567,7 @@ static void mpls_net_exit(struct net *net)
        for (index = 0; index < platform_labels; index++) {
                struct mpls_route *rt = rtnl_dereference(platform_label[index]);
                RCU_INIT_POINTER(platform_label[index], NULL);
+               mpls_notify_route(net, index, rt, NULL, NULL);
                mpls_rt_free(rt);
        }
        rtnl_unlock();