open-lldp/0001-lldpad-print-verbose-error-messages.patch
Tomáš Chvátal 1a4148b4d0 Accepting request 233838 from home:hreinecke:branches:network:fcoe
- Update to latest git version:
  * Include upstream version of VEPA migration issue (bnc#866282)
  * evb 22 test cases
  * vdp22 fixes
  * error message fixes
  * Fix interop issues with Juniper switches
- Fixup error messages in lldpad
  * Add 0001-lldpad-print-verbose-error-messages.patch
- Move to libnl3
  * Add 0002-Move-to-libnl3.patch

OBS-URL: https://build.opensuse.org/request/show/233838
OBS-URL: https://build.opensuse.org/package/show/network:fcoe/open-lldp?expand=0&rev=14
2014-05-19 21:35:06 +00:00

45 lines
1.4 KiB
Diff

From 76abae2f76ae02cd0af19bd7ff4d52e2f9c46bf4 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 14 May 2014 09:03:43 +0200
Subject: lldpad: print verbose error messages
When lldpad is started while another instance is running it'll
abort with the cryptic error message
'bind(AF_LOCAL): address in use'
This patch updates the error message with the more instructive
'another lldpad instance is running'.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
ctrl_iface.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/ctrl_iface.c b/ctrl_iface.c
index fbacfac..e4fd0b7 100644
--- a/ctrl_iface.c
+++ b/ctrl_iface.c
@@ -466,7 +466,7 @@ int ctrl_iface_init(struct clif_data *clifd)
}
s = socket(AF_LOCAL, SOCK_DGRAM, 0);
if (s < 0) {
- perror("socket(AF_LOCAL)");
+ LLDPAD_WARN("failed to create CLI socket: %m\n");
goto fail;
}
/* enable receiving of the sender credentials */
@@ -479,7 +479,10 @@ int ctrl_iface_init(struct clif_data *clifd)
"%s", LLDP_CLIF_SOCK);
addrlen = sizeof(sa_family_t) + strlen(addr.sun_path + 1) + 1;
if (bind(s, (struct sockaddr *) &addr, addrlen) < 0) {
- perror("bind(AF_LOCAL)");
+ if (errno == EADDRINUSE)
+ LLDPAD_WARN("another lldpad instance is running\n");
+ else
+ LLDPAD_WARN("failed to bind CLI socket address: %m");
goto fail;
}
/* enable receiving of the sender credentials */
--
1.8.5.2