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 /lib/prefix.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 'lib/prefix.c')
-rw-r--r-- | lib/prefix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/prefix.c b/lib/prefix.c index cb6e53b30..199ff3267 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -659,7 +659,7 @@ void apply_mask_ipv4(struct prefix_ipv4 *p) /* If prefix is 0.0.0.0/0 then return 1 else return 0. */ int prefix_ipv4_any(const struct prefix_ipv4 *p) { - return (p->prefix.s_addr == 0 && p->prefixlen == 0); + return (p->prefix.s_addr == INADDR_ANY && p->prefixlen == 0); } /* Allocate a new ip version 6 route */ @@ -1144,7 +1144,7 @@ int netmask_str2prefix_str(const char *net_str, const char *mask_str, } else { destination = ntohl(network.s_addr); - if (network.s_addr == 0) + if (network.s_addr == INADDR_ANY) prefixlen = 0; else if (IN_CLASSC(destination)) prefixlen = 24; |