]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
interfaces: don't listen to enslaved interface until master interface has been configured
authorVincent Bernat <bernat@luffy.cx>
Wed, 26 Sep 2012 19:08:08 +0000 (21:08 +0200)
committerVincent Bernat <bernat@luffy.cx>
Wed, 26 Sep 2012 19:08:08 +0000 (21:08 +0200)
In case of errors, we were leaking events.

src/daemon/interfaces.c

index d17c8cd8e573b1aa1899202375fb341f48a1db33..7441080ab5c0da83d463a54ab562aa23ec456a84 100644 (file)
@@ -780,7 +780,6 @@ iface_bond_init(struct lldpd *cfg, struct lldpd_hardware *hardware)
        if ((fd = priv_iface_init(hardware->h_ifname)) == -1)
                return -1;
        hardware->h_sendfd = fd;
-       levent_hardware_add_fd(hardware, fd);
        if ((status = iface_set_filter(hardware->h_ifname, fd)) != 0) {
                close(fd);
                return status;
@@ -809,6 +808,7 @@ iface_bond_init(struct lldpd *cfg, struct lldpd_hardware *hardware)
        }
        iface_multicast(cfg, mastername, 0);
 
+       levent_hardware_add_fd(hardware, hardware->h_sendfd);
        levent_hardware_add_fd(hardware, fd);
        LLOG_DEBUG("interface %s initialized (fd=%d,master=%s[%d])",
            hardware->h_ifname,