summaryrefslogtreecommitdiffstats
path: root/zebra/router-id.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2020-02-06 07:49:02 +0100
committerDonatas Abraitis <donatas.abraitis@gmail.com>2020-02-06 08:00:12 +0100
commit975a328e2eb3d1bea5fbc3c232580dd4739d59f0 (patch)
tree587e51ff3bbf8dc368ecd1c414615d19ff5139ae /zebra/router-id.c
parentMerge pull request #5761 from qlyoung/fix-bgp-gr-cruft (diff)
downloadfrr-975a328e2eb3d1bea5fbc3c232580dd4739d59f0.tar.xz
frr-975a328e2eb3d1bea5fbc3c232580dd4739d59f0.zip
*: Replace s_addr 0 => INADDR_ANY
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'zebra/router-id.c')
-rw-r--r--zebra/router-id.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/zebra/router-id.c b/zebra/router-id.c
index b37d4aea7..710f2f6c2 100644
--- a/zebra/router-id.c
+++ b/zebra/router-id.c
@@ -75,11 +75,11 @@ void router_id_get(struct prefix *p, vrf_id_t vrf_id)
struct connected *c;
struct zebra_vrf *zvrf = vrf_info_get(vrf_id);
- p->u.prefix4.s_addr = 0;
+ p->u.prefix4.s_addr = INADDR_ANY;
p->family = AF_INET;
p->prefixlen = 32;
- if (zvrf->rid_user_assigned.u.prefix4.s_addr)
+ if (zvrf->rid_user_assigned.u.prefix4.s_addr != INADDR_ANY)
p->u.prefix4.s_addr = zvrf->rid_user_assigned.u.prefix4.s_addr;
else if (!list_isempty(zvrf->rid_lo_sorted_list)) {
node = listtail(zvrf->rid_lo_sorted_list);
@@ -185,7 +185,8 @@ void router_id_write(struct vty *vty)
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
if ((zvrf = vrf->info) != NULL)
- if (zvrf->rid_user_assigned.u.prefix4.s_addr) {
+ if (zvrf->rid_user_assigned.u.prefix4.s_addr
+ != INADDR_ANY) {
if (zvrf_id(zvrf) == VRF_DEFAULT)
vty_out(vty, "router-id %s\n",
inet_ntoa(