diff options
| author | David Ahern <dsa@cumulusnetworks.com> | 2017-03-28 18:19:49 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2017-03-29 13:42:38 -0400 |
| commit | e944e97afc66e619603390fc5f0c6bc02f961353 (patch) | |
| tree | 5e36311befb29727fbeccd388170286706f468a6 /net/mpls | |
| parent | d0281a56b00c63ad51ebb550fba0351807475c47 (diff) | |
net: mpls: Update lfib_nlmsg_size to skip deleted nexthops
A recent commit skips nexthops in a route if the device has been
deleted. Update lfib_nlmsg_size accordingly.
Reported-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Acked-by: Robert Shearman <rshearma@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mpls')
| -rw-r--r-- | net/mpls/af_mpls.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index 673f3d990b5c..06ffafde70da 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c | |||
| @@ -1880,6 +1880,8 @@ static inline size_t lfib_nlmsg_size(struct mpls_route *rt) | |||
| 1880 | size_t nhsize = 0; | 1880 | size_t nhsize = 0; |
| 1881 | 1881 | ||
| 1882 | for_nexthops(rt) { | 1882 | for_nexthops(rt) { |
| 1883 | if (!rtnl_dereference(nh->nh_dev)) | ||
| 1884 | continue; | ||
| 1883 | nhsize += nla_total_size(sizeof(struct rtnexthop)); | 1885 | nhsize += nla_total_size(sizeof(struct rtnexthop)); |
| 1884 | /* RTA_VIA */ | 1886 | /* RTA_VIA */ |
| 1885 | if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC) | 1887 | if (nh->nh_via_table != MPLS_NEIGH_TABLE_UNSPEC) |
