]> git.baikalelectronics.ru Git - kernel.git/commit
net: mpls: Fix notifications when deleting a device
authorBenjamin Poirier <bpoirier@nvidia.com>
Mon, 29 Nov 2021 06:15:05 +0000 (15:15 +0900)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Nov 2021 12:39:42 +0000 (12:39 +0000)
commitce4db62dda1c4b3e8893f3a43a4195fb335137bc
treea1deeff61163734f71c268789a6fbc1d7086f71c
parentb35c4c5183612f22e1b5e4d1a423cb91bfea6e0f
net: mpls: Fix notifications when deleting a device

There are various problems related to netlink notifications for mpls route
changes in response to interfaces being deleted:
* delete interface of only nexthop
DELROUTE notification is missing RTA_OIF attribute
* delete interface of non-last nexthop
NEWROUTE notification is missing entirely
* delete interface of last nexthop
DELROUTE notification is missing nexthop

All of these problems stem from the fact that existing routes are modified
in-place before sending a notification. Restructure mpls_ifdown() to avoid
changing the route in the DELROUTE cases and to create a copy in the
NEWROUTE case.

Fixes: 26167ae9dfa7 ("mpls: multipath route support")
Signed-off-by: Benjamin Poirier <bpoirier@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mpls/af_mpls.c