diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-12-14 21:01:31 +0200 |
|---|---|---|
| committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-12-14 21:03:38 +0200 |
| commit | 3a6290bdd1003f53ad73aaaa2f6bc4b08e262352 (patch) | |
| tree | 140586732e3a6a1b6d24ce775cebfb6d77b165d0 /ripd/ripd.c | |
| parent | c2dba6e5b80e63149e5c65609d32cd22d883b23c (diff) | |
*: Replace s_addr check agains 0 with INADDR_ANY
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'ripd/ripd.c')
| -rw-r--r-- | ripd/ripd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c index 0cec847f05..82dd401f96 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -495,7 +495,7 @@ static void rip_rte_process(struct rte *rte, struct sockaddr_in *from, rte->metric = RIP_METRIC_INFINITY; /* Set nexthop pointer. */ - if (rte->nexthop.s_addr == 0) + if (rte->nexthop.s_addr == INADDR_ANY) nexthop = &from->sin_addr; else nexthop = &rte->nexthop; @@ -592,7 +592,7 @@ static void rip_rte_process(struct rte *rte, struct sockaddr_in *from, /* Only routes directly connected to an interface * (nexthop == 0) * may have a valid NULL distance */ - if (rinfo->nh.gate.ipv4.s_addr != 0) + if (rinfo->nh.gate.ipv4.s_addr != INADDR_ANY) old_dist = old_dist ? old_dist : ZEBRA_RIP_DISTANCE_DEFAULT; @@ -2156,7 +2156,7 @@ void rip_output_process(struct connected *ifc, struct sockaddr_in *to, memcpy(&classfull, &rp->p, sizeof(struct prefix_ipv4)); apply_classful_mask_ipv4(&classfull); - if (rp->p.u.prefix4.s_addr != 0 + if (rp->p.u.prefix4.s_addr != INADDR_ANY && classfull.prefixlen != rp->p.prefixlen) continue; |
