summaryrefslogtreecommitdiff
path: root/lib/sockunion.c
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@sun.com>2007-05-10 02:38:51 +0000
committerPaul Jakma <paul.jakma@sun.com>2007-05-10 02:38:51 +0000
commit6f0e3f6e17687eb25b7b77c4fdc8324837d4700f (patch)
tree8a94d9212060f0f2ee7cbd0079c2687eed7348dc /lib/sockunion.c
parent08d3d5b398ae81de7659509f159e814d1bbd4375 (diff)
[autoconf] bugs 162,303,178: Fix 'present but can not be compiled' warnings
2007-05-09 Paul Jakma <paul.jakma@sun.com> * configure.ac: sys/conf.h depends on sys/param.h, at least on FBSD 6.2. (bug #363) Should check for in_pktinfo for IRDP 2006-05-27 Paul Jakma <paul.jakma@sun.com> * configure.ac: General cleanup of header and type checks, introducing an internal define, QUAGGA_INCLUDES, to build up a list of stuff to include so as to avoid 'present but cant be compiled' warnings. Misc additional checks of things missing according to autoscan. Add LIBM, for bgpd's use of libm, so as to avoid burdening LIBS, and all the binaries, with libm linkage. Remove the bad practice of using m4 changequote(), just quote the []'s in the case statements properly. This should fix bugs 162, 303 and 178. * */*.{c,h}: Update all HAVE_* to the standard autoconf namespaced HAVE_* defines. I.e. HAVE_SA_LEN -> HAVE_STRUCT_SOCKADDR_SA_LEN, * bgpd/Makefile.am: Add LIBM to bgpd's LDADD, for pow().
Diffstat (limited to 'lib/sockunion.c')
-rw-r--r--lib/sockunion.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/sockunion.c b/lib/sockunion.c
index 109f3bdd..7721666e 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -143,9 +143,9 @@ str2sockunion (const char *str, union sockunion *su)
if (ret > 0) /* Valid IPv4 address format. */
{
su->sin.sin_family = AF_INET;
-#ifdef HAVE_SIN_LEN
+#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
su->sin.sin_len = sizeof(struct sockaddr_in);
-#endif /* HAVE_SIN_LEN */
+#endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
return 0;
}
#ifdef HAVE_IPV6
@@ -187,9 +187,9 @@ sockunion_str2su (const char *str)
if (ret > 0) /* Valid IPv4 address format. */
{
su->sin.sin_family = AF_INET;
-#ifdef HAVE_SIN_LEN
+#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
su->sin.sin_len = sizeof(struct sockaddr_in);
-#endif /* HAVE_SIN_LEN */
+#endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
return su;
}
#ifdef HAVE_IPV6
@@ -342,12 +342,12 @@ sockunion_connect (int fd, union sockunion *peersu, unsigned short port,
#ifdef KAME
if (IN6_IS_ADDR_LINKLOCAL(&su.sin6.sin6_addr) && ifindex)
{
-#ifdef HAVE_SIN6_SCOPE_ID
+#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID
/* su.sin6.sin6_scope_id = ifindex; */
#ifdef MUSICA
su.sin6.sin6_scope_id = ifindex;
#endif
-#endif /* HAVE_SIN6_SCOPE_ID */
+#endif /* HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID */
#ifndef MUSICA
SET_IN6_LINKLOCAL_IFINDEX (su.sin6.sin6_addr, ifindex);
#endif
@@ -416,9 +416,9 @@ sockunion_bind (int sock, union sockunion *su, unsigned short port,
{
size = sizeof (struct sockaddr_in);
su->sin.sin_port = htons (port);
-#ifdef HAVE_SIN_LEN
+#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
su->sin.sin_len = size;
-#endif /* HAVE_SIN_LEN */
+#endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
if (su_addr == NULL)
su->sin.sin_addr.s_addr = htonl (INADDR_ANY);
}