This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A implementation of the rapid spanning tree protocol for linux.".
The branch, dump has been updated via da8e8eb84d51edb4069fdf3cecd03599ce055ada (commit) via 43a0ac239b23cb5c9ff12a5e39c67a4e72072d8c (commit) via 968d3d40984d0279bce51259ce0e969adc7bda79 (commit) via d19d0e359b26f0935e66b0c19b98c7e66fac9f34 (commit) via 394cd57d336cb2ab1429b2ba2a3c90415ef8d8dc (commit) via b27ab0efa4ecf7a839f750ec1e9b9092c577ebbb (commit) from 04a3cc98732428acb0bb74138f7ce158f4e37958 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit da8e8eb84d51edb4069fdf3cecd03599ce055ada Merge: 04a3cc9 43a0ac2 Author: Michael Tremer michael.tremer@ipfire.org Date: Wed Jul 6 21:09:37 2011 +0200
Merge branch 'master' into dump
-----------------------------------------------------------------------
Summary of changes: bridge-stp | 2 +- bridge_ctl.h | 2 +- bridge_track.c | 49 ++++++++++++++++++++++++++++++++++--------------- brmon.c | 7 +------ libnetlink.c | 3 +-- 5 files changed, 38 insertions(+), 25 deletions(-)
Difference in files: diff --git a/bridge-stp b/bridge-stp index 5e663a9..e699b87 100755 --- a/bridge-stp +++ b/bridge-stp @@ -14,7 +14,7 @@ if [ $# -ne 2 ]; then fi bridge=$1 service=rstpd -pid_file=/var/run/${servicename}.pid +pid_file=/var/run/${service}.pid
# Set $pid to pids from /var/run* for {program}. $pid should be declared # local in the caller. diff --git a/bridge_ctl.h b/bridge_ctl.h index 2838330..b0449ca 100644 --- a/bridge_ctl.h +++ b/bridge_ctl.h @@ -33,7 +33,7 @@ void bridge_get_configuration(void);
int bridge_set_state(int ifindex, int state);
-int bridge_notify(int br_index, int if_index, int newlink, int up); +int bridge_notify(int br_index, int if_index, int newlink, unsigned flags);
void bridge_bpdu_rcv(int ifindex, const unsigned char *data, int len);
diff --git a/bridge_track.c b/bridge_track.c index f5efa3f..10e13f7 100644 --- a/bridge_track.c +++ b/bridge_track.c @@ -249,12 +249,15 @@ static int stp_enabled(struct ifdata *br) return enabled == 2; /* ie user mode STP */ }
-void set_br_up(struct ifdata *br, int up) +static void set_br_up(struct ifdata *br, int up) { int stp_up = stp_enabled(br); - INFO("%s was %s stp was %s", br->name, br->up ? "up" : "down", br->stp_up ? "up" : "down"); + INFO("%s was %s stp was %s", br->name, + up ? "up" : "down", + br->stp_up ? "up" : "down"); INFO("Set bridge %s %s stp %s" , br->name, - up ? "up" : "down", stp_up ? "up" : "down"); + up ? "up" : "down", + stp_up ? "up" : "down");
int changed = 0;
@@ -280,7 +283,7 @@ void set_br_up(struct ifdata *br, int up) (br->up && br->stp_up)?1:0); }
-void set_if_up(struct ifdata *ifc, int up) +static void set_if_up(struct ifdata *ifc, int up) { INFO("Port %s : %s", ifc->name, (up ? "up" : "down")); int speed = -1; @@ -332,14 +335,14 @@ void set_if_up(struct ifdata *ifc, int up)
/*------------------------------------------------------------*/
-int bridge_notify(int br_index, int if_index, int newlink, int up) +int bridge_notify(int br_index, int if_index, int newlink, + unsigned flags) { - if (up) - up = 1; - LOG("br_index %d, if_index %d, newlink %d, up %d", - br_index, if_index, newlink, up); - struct ifdata *br = NULL; + + LOG("br_index %d, if_index %d, up %d running %d", + br_index, if_index, (flags & IFF_UP), flags & IFF_RUNNING); + if (br_index >= 0) { br = find_if(br_index); if (br && !br->is_bridge) { @@ -395,7 +398,10 @@ int bridge_notify(int br_index, int if_index, int newlink, int up) delete_if(ifc); return 0; } - set_if_up(ifc, up); /* And speed and duplex */ + int up = (flags & (IFF_UP|IFF_RUNNING)) == (IFF_UP|IFF_RUNNING); + + if (ifc->up != up) + set_if_up(ifc, up); /* And speed and duplex */ } else { /* No br_index */ if (!newlink) { /* DELLINK not from bridge means interface unregistered. */ @@ -417,11 +423,24 @@ int bridge_notify(int br_index, int if_index, int newlink, int up) } } } + if (ifc && !ifc->is_bridge && + !is_bridge_slave(ifc->master->name, ifc->name)) { + /* Interface might have left bridge and we might have missed deletion */ + delete_if(ifc); + return 0; + } + if (ifc) { - if (ifc->is_bridge) - set_br_up(ifc, up); - else - set_if_up(ifc, up); + if (ifc->is_bridge) { + int up = (flags & IFF_UP) != 0; + if (ifc->up != up) + set_br_up(ifc, up); + } else { + int up = (flags & (IFF_UP|IFF_RUNNING)) == (IFF_UP|IFF_RUNNING); + + if (ifc->up != up) + set_if_up(ifc, up); + } } } } diff --git a/brmon.c b/brmon.c index fd4dacd..4c4e490 100644 --- a/brmon.c +++ b/brmon.c @@ -30,11 +30,6 @@
static const char SNAPSHOT[] = "v0.1";
-static int is_up(const struct ifinfomsg *ifi) -{ - return (ifi->ifi_flags & IFF_UP) && (ifi->ifi_flags & IFF_RUNNING); -} - static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) { @@ -95,7 +90,7 @@ static int dump_msg(const struct sockaddr_nl *who, struct nlmsghdr *n,
bridge_notify(master, ifi->ifi_index, (n->nlmsg_type == RTM_NEWLINK), - is_up(ifi)); + ifi->ifi_flags);
return 0; } diff --git a/libnetlink.c b/libnetlink.c index 7752236..62e47a9 100644 --- a/libnetlink.c +++ b/libnetlink.c @@ -449,7 +449,7 @@ int rtnl_from_file(FILE * rtnl, rtnl_filter_t handler, void *jarg) nladdr.nl_groups = 0;
while (1) { - int err, len, type; + int err, len; int l;
status = fread(&buf, 1, sizeof(*h), rtnl); @@ -464,7 +464,6 @@ int rtnl_from_file(FILE * rtnl, rtnl_filter_t handler, void *jarg) return 0;
len = h->nlmsg_len; - type = h->nlmsg_type; l = len - sizeof(*h);
if (l < 0 || len > sizeof(buf)) {
hooks/post-receive -- A implementation of the rapid spanning tree protocol for linux.