diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-02-06 07:49:02 +0100 |
---|---|---|
committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-02-06 08:00:12 +0100 |
commit | 975a328e2eb3d1bea5fbc3c232580dd4739d59f0 (patch) | |
tree | 587e51ff3bbf8dc368ecd1c414615d19ff5139ae /ospfd/ospf_lsa.c | |
parent | Merge pull request #5761 from qlyoung/fix-bgp-gr-cruft (diff) | |
download | frr-975a328e2eb3d1bea5fbc3c232580dd4739d59f0.tar.xz frr-975a328e2eb3d1bea5fbc3c232580dd4739d59f0.zip |
*: Replace s_addr 0 => INADDR_ANY
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'ospfd/ospf_lsa.c')
-rw-r--r-- | ospfd/ospf_lsa.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index 6eec87c93..35bbe06cd 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -820,7 +820,7 @@ static struct ospf_lsa *ospf_router_lsa_originate(struct ospf_area *area) } /* Sanity check. */ - if (new->data->adv_router.s_addr == 0) { + if (new->data->adv_router.s_addr == INADDR_ANY) { if (IS_DEBUG_OSPF_EVENT) zlog_debug("LSA[Type1]: AdvRouter is 0, discard"); ospf_lsa_discard(new); @@ -1459,7 +1459,7 @@ struct in_addr ospf_get_ip_from_ifp(struct ospf_interface *oi) { struct in_addr fwd; - fwd.s_addr = 0; + fwd.s_addr = INADDR_ANY; if (if_is_operative(oi->ifp)) return oi->address->u.prefix4; @@ -1931,7 +1931,7 @@ int is_prefix_default(struct prefix_ipv4 *p) struct prefix_ipv4 q; q.family = AF_INET; - q.prefix.s_addr = 0; + q.prefix.s_addr = INADDR_ANY; q.prefixlen = 0; return prefix_same((struct prefix *)p, (struct prefix *)&q); @@ -1979,10 +1979,11 @@ struct ospf_lsa *ospf_external_lsa_originate(struct ospf *ospf, */ - if (ospf->router_id.s_addr == 0) { + if (ospf->router_id.s_addr == INADDR_ANY) { if (IS_DEBUG_OSPF_EVENT) - zlog_debug("LSA[Type5:%pI4]: deferring AS-external-LSA origination, router ID is zero", - &ei->p.prefix); + zlog_debug( + "LSA[Type5:%pI4]: deferring AS-external-LSA origination, router ID is zero", + &ei->p.prefix); return NULL; } @@ -2197,7 +2198,7 @@ void ospf_external_lsa_refresh_default(struct ospf *ospf) p.family = AF_INET; p.prefixlen = 0; - p.prefix.s_addr = 0; + p.prefix.s_addr = INADDR_ANY; ei = ospf_default_external_info(ospf); lsa = ospf_external_info_find_lsa(ospf, &p); |