Displaying 8 results from an estimated 8 matches for "br_set".
Did you mean:
bf_set
2009 Jun 15
0
[Bridge] [PATCH][RFC] bridge-utils: add basic VEPA support
...,85 @@ static int br_cmd_showstp(int argc, char *const* argv)
return 0;
}
+static int br_cmd_vepa(int argc, char *const* argv)
+{
+ int vepa, err;
+
+ err = br_parse_param(argv[2], &vepa);
+ if (err) {
+ fprintf(stderr, "expect on/off for argument\n");
+ return 1;
+ }
+
+ err = br_set_vepa_mode(argv[1], vepa);
+ if (err)
+ fprintf(stderr, "set vepa mode failed: %s\n",
+ strerror(errno));
+ return err != 0;
+}
+
+static int br_cmd_vepauplink(int argc, char *const* argv)
+{
+ const char *brname = *++argv;
+ const char *ifname = *++argv;
+ int err;
+
+ if (if_nametoind...
2009 Jun 15
0
[Bridge] [PATCH][RFC] bridge-utils: add basic VEPA support
...,85 @@ static int br_cmd_showstp(int argc, char *const* argv)
return 0;
}
+static int br_cmd_vepa(int argc, char *const* argv)
+{
+ int vepa, err;
+
+ err = br_parse_param(argv[2], &vepa);
+ if (err) {
+ fprintf(stderr, "expect on/off for argument\n");
+ return 1;
+ }
+
+ err = br_set_vepa_mode(argv[1], vepa);
+ if (err)
+ fprintf(stderr, "set vepa mode failed: %s\n",
+ strerror(errno));
+ return err != 0;
+}
+
+static int br_cmd_vepauplink(int argc, char *const* argv)
+{
+ const char *brname = *++argv;
+ const char *ifname = *++argv;
+ int err;
+
+ if (if_nametoind...
2009 Jun 15
0
[Bridge] [PATCH][RFC] bridge-utils: add basic VEPA support
...,85 @@ static int br_cmd_showstp(int argc, char *const* argv)
return 0;
}
+static int br_cmd_vepa(int argc, char *const* argv)
+{
+ int vepa, err;
+
+ err = br_parse_param(argv[2], &vepa);
+ if (err) {
+ fprintf(stderr, "expect on/off for argument\n");
+ return 1;
+ }
+
+ err = br_set_vepa_mode(argv[1], vepa);
+ if (err)
+ fprintf(stderr, "set vepa mode failed: %s\n",
+ strerror(errno));
+ return err != 0;
+}
+
+static int br_cmd_vepauplink(int argc, char *const* argv)
+{
+ const char *brname = *++argv;
+ const char *ifname = *++argv;
+ int err;
+
+ if (if_nametoind...
2007 Jul 31
1
[Bridge] brctl uses incorrect sysfs path
...s; however the ioctl method is apparently deprecated. I
believe the following patch fixes this:
diff --git a/libbridge/libbridge_devif.c b/libbridge/libbridge_devif.c
index 1decc28..65ea79a 100644
--- a/libbridge/libbridge_devif.c
+++ b/libbridge/libbridge_devif.c
@@ -282,7 +282,7 @@ static int br_set(const char *bridge, const char *name,
char path[SYSFS_PATH_MAX];
FILE *f;
- snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/%s", bridge, name);
+ snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/bridge/%s", bridge, name);
f = fope...
2007 Apr 18
0
[Bridge] setting STP values via brctl
..., so I executed the following:
# brctl sethello br0 30
Then I had a look at the value that was set:
# cat /sys/class/net/br0/bridge/hello_time
2999
Much bigger than expected.
I started looking at the source. In the libbridge/libbridge_devif.c
file of brctl, we have the following routine:
int br_set_bridge_hello_time(const char *br, struct timeval *tv)
{
return br_set(br, "hello_time", __tv_to_jiffies(tv),
BRCTL_SET_BRIDGE_HELLO_TIME);
}
Note the tv_to_jiffies() call.
Then, I looked in the kernel file linux/net/bridge/br_sysfs_br.c at
the following fun...
2009 Jun 15
0
[Bridge] [PATCH] bridge-utils: fix sysfs path for setting bridge configuration parameters
...s properties. */
+ snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/%s",
+ bridge, name);
+ if (!access(path, F_OK))
+ return fopen(path, "w+");
+
+ return NULL;
+}
+
/*
* Convert device name to an index in the list of ports in bridge.
*
@@ -283,12 +303,9 @@ static int br_set(const char *bridge, const char *name,
unsigned long value, unsigned long oldcode)
{
int ret;
- char path[SYSFS_PATH_MAX];
FILE *f;
- snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/%s", bridge, name);
-
- f = fopen(path, "w");
+ f = br_sysfs_open(bridge, name);...
2009 Jun 15
0
[Bridge] [PATCH] bridge-utils: fix sysfs path for setting bridge configuration parameters
...s properties. */
+ snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/%s",
+ bridge, name);
+ if (!access(path, F_OK))
+ return fopen(path, "w+");
+
+ return NULL;
+}
+
/*
* Convert device name to an index in the list of ports in bridge.
*
@@ -283,12 +303,9 @@ static int br_set(const char *bridge, const char *name,
unsigned long value, unsigned long oldcode)
{
int ret;
- char path[SYSFS_PATH_MAX];
FILE *f;
- snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/%s", bridge, name);
-
- f = fopen(path, "w");
+ f = br_sysfs_open(bridge, name);...
2009 Jun 15
0
[Bridge] [PATCH] bridge-utils: fix sysfs path for setting bridge configuration parameters
...s properties. */
+ snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/%s",
+ bridge, name);
+ if (!access(path, F_OK))
+ return fopen(path, "w+");
+
+ return NULL;
+}
+
/*
* Convert device name to an index in the list of ports in bridge.
*
@@ -283,12 +303,9 @@ static int br_set(const char *bridge, const char *name,
unsigned long value, unsigned long oldcode)
{
int ret;
- char path[SYSFS_PATH_MAX];
FILE *f;
- snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/%s", bridge, name);
-
- f = fopen(path, "w");
+ f = br_sysfs_open(bridge, name);...