summaryrefslogtreecommitdiff
path: root/lib/sockunion.c
diff options
context:
space:
mode:
authorPaul Jakma <paul@quagga.net>2012-06-14 10:37:40 +0100
committerPaul Jakma <paul@quagga.net>2012-06-14 10:37:40 +0100
commit2fb2a455263c569119ca32be59b0337a3d8cd9b3 (patch)
tree79f895f78cd4adb43dde3ba3996e8a04a8deac42 /lib/sockunion.c
parentad12dde6f9596997337ebc210dd2d4593438556b (diff)
lib: Add back sockunion_str2su
* sockunion.h: Add back sockunion_str2su, its removal breaks things needlessly (e.g. our own unit tests). * sockunion.c: (sockunion_str2su) implement on top of str2sockunion.
Diffstat (limited to 'lib/sockunion.c')
-rw-r--r--lib/sockunion.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/sockunion.c b/lib/sockunion.c
index 37dc3f90..5dcf7256 100644
--- a/lib/sockunion.c
+++ b/lib/sockunion.c
@@ -174,6 +174,18 @@ sockunion2str (union sockunion *su, char *buf, size_t len)
return NULL;
}
+union sockunion *
+sockunion_str2su (const char *str)
+{
+ union sockunion *su = XCALLOC (MTYPE_SOCKUNION, sizeof (union sockunion));
+
+ if (!str2sockunion (str, su))
+ return su;
+
+ XFREE (MTYPE_SOCKUNION, su);
+ return NULL;
+}
+
/* Convert IPv4 compatible IPv6 address to IPv4 address. */
static void
sockunion_normalise_mapped (union sockunion *su)