diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/if.h | 4 | ||||
-rw-r--r-- | lib/smux.c | 4 | ||||
-rw-r--r-- | lib/sockunion.c | 16 | ||||
-rw-r--r-- | lib/vty.c | 4 | ||||
-rw-r--r-- | lib/zclient.c | 12 | ||||
-rw-r--r-- | lib/zebra.h | 2 |
6 files changed, 21 insertions, 21 deletions
@@ -102,13 +102,13 @@ struct interface unsigned int mtu6; /* IPv6 MTU - probably, but not neccessarily same as mtu */ /* Hardware address. */ -#ifdef HAVE_SOCKADDR_DL +#ifdef HAVE_STRUCT_SOCKADDR_DL struct sockaddr_dl sdl; #else unsigned short hw_type; u_char hw_addr[INTERFACE_HWADDR_MAX]; int hw_addr_len; -#endif /* HAVE_SOCKADDR_DL */ +#endif /* HAVE_STRUCT_SOCKADDR_DL */ /* interface bandwidth, kbits */ unsigned int bandwidth; @@ -237,9 +237,9 @@ smux_socket () memset (&serv, 0, sizeof (struct sockaddr_in)); serv.sin_family = AF_INET; -#ifdef HAVE_SIN_LEN +#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN serv.sin_len = sizeof (struct sockaddr_in); -#endif /* HAVE_SIN_LEN */ +#endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ sp = getservbyname ("smux", "tcp"); if (sp != NULL) 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); } @@ -1924,11 +1924,11 @@ vty_serv_un (const char *path) memset (&serv, 0, sizeof (struct sockaddr_un)); serv.sun_family = AF_UNIX; strncpy (serv.sun_path, path, strlen (path)); -#ifdef HAVE_SUN_LEN +#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN len = serv.sun_len = SUN_LEN(&serv); #else len = sizeof (serv.sun_family) + strlen (serv.sun_path); -#endif /* HAVE_SUN_LEN */ +#endif /* HAVE_STRUCT_SOCKADDR_UN_SUN_LEN */ ret = bind (sock, (struct sockaddr *) &serv, len); if (ret < 0) diff --git a/lib/zclient.c b/lib/zclient.c index 09a7d25e..10e6b5fd 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -164,9 +164,9 @@ zclient_socket(void) memset (&serv, 0, sizeof (struct sockaddr_in)); serv.sin_family = AF_INET; serv.sin_port = htons (ZEBRA_PORT); -#ifdef HAVE_SIN_LEN +#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN serv.sin_len = sizeof (struct sockaddr_in); -#endif /* HAVE_SIN_LEN */ +#endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ serv.sin_addr.s_addr = htonl (INADDR_LOOPBACK); /* Connect to zebra. */ @@ -197,11 +197,11 @@ zclient_socket_un (const char *path) memset (&addr, 0, sizeof (struct sockaddr_un)); addr.sun_family = AF_UNIX; strncpy (addr.sun_path, path, strlen (path)); -#ifdef HAVE_SUN_LEN +#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN len = addr.sun_len = SUN_LEN(&addr); #else len = sizeof (addr.sun_family) + strlen (addr.sun_path); -#endif /* HAVE_SUN_LEN */ +#endif /* HAVE_STRUCT_SOCKADDR_UN_SUN_LEN */ ret = connect (sock, (struct sockaddr *) &addr, len); if (ret < 0) @@ -625,13 +625,13 @@ zebra_interface_add_read (struct stream *s) ifp->mtu = stream_getl (s); ifp->mtu6 = stream_getl (s); ifp->bandwidth = stream_getl (s); -#ifdef HAVE_SOCKADDR_DL +#ifdef HAVE_STRUCT_SOCKADDR_DL stream_get (&ifp->sdl, s, sizeof (ifp->sdl)); #else ifp->hw_addr_len = stream_getl (s); if (ifp->hw_addr_len) stream_get (ifp->hw_addr, s, ifp->hw_addr_len); -#endif /* HAVE_SOCKADDR_DL */ +#endif /* HAVE_STRUCT_SOCKADDR_DL */ return ifp; } diff --git a/lib/zebra.h b/lib/zebra.h index 85537399..3c01aec3 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -312,7 +312,7 @@ typedef int socklen_t; /* The definition of struct in_pktinfo is missing in old version of GLIBC 2.1 (Redhat 6.1). */ -#if defined (GNU_LINUX) && ! defined (HAVE_INPKTINFO) +#if defined (GNU_LINUX) && ! defined (HAVE_STRUCT_IN_PKTINFO) struct in_pktinfo { int ipi_ifindex; |