summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
authorJorge Boncompte [DTI2] <jorge@dti2.net>2012-04-10 16:57:25 +0200
committerDavid Lamparter <equinox@diac24.net>2012-05-02 17:03:28 +0200
commit128293286a8be01b99ed60db53e19ce6e2669558 (patch)
tree59bf4be72bc1905a404c572d0446390f1587c67b /zebra
parentc63b83fe8d1addecc949258479b8d54180c4da60 (diff)
lib, zebra: extend use of sockunion2ip macro
* lib/sockunion.c, * zebra/zebra_rib.c: replace ->sin.sin_addr.s_addr with sockunion2ip Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net> [reworded commit message] Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_rib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 154e8d55..50674ee8 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -678,8 +678,8 @@ rib_lookup_ipv4_route (struct prefix_ipv4 *p, union sockunion * qgate)
if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
{
/* We are happy with either direct or recursive hexthop */
- if (nexthop->gate.ipv4.s_addr == qgate->sin.sin_addr.s_addr ||
- nexthop->rgate.ipv4.s_addr == qgate->sin.sin_addr.s_addr)
+ if (nexthop->gate.ipv4.s_addr == sockunion2ip (qgate) ||
+ nexthop->rgate.ipv4.s_addr == sockunion2ip (qgate))
return ZEBRA_RIB_FOUND_EXACT;
else
{
@@ -688,7 +688,7 @@ rib_lookup_ipv4_route (struct prefix_ipv4 *p, union sockunion * qgate)
char gate_buf[INET_ADDRSTRLEN], rgate_buf[INET_ADDRSTRLEN], qgate_buf[INET_ADDRSTRLEN];
inet_ntop (AF_INET, &nexthop->gate.ipv4.s_addr, gate_buf, INET_ADDRSTRLEN);
inet_ntop (AF_INET, &nexthop->rgate.ipv4.s_addr, rgate_buf, INET_ADDRSTRLEN);
- inet_ntop (AF_INET, &qgate->sin.sin_addr.s_addr, qgate_buf, INET_ADDRSTRLEN);
+ inet_ntop (AF_INET, &sockunion2ip (qgate), qgate_buf, INET_ADDRSTRLEN);
zlog_debug ("%s: qgate == %s, gate == %s, rgate == %s", __func__, qgate_buf, gate_buf, rgate_buf);
}
return ZEBRA_RIB_FOUND_NOGATE;