From aa0294cd1a48ea34180be4d7235b4b13f9c6418b Mon Sep 17 00:00:00 2001 From: John Fastabend Date: Wed, 6 Apr 2011 08:48:31 -0700 Subject: [PATCH 47/51] lldpad: initialize ports after netlink interface is created Initialize netlink interface before ports are initialized. This resolves an issue where an interface comes up after init_ports() runs but before the netlinnk interface is up. In this case we were missing a netlink ifup event. This can be seen on boot occasionally. Reported-by: Ross Brattain Signed-off-by: John Fastabend Signed-off-by: Petr Sabata --- lldpad.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lldpad.c b/lldpad.c index 8a5df5b..3a4a721 100644 --- a/lldpad.c +++ b/lldpad.c @@ -393,15 +393,15 @@ int main(int argc, char *argv[]) exit(1); } - /* Find available interfaces and add adapters */ - init_ports(); - /* setup event RT netlink interface */ if (event_iface_init() < 0) { LLDPAD_ERR("failed to register event interface\n"); exit(1); } + /* Find available interfaces and add adapters */ + init_ports(); + if (ctrl_iface_register(clifd) < 0) { if (!daemonize) fprintf(stderr, "failed to register control interface\n"); -- 1.7.4.4