Displaying 5 results from an estimated 5 matches for "root_path_cost".
2007 Apr 18
0
[Bridge] STP Explanation
...;
}bpdu_flag;
typedef struct
{
unsigned char protocol[2]= {0x00,0x00}; // le type unsigned char peut ?tre assimil? ? un octet
unsigned char version = 0x02; //convention
unsigned char bpdu_type;
} bpdu_header;
typedef struct
{
bpdu_flag flags;
unsigned char root_id[8];
unsigned char root_path_cost[4];
unsigned char bridge_id[8];
unsigned char port_id[2];
unsigned char message_age[2];
unsigned char max_age[2];
unsigned char hello_time[2];
unsigned char forward_delay[2];
} bpdu_body;
typedef struct
{
bpdu_header hdr;
bpdu_body body;
unsigned char ver_1_len[2];// ?
}bpdu;
-...
2007 Apr 18
1
[Bridge] STP Explanation (2)
...du->bpdu_body.root_id.addr[0];
buf[15] = bpdu->bpdu_body.root_id.addr[1];
buf[16] = bpdu->bpdu_body.root_id.addr[2];
buf[17] = bpdu->bpdu_body.root_id.addr[3];
buf[18] = bpdu->bpdu_body.root_id.addr[4];
buf[19] = bpdu->bpdu_body.root_id.addr[5];
buf[20] = (bpdu->bpdu_body.root_path_cost >> 24) & 0xFF;
buf[21] = (bpdu->bpdu_body.root_path_cost >> 16) & 0xFF;
buf[22] = (bpdu->bpdu_body.root_path_cost >> 8) & 0xFF;
buf[23] = bpdu->bpdu_body.root_path_cost & 0xFF;
buf[24] = bpdu->bpdu_body.bridge_id.prio[0];
buf[25] = bpdu->bpdu_bo...
2007 Apr 18
4
[Bridge] [Patch] [2.6.7] Bridge - Fix BPDU message_age
Fixes message_age field update in config BPDUs. Also checks whether the BPDU
message age has exceeded bridge max age before transmitting config BPDUs.
Signed-off-by: Kishore A K <KishoreAK@myw.ltindia.com>
Index: linux-2.6.7/net/bridge/br_stp.c
=============================================================
--- linux-2.6.7/net/bridge/br_stp.c.orig 2004-06-17 20:17:27.000000000 +0530
+++
2007 Apr 18
0
[Bridge] [PATCH 2.6] Fix message age in bridge STP config packets
...caled (1/256)
+ * before sending, make sure that is at least one.
+ */
+#define MESSAGE_AGE_INCR ((HZ < 256) ? 1 : (HZ/256))
+
static const char *br_port_state_names[] = {
[BR_STATE_DISABLED] = "disabled",
[BR_STATE_LISTENING] = "listening",
@@ -157,24 +162,25 @@
bpdu.root_path_cost = br->root_path_cost;
bpdu.bridge_id = br->bridge_id;
bpdu.port_id = p->port_id;
- bpdu.message_age = 0;
- if (!br_is_root_bridge(br)) {
+ if (br_is_root_bridge(br))
+ bpdu.message_age = 0;
+ else {
struct net_bridge_port *root
= br_get_port(br, br->root_port);
- bpdu.max_a...
2007 Apr 18
1
[Bridge] [PATCH 2.4] Bridge STP message age
...nce time values in bpdu are in jiffies and then scaled (1/256)
+ * before sending, make sure that is at least one.
+ */
+#define MESSAGE_AGE_INCR ((HZ < 256) ? 1 : (HZ/256))
/* called under ioctl_lock or bridge lock */
int br_is_root_bridge(struct net_bridge *br)
@@ -160,24 +163,26 @@
bpdu.root_path_cost = br->root_path_cost;
bpdu.bridge_id = br->bridge_id;
bpdu.port_id = p->port_id;
- bpdu.message_age = 0;
- if (!br_is_root_bridge(br)) {
+ if (br_is_root_bridge(br))
+ bpdu.message_age = 0;
+ else {
struct net_bridge_port *root;
- unsigned long age;
root = br_get_port(br, br...