summaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-09-19 14:36:46 -0400
committerFlorin Coras <florin.coras@gmail.com>2017-09-19 20:23:52 +0000
commitf22f07dec90b7250f908d0085c1cf328f7d27138 (patch)
tree79b676fca1b7ea907520741503271fa47ff7bc88 /src/vppinfra
parentdc15be2ca7c51772b00e4c5548934a35aa7e4add (diff)
format_sockaddr: add trivial support for AF_LOCAL sockets
There isn't anything useful to print. Return a unique name since the unix cli uses the returned string to create a node name. Node names must be unique, or vpp will quit abruptly. Change-Id: I8f85ae8fececdbfd26c729bc32c2c2007c06d1ea Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/unix-formats.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vppinfra/unix-formats.c b/src/vppinfra/unix-formats.c
index 91986516108..b09433c9370 100644
--- a/src/vppinfra/unix-formats.c
+++ b/src/vppinfra/unix-formats.c
@@ -231,6 +231,7 @@ u8 * format_sockaddr (u8 * s, va_list * args)
{
void * v = va_arg (*args, void *);
struct sockaddr * sa = v;
+ static u32 local_counter;
switch (sa->sa_family)
{
@@ -243,6 +244,17 @@ u8 * format_sockaddr (u8 * s, va_list * args)
}
break;
+ case AF_LOCAL:
+ {
+ /*
+ * There isn't anything useful to print.
+ * The unix cli world uses the output to make a node name,
+ * so we need to return a unique name.
+ */
+ s = format (s, "local:%u", local_counter++);
+ }
+ break;
+
#ifndef __KERNEL__
#ifdef AF_NETLINK
case AF_NETLINK: