From 0da01fd667f0e09a2871758e359fed79410d3566 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 13 Mar 2016 14:37:36 +0100 Subject: [PATCH] interfaces: replace "bonded" by "enslaved" It is more in par with the appropriate terminology for bonds in Linux. --- README.md | 2 +- src/daemon/interfaces-linux.c | 10 +++++----- src/daemon/lldpd.c | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 81ce7c63..ddd30647 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ interfaces of the bond. In this case, lldpd will affect a received randomly to one of the interface (so a neighbor may be affected to the wrong interface). -On 2.6.27, we are able to receive packets on real interface for bonded +On 2.6.27, we are able to receive packets on real interface for enslaved devices. This allows one to get neighbor information on active/backup bonds. Without the 2.6.27, lldpd won't receive any information on inactive slaves. Here are the patchs (thanks to Joe Eykholt): diff --git a/src/daemon/interfaces-linux.c b/src/daemon/interfaces-linux.c index 6ceddaa3..be4668f7 100644 --- a/src/daemon/interfaces-linux.c +++ b/src/daemon/interfaces-linux.c @@ -438,7 +438,7 @@ iface_bond_init(struct lldpd *cfg, struct lldpd_hardware *hardware) if (!master) return -1; - log_debug("interfaces", "initialize bonded device %s", + log_debug("interfaces", "initialize enslaved device %s", hardware->h_ifname); /* First, we get a socket to the raw physical interface */ @@ -449,7 +449,7 @@ iface_bond_init(struct lldpd *cfg, struct lldpd_hardware *hardware) interfaces_setup_multicast(cfg, hardware->h_ifname, 0); /* Then, we open a raw interface for the master */ - log_debug("interfaces", "bonded device %s has master %s(%d)", + log_debug("interfaces", "enslaved device %s has master %s(%d)", hardware->h_ifname, master->name, master->index); if ((fd = priv_iface_init(master->index, master->name)) == -1) { close(hardware->h_sendfd); @@ -485,7 +485,7 @@ iface_bond_recv(struct lldpd *cfg, struct lldpd_hardware *hardware, socklen_t fromlen; struct bond_master *master = hardware->h_data; - log_debug("interfaces", "receive PDU from bonded device %s", + log_debug("interfaces", "receive PDU from enslaved device %s", hardware->h_ifname); fromlen = sizeof(from); if ((n = recvfrom(fd, buffer, size, 0, @@ -516,7 +516,7 @@ static int iface_bond_close(struct lldpd *cfg, struct lldpd_hardware *hardware) { struct bond_master *master = hardware->h_data; - log_debug("interfaces", "closing bonded device %s", + log_debug("interfaces", "closing enslaved device %s", hardware->h_ifname); interfaces_setup_multicast(cfg, hardware->h_ifname, 1); interfaces_setup_multicast(cfg, master->name, 1); @@ -543,7 +543,7 @@ iflinux_handle_bond(struct lldpd *cfg, struct interfaces_device_list *interfaces if (!iface->upper || !(iface->upper->type & IFACE_BOND_T)) continue; master = iface->upper; - log_debug("interfaces", "%s is an acceptable bonded device (master=%s)", + log_debug("interfaces", "%s is an acceptable enslaved device (master=%s)", iface->name, master->name); if ((hardware = lldpd_get_hardware(cfg, iface->name, diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c index 3b35534b..1f90867f 100644 --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -425,9 +425,10 @@ lldpd_cleanup(struct lldpd *cfg) TAILQ_REMOVE(&cfg->g_hardware, hardware, h_entries); lldpd_remote_cleanup(hardware, notify_clients_deletion, 1); lldpd_hardware_cleanup(cfg, hardware); - } else + } else { lldpd_remote_cleanup(hardware, notify_clients_deletion, !(hardware->h_flags & IFF_RUNNING)); + } } levent_schedule_cleanup(cfg); -- 2.39.5