summaryrefslogtreecommitdiffstats
path: root/lib/sockunion.c
diff options
context:
space:
mode:
authorChris Hall <GMCH@hestia.halldom.com>2010-04-11 11:17:37 +0100
committerChris Hall <GMCH@hestia.halldom.com>2010-04-11 11:17:37 +0100
commitb878aa88eb8bb7ab74e24314e87c88586f15598d (patch)
treeb51690eff9070c419dbe99602b9a974d82f8aaed /lib/sockunion.c
parent83447a051fbcc88b33fcea6670520687668d3ba1 (diff)
downloadquagga-b878aa88eb8bb7ab74e24314e87c88586f15598d.tar.bz2
quagga-b878aa88eb8bb7ab74e24314e87c88586f15598d.tar.xz
Support gai_strerror() and tidy bgp_listener code.
Added support for EAI_XXX error names and gai_strerror() error messages. Tidied up bgp_listener set up to remove #if skips around the "old" way -- so that the older code doesn't simply rot away.
Diffstat (limited to 'lib/sockunion.c')
-rw-r--r--lib/sockunion.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/sockunion.c b/lib/sockunion.c
index 23287cd2..9a063190 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -209,7 +209,7 @@ sockunion_set_addr_any(sockunion su)
*
* For good measure, set the size (if that's required) and return same.
*/
-static int
+extern int
sockunion_set_port(sockunion su, in_port_t port)
{
switch (su->sa.sa_family)
@@ -234,6 +234,8 @@ sockunion_set_port(sockunion su, in_port_t port)
*
* Allocates a sockunion if required.
*
+ * Result is set "any".
+ *
* Advice is to zeroize sockaddr_in6, in particular.
*/
extern sockunion
@@ -455,7 +457,7 @@ sockunion_socket(sa_family_t family, int type, int protocol)
err = errno ;
zlog (NULL, LOG_WARNING,
- "Can't make socket family=%d, type=%d, protocol=%d: %s",
+ "Cannot make socket family=%d, type=%d, protocol=%d: %s",
(int)family, type, protocol, errtoa(err, 0).str) ;
errno = err ;
return -1;
@@ -908,6 +910,15 @@ sockunion_dup (union sockunion *su)
}
/*------------------------------------------------------------------------------
+ * Copy one sockunion to another
+ */
+extern void
+sockunion_copy (sockunion dst, sockunion src)
+{
+ memcpy (dst, src, sizeof(*dst)) ;
+} ;
+
+/*------------------------------------------------------------------------------
* Free given sockunion (if any).
*/
void