diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2018-11-17 21:33:37 -0200 | 
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2018-11-17 21:33:37 -0200 | 
| commit | 106935f6719ff924bfd025ce47fa054e35b04335 (patch) | |
| tree | 79487dd64f3b586556afa36d9e789bca2b3fffa1 /zebra/router-id.c | |
| parent | fef6daf4da425621c4c2e67d7579d962f64f43f7 (diff) | |
zebra: improve identification of loopback interfaces in the router-id code
The if_is_loopback() function is the right abstraction for identifying
loopback interfaces. There should be no reason for not using it in the
router-id code.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'zebra/router-id.c')
| -rw-r--r-- | zebra/router-id.c | 6 | 
1 files changed, 2 insertions, 4 deletions
diff --git a/zebra/router-id.c b/zebra/router-id.c index 3b96b3371d..c500f79a6c 100644 --- a/zebra/router-id.c +++ b/zebra/router-id.c @@ -132,8 +132,7 @@ void router_id_add_address(struct connected *ifc)  	router_id_get(&before, zvrf_id(zvrf)); -	if (!strncmp(ifc->ifp->name, "lo", 2) -	    || !strncmp(ifc->ifp->name, "dummy", 5)) +	if (if_is_loopback(ifc->ifp))  		l = zvrf->rid_lo_sorted_list;  	else  		l = zvrf->rid_all_sorted_list; @@ -165,8 +164,7 @@ void router_id_del_address(struct connected *ifc)  	router_id_get(&before, zvrf_id(zvrf)); -	if (!strncmp(ifc->ifp->name, "lo", 2) -	    || !strncmp(ifc->ifp->name, "dummy", 5)) +	if (if_is_loopback(ifc->ifp))  		l = zvrf->rid_lo_sorted_list;  	else  		l = zvrf->rid_all_sorted_list;  | 
