From: Roy Marples Date: Wed, 23 Nov 2011 13:49:44 +0000 (+0000) Subject: Bridge interfaces set IFF_LOWER_UP when they have a valid X-Git-Tag: v5.5.0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d3af9192f3f1e51957d7aab46fb332a8a50a7df;p=thirdparty%2Fdhcpcd.git Bridge interfaces set IFF_LOWER_UP when they have a valid hardware address. To trigger a valid hardware address pickup we need to pretend that that don't exist until they have IFF_LOWER_UP set. --- diff --git a/if-linux.c b/if-linux.c index 4b7ac682..15c36684 100644 --- a/if-linux.c +++ b/if-linux.c @@ -40,6 +40,13 @@ # define IFLA_WIRELESS (IFLA_MASTER + 1) #endif +/* For some reason, glibc doesn't include newer flags from linux/if.h + * However, we cannot include linux/if.h directly as it conflicts + * with the glibc version. D'oh! */ +#ifndef IFF_LOWER_UP +#define IFF_LOWER_UP 0x10000 /* driver signals L1 up */ +#endif + #include #include #include @@ -377,6 +384,15 @@ link_netlink(struct nlmsghdr *nlm) return 1; } + /* Bridge interfaces set IFF_LOWER_UP when they have a valid + * hardware address. To trigger a valid hardware address pickup + * we need to pretend that that don't exist until they have + * IFF_LOWER_UP set. */ + if (ifi->ifi_flags & IFF_MASTER && !(ifi->ifi_flags & IFF_LOWER_UP)) { + handle_interface(-1, ifn); + return 1; + } + handle_carrier(ifi->ifi_flags & IFF_RUNNING ? 1 : -1, ifi->ifi_flags, ifn); return 1;