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, master has been updated
via 43a0ac239b23cb5c9ff12a5e39c67a4e72072d8c (commit)
via 968d3d40984d0279bce51259ce0e969adc7bda79 (commit)
via d19d0e359b26f0935e66b0c19b98c7e66fac9f34 (commit)
via 394cd57d336cb2ab1429b2ba2a3c90415ef8d8dc (commit)
via b27ab0efa4ecf7a839f750ec1e9b9092c577ebbb (commit)
from 8551b0db50a02ca829be03ed6d1e86d09b9828b8 (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 43a0ac239b23cb5c9ff12a5e39c67a4e72072d8c
Merge: 8551b0d 968d3d4
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date: Wed Jul 6 21:08:28 2011 +0200
Merge remote-tracking branch 'upstream/master'
Conflicts:
bridge_track.c
commit 968d3d40984d0279bce51259ce0e969adc7bda79
Author: Stephen Hemminger <shemminger(a)vyatta.com>
Date: Mon Jul 4 14:37:25 2011 -0700
Ignore carrier state on bridge device
The carrier of bridge device reflects underlying devices in later
kernels. Therefor RSTP daemon should ignore carrier (IFF_RUNNING)
and only look at IFF_UP on bridge device.
commit d19d0e359b26f0935e66b0c19b98c7e66fac9f34
Author: Stephen Hemminger <shemminger(a)vyatta.com>
Date: Mon Jul 4 14:14:36 2011 -0700
Make local functions static
commit 394cd57d336cb2ab1429b2ba2a3c90415ef8d8dc
Author: Stephen Hemminger <shemminger(a)vyatta.com>
Date: Mon Jul 4 14:13:53 2011 -0700
Remove variable set and never used
commit b27ab0efa4ecf7a839f750ec1e9b9092c577ebbb
Author: Alexander Stein <alexander.stein(a)systec-electronic.com>
Date: Tue Jun 28 17:19:15 2011 +0200
bridge-stp: Fix variable name used to generate pid_file
Signed-off-by: Alexander Stein <alexander.stein(a)systec-electronic.com>
-----------------------------------------------------------------------
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.