summaryrefslogtreecommitdiff
path: root/lib
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 /lib
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 'lib')
-rw-r--r--lib/sockunion.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sockunion.c b/lib/sockunion.c
index 4c2837b1..37dc3f90 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -370,7 +370,7 @@ sockunion_bind (int sock, union sockunion *su, unsigned short port,
su->sin.sin_len = size;
#endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
if (su_addr == NULL)
- su->sin.sin_addr.s_addr = htonl (INADDR_ANY);
+ sockunion2ip (su) = htonl (INADDR_ANY);
}
#ifdef HAVE_IPV6
else if (su->sa.sa_family == AF_INET6)
@@ -727,9 +727,9 @@ sockunion_cmp (union sockunion *su1, union sockunion *su2)
if (su1->sa.sa_family == AF_INET)
{
- if (ntohl (su1->sin.sin_addr.s_addr) == ntohl (su2->sin.sin_addr.s_addr))
+ if (ntohl (sockunion2ip (su1)) == ntohl (sockunion2ip (su2)))
return 0;
- if (ntohl (su1->sin.sin_addr.s_addr) > ntohl (su2->sin.sin_addr.s_addr))
+ if (ntohl (sockunion2ip (su1)) > ntohl (sockunion2ip (su2)))
return 1;
else
return -1;