diff options
| author | anlan_cs <vic.lan@pica8.com> | 2023-06-05 16:23:16 +0800 | 
|---|---|---|
| committer | anlan_cs <vic.lan@pica8.com> | 2023-07-13 15:51:08 +0800 | 
| commit | 871d78e90ffb1c44229c76051f8b83ad95174206 (patch) | |
| tree | 3093add1b46f79a4724f8983aa4314326fba2cb3 /bgpd/bgp_nht.c | |
| parent | a99521a26f7ca02bc4d4d9dcc36b8f80a4c3d2f7 (diff) | |
bgpd: ignore the wrong interface for nht procedure
`bnc->ifindex` should not be with 0 ( IFINDEX_INTERNAL ), so we can ignore
the wrong interface to make it safe.
Signed-off-by: anlan_cs <vic.lan@pica8.com>
Diffstat (limited to 'bgpd/bgp_nht.c')
| -rw-r--r-- | bgpd/bgp_nht.c | 5 | 
1 files changed, 5 insertions, 0 deletions
diff --git a/bgpd/bgp_nht.c b/bgpd/bgp_nht.c index a46616803c..5a511eac1c 100644 --- a/bgpd/bgp_nht.c +++ b/bgpd/bgp_nht.c @@ -714,6 +714,11 @@ static void bgp_nht_ifp_table_handle(struct bgp *bgp,  {  	struct bgp_nexthop_cache *bnc; +	if (ifp->ifindex == IFINDEX_INTERNAL) { +		zlog_warn("%s: The interface %s ignored", __func__, ifp->name); +		return; +	} +  	frr_each (bgp_nexthop_cache, table, bnc) {  		if (bnc->ifindex != ifp->ifindex)  			continue;  | 
