search for: sysfs_path_max

Displaying 11 results from an estimated 11 matches for "sysfs_path_max".

2007 Jul 31
1
[Bridge] brctl uses incorrect sysfs path
...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 = fopen(path, "w"); if (f) { diff --git a/libbridge/libbrid...
2007 Apr 18
0
[Bridge] libbridge<->sysfs interface - some bugs
...dge_devif.c 2007-01-01 08:22:29.063200300 +0200 @@ -56,7 +56,7 @@ if (!f) fprintf(stderr, "%s: %s\n", dev, strerror(errno)); else { - fscanf(f, "%d", &value); + fscanf(f, "%i", &value); fclose(f); } return value; @@ -282,7 +282,7 @@ 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 = fopen(path, "w"); if (f) { diff -ru --strip-trailing-cr bridge-utils-1.2/libbridge/libbridg...
2009 Jun 15
0
[Bridge] [PATCH] bridge-utils: fix sysfs path for setting bridge configuration parameters
...vif.c +++ b/libbridge/libbridge_devif.c @@ -73,6 +73,26 @@ static void fetch_tv(const char *dev, const char *name, __jiffies_to_tv(tv, fetch_int(dev, name)); } +/* Open sysfs path for writing bridge properties. */ +static FILE *br_sysfs_open(const char *bridge, const char *name) +{ + char path[SYSFS_PATH_MAX]; + + /* Try accessing /sys/class/net/$bridge/bridge/$name. */ + snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s" + SYSFS_BRIDGE_DIR "/%s", bridge, name); + if (!access(path, F_OK)) + return fopen(path, "w+"); + + /* Try using old-style of accessing bridge sysfs...
2009 Jun 15
0
[Bridge] [PATCH] bridge-utils: fix sysfs path for setting bridge configuration parameters
...vif.c +++ b/libbridge/libbridge_devif.c @@ -73,6 +73,26 @@ static void fetch_tv(const char *dev, const char *name, __jiffies_to_tv(tv, fetch_int(dev, name)); } +/* Open sysfs path for writing bridge properties. */ +static FILE *br_sysfs_open(const char *bridge, const char *name) +{ + char path[SYSFS_PATH_MAX]; + + /* Try accessing /sys/class/net/$bridge/bridge/$name. */ + snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s" + SYSFS_BRIDGE_DIR "/%s", bridge, name); + if (!access(path, F_OK)) + return fopen(path, "w+"); + + /* Try using old-style of accessing bridge sysfs...
2009 Jun 15
0
[Bridge] [PATCH] bridge-utils: fix sysfs path for setting bridge configuration parameters
...vif.c +++ b/libbridge/libbridge_devif.c @@ -73,6 +73,26 @@ static void fetch_tv(const char *dev, const char *name, __jiffies_to_tv(tv, fetch_int(dev, name)); } +/* Open sysfs path for writing bridge properties. */ +static FILE *br_sysfs_open(const char *bridge, const char *name) +{ + char path[SYSFS_PATH_MAX]; + + /* Try accessing /sys/class/net/$bridge/bridge/$name. */ + snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s" + SYSFS_BRIDGE_DIR "/%s", bridge, name); + if (!access(path, F_OK)) + return fopen(path, "w+"); + + /* Try using old-style of accessing bridge sysfs...
2009 Aug 13
0
[Bridge] [PATCH] bridge-utils: Add 'hairpin' port forwarding mode
...bridge_devif.c index 34e3cc8..ca40325 100644 --- a/libbridge/libbridge_devif.c +++ b/libbridge/libbridge_devif.c @@ -36,6 +36,14 @@ static FILE *fpopen(const char *dir, const char *name) return fopen(path, "r"); } +static int fpaccess(const char *dir, const char *name) +{ + char path[SYSFS_PATH_MAX]; + + snprintf(path, SYSFS_PATH_MAX, "%s/%s", dir, name); + return access(path, F_OK); +} + static void fetch_id(const char *dev, const char *name, struct bridge_id *id) { FILE *f = fpopen(dev, name); @@ -73,6 +81,12 @@ static void fetch_tv(const char *dev, const char *name, __jiffi...
2009 Aug 13
0
[Bridge] [PATCH] bridge-utils: Add 'hairpin' port forwarding mode
...bridge_devif.c index 34e3cc8..ca40325 100644 --- a/libbridge/libbridge_devif.c +++ b/libbridge/libbridge_devif.c @@ -36,6 +36,14 @@ static FILE *fpopen(const char *dir, const char *name) return fopen(path, "r"); } +static int fpaccess(const char *dir, const char *name) +{ + char path[SYSFS_PATH_MAX]; + + snprintf(path, SYSFS_PATH_MAX, "%s/%s", dir, name); + return access(path, F_OK); +} + static void fetch_id(const char *dev, const char *name, struct bridge_id *id) { FILE *f = fpopen(dev, name); @@ -73,6 +81,12 @@ static void fetch_tv(const char *dev, const char *name, __jiffi...
2009 Aug 13
0
[Bridge] [PATCH] bridge-utils: Add 'hairpin' port forwarding mode
...bridge_devif.c index 34e3cc8..ca40325 100644 --- a/libbridge/libbridge_devif.c +++ b/libbridge/libbridge_devif.c @@ -36,6 +36,14 @@ static FILE *fpopen(const char *dir, const char *name) return fopen(path, "r"); } +static int fpaccess(const char *dir, const char *name) +{ + char path[SYSFS_PATH_MAX]; + + snprintf(path, SYSFS_PATH_MAX, "%s/%s", dir, name); + return access(path, F_OK); +} + static void fetch_id(const char *dev, const char *name, struct bridge_id *id) { FILE *f = fpopen(dev, name); @@ -73,6 +81,12 @@ static void fetch_tv(const char *dev, const char *name, __jiffi...
2009 Jun 15
0
[Bridge] [PATCH][RFC] bridge-utils: add basic VEPA support
...bridge_devif.c index 547bb86..cc4a9cb 100644 --- a/libbridge/libbridge_devif.c +++ b/libbridge/libbridge_devif.c @@ -36,6 +36,14 @@ static FILE *fpopen(const char *dir, const char *name) return fopen(path, "r"); } +static int fpaccess(const char *dir, const char *name) +{ + char path[SYSFS_PATH_MAX]; + + snprintf(path, SYSFS_PATH_MAX, "%s/%s", dir, name); + return access(path, F_OK); +} + static void fetch_id(const char *dev, const char *name, struct bridge_id *id) { FILE *f = fpopen(dev, name); @@ -58,7 +66,8 @@ static int fetch_int(const char *dev, const char *name) int valu...
2009 Jun 15
0
[Bridge] [PATCH][RFC] bridge-utils: add basic VEPA support
...bridge_devif.c index 547bb86..cc4a9cb 100644 --- a/libbridge/libbridge_devif.c +++ b/libbridge/libbridge_devif.c @@ -36,6 +36,14 @@ static FILE *fpopen(const char *dir, const char *name) return fopen(path, "r"); } +static int fpaccess(const char *dir, const char *name) +{ + char path[SYSFS_PATH_MAX]; + + snprintf(path, SYSFS_PATH_MAX, "%s/%s", dir, name); + return access(path, F_OK); +} + static void fetch_id(const char *dev, const char *name, struct bridge_id *id) { FILE *f = fpopen(dev, name); @@ -58,7 +66,8 @@ static int fetch_int(const char *dev, const char *name) int valu...
2009 Jun 15
0
[Bridge] [PATCH][RFC] bridge-utils: add basic VEPA support
...bridge_devif.c index 547bb86..cc4a9cb 100644 --- a/libbridge/libbridge_devif.c +++ b/libbridge/libbridge_devif.c @@ -36,6 +36,14 @@ static FILE *fpopen(const char *dir, const char *name) return fopen(path, "r"); } +static int fpaccess(const char *dir, const char *name) +{ + char path[SYSFS_PATH_MAX]; + + snprintf(path, SYSFS_PATH_MAX, "%s/%s", dir, name); + return access(path, F_OK); +} + static void fetch_id(const char *dev, const char *name, struct bridge_id *id) { FILE *f = fpopen(dev, name); @@ -58,7 +66,8 @@ static int fetch_int(const char *dev, const char *name) int valu...