diff options
author | buytenh <buytenh> | 2002-01-16 12:01:07 +0000 |
---|---|---|
committer | buytenh <buytenh> | 2002-01-16 12:01:07 +0000 |
commit | 6e81a0af986b83c515771ccbcf0de9862584dea5 (patch) | |
tree | 545cf2f06347964792f226b12fc3d6592abd8be9 | |
parent | 56bcc85a5c1f6fbe44fcb1c88b27579d9354f171 (diff) | |
download | bridge-utils-6e81a0af986b83c515771ccbcf0de9862584dea5.tar.gz |
Work around sparc64 brokenness some more.
-rw-r--r-- | libbridge/libbridge_devif.c | 8 | ||||
-rw-r--r-- | libbridge/libbridge_if.c | 7 | ||||
-rw-r--r-- | libbridge/libbridge_private.h | 3 |
3 files changed, 10 insertions, 8 deletions
diff --git a/libbridge/libbridge_devif.c b/libbridge/libbridge_devif.c index 6b35788..5ed881d 100644 --- a/libbridge/libbridge_devif.c +++ b/libbridge/libbridge_devif.c @@ -37,12 +37,12 @@ int br_device_ioctl32(struct bridge *br, unsigned long arg0, unsigned long arg1, args[3] = arg3; memcpy(ifr.ifr_name, br->ifname, IFNAMSIZ); - ((unsigned long *)(&ifr.ifr_data))[0] = ((unsigned long)args) & ~0UL; + ((unsigned long *)(&ifr.ifr_data))[0] = (unsigned long)args; return ioctl(br_socket_fd, SIOCDEVPRIVATE, &ifr); } -#ifdef sparc +#ifdef __sparc__ int br_device_ioctl64(struct bridge *br, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3) { unsigned long long args[4]; @@ -54,7 +54,7 @@ int br_device_ioctl64(struct bridge *br, unsigned long arg0, unsigned long arg1, args[3] = arg3; memcpy(ifr.ifr_name, br->ifname, IFNAMSIZ); - ((unsigned long long *)(&ifr.ifr_data))[0] = ((unsigned long long)args) & ~0UL; + ((unsigned long long *)(&ifr.ifr_data))[0] = (unsigned long long)(unsinged long)args; return ioctl(br_socket_fd, SIOCDEVPRIVATE + 3, &ifr); } @@ -62,7 +62,7 @@ int br_device_ioctl64(struct bridge *br, unsigned long arg0, unsigned long arg1, int br_device_ioctl(struct bridge *br, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3) { -#ifdef sparc +#ifdef __sparc__ if (__kernel_is_64_bit()) return br_device_ioctl64(br, arg0, arg1, arg2, arg3); #endif diff --git a/libbridge/libbridge_if.c b/libbridge/libbridge_if.c index 3627747..0cfe6b6 100644 --- a/libbridge/libbridge_if.c +++ b/libbridge/libbridge_if.c @@ -23,6 +23,7 @@ #include <sys/fcntl.h> #include <sys/ioctl.h> #include <sys/time.h> +#include <sys/utsname.h> #include "libbridge.h" #include "libbridge_private.h" @@ -37,7 +38,7 @@ static int br_ioctl32(unsigned long arg0, unsigned long arg1, unsigned long arg2 return ioctl(br_socket_fd, SIOCGIFBR, arg); } -#ifdef sparc +#ifdef __sparc__ static int br_ioctl64(unsigned long arg0, unsigned long arg1, unsigned long arg2) { unsigned long long arg[3]; @@ -49,7 +50,7 @@ static int br_ioctl64(unsigned long arg0, unsigned long arg1, unsigned long arg2 return ioctl(br_socket_fd, SIOCGIFBR, arg); } -static int __kernel_is_64_bit() +int __kernel_is_64_bit() { static int kernel_is_64_bit = -1; @@ -66,7 +67,7 @@ static int __kernel_is_64_bit() int br_ioctl(unsigned long arg0, unsigned long arg1, unsigned long arg2) { -#ifdef sparc +#ifdef __sparc__ if (__kernel_is_64_bit()) return br_ioctl64(arg0, arg1, arg2); #endif diff --git a/libbridge/libbridge_private.h b/libbridge/libbridge_private.h index 58a80cf..ddb9e7a 100644 --- a/libbridge/libbridge_private.h +++ b/libbridge/libbridge_private.h @@ -23,8 +23,9 @@ extern int br_socket_fd; -unsigned long __tv_to_jiffies(struct timeval *tv); void __jiffies_to_tv(struct timeval *tv, unsigned long jiffies); +int __kernel_is_64_bit(void); +unsigned long __tv_to_jiffies(struct timeval *tv); int br_device_ioctl(struct bridge *br, unsigned long arg0, |