Wander Winkelhorst schrieb:
> Hello,
>
> The brctl applet doesn't compile with kernels < 2.6.7 because the
> ioctls were renamed in that version.
> I need to work with an ancient kernel (2.4.18) because of some
> vendor-supplied binary-only kernel module that only works in that
> version.
>
> Thanks again for making such a great tool!
>
> So here is the patch against busybox-1.13.2:
>
just a question
the first are ARG_addbr 2 times
the next ist ARG_addbr and ARG_addif
is this intended ?
is it possible to wrap this outside the function code like:
#if LINUX_VERSION_CODE <KERNEL_VERSION(2,6,7)
#define CODE1 RCTL_ADD_BRIDGE: BRCTL_DEL_BRIDGE
#else
#define CODE1 SIOCBRADDBR : SIOCBRDELBR,
#endif
....
key == ARG_addbr ? CODE1 ;
i think you get the idea.
just my 2 cents,
re
wh
> --- ./brctl.c.org 2009-01-30 13:08:28.000000000 +0100
> +++ brctl.c 2009-01-30 13:08:58.000000000 +0100
> @@ -15,4 +15,5 @@
> #include "libbb.h"
> #include <linux/sockios.h>
> +#include <linux/version.h>
> #include <net/if.h>
>
> @@ -184,5 +185,10 @@
> if (key == ARG_addbr || key == ARG_delbr) { /* addbr or delbr
> */
> ioctl_or_perror_and_die(fd,
> - key == ARG_addbr ? SIOCBRADDBR
> : SIOCBRDELBR,
> +
> + #if LINUX_VERSION_CODE <
> KERNEL_VERSION(2,6,7)
> + key == ARG_addbr ?
> BRCTL_ADD_BRIDGE: BRCTL_DEL_BRIDGE,
> + #else
> + key == ARG_addbr ?
> SIOCBRADDBR : SIOCBRDELBR,
> + #endif
> br, "bridge %s", br);
> goto done;
> @@ -200,5 +206,10 @@
> }
> ioctl_or_perror_and_die(fd,
> - key == ARG_addif ? SIOCBRADDIF
> : SIOCBRDELIF,
> + #if LINUX_VERSION_CODE <
> KERNEL_VERSION(2,6,7)
> + key == ARG_addbr ?
> BRCTL_ADD_IF: BRCTL_DEL_IF,
> + #else
> + key == ARG_addif ?
> SIOCBRADDIF : SIOCBRDELIF,
> + #endif
> +
> &ifr, "bridge %s", br);
> goto done_next_argv;
> _______________________________________________
> busybox mailing list
> [email protected]
> http://lists.busybox.net/mailman/listinfo/busybox
>
>
>
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox