staticd: To set the default value of blackhole type correctly

When nexthop is allocated, default value of blockhole type
was not getting set, this leads to below problem. The default
value should be in-sync with the deafult value in yang model.

c t
ip route 131.1.1.0/24 Null0

do show running-config
...
!
ip route 131.1.1.0/24 blackhole
!
end

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
This commit is contained in:
vdhingra 2020-10-09 09:23:14 -07:00
parent e13013d4ba
commit a2eca51c47

View File

@ -283,6 +283,7 @@ static_add_nexthop(struct route_node *rn, struct static_path *pn, safi_t safi,
break; break;
case STATIC_BLACKHOLE: case STATIC_BLACKHOLE:
nh->bh_type = STATIC_BLACKHOLE_NULL;
break; break;
case STATIC_IFNAME: case STATIC_IFNAME:
ifp = if_lookup_by_name(ifname, nh_svrf->vrf->vrf_id); ifp = if_lookup_by_name(ifname, nh_svrf->vrf->vrf_id);