mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 17:18:56 +00:00
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>
This commit is contained in:
parent
fef6daf4da
commit
106935f671
@ -132,8 +132,7 @@ void router_id_add_address(struct connected *ifc)
|
|||||||
|
|
||||||
router_id_get(&before, zvrf_id(zvrf));
|
router_id_get(&before, zvrf_id(zvrf));
|
||||||
|
|
||||||
if (!strncmp(ifc->ifp->name, "lo", 2)
|
if (if_is_loopback(ifc->ifp))
|
||||||
|| !strncmp(ifc->ifp->name, "dummy", 5))
|
|
||||||
l = zvrf->rid_lo_sorted_list;
|
l = zvrf->rid_lo_sorted_list;
|
||||||
else
|
else
|
||||||
l = zvrf->rid_all_sorted_list;
|
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));
|
router_id_get(&before, zvrf_id(zvrf));
|
||||||
|
|
||||||
if (!strncmp(ifc->ifp->name, "lo", 2)
|
if (if_is_loopback(ifc->ifp))
|
||||||
|| !strncmp(ifc->ifp->name, "dummy", 5))
|
|
||||||
l = zvrf->rid_lo_sorted_list;
|
l = zvrf->rid_lo_sorted_list;
|
||||||
else
|
else
|
||||||
l = zvrf->rid_all_sorted_list;
|
l = zvrf->rid_all_sorted_list;
|
||||||
|
Loading…
Reference in New Issue
Block a user