X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=glue.h;h=de0ab23ff59352b0d9ddd14026af1d94e8f099a2;hb=4a890465af526ece5ee7ad83f11e2de62638d5df;hp=c05ee4aefaf40a4e4543290509e62aaf3fca3e3a;hpb=5ad9fec40da13c449d50def12f9cea6e24b6a708;p=ipfw.git diff --git a/glue.h b/glue.h index c05ee4a..de0ab23 100644 --- a/glue.h +++ b/glue.h @@ -23,7 +23,7 @@ * SUCH DAMAGE. */ /* - * $Id: glue.h 4413 2009-12-10 08:57:02Z luigi $ + * $Id: glue.h 4661 2010-01-04 11:56:12Z luigi $ * * glue code to adapt the FreeBSD version to linux and windows, * userland and kernel. @@ -241,6 +241,11 @@ int sysctlbyname(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen); +#ifdef __linux__ +/* linux does not have sin_len in sockaddr, we only remap in userland */ +#define sin_len sin_zero[0] +#endif /* __linux__ */ + #else /* KERNEL_MODULE */ /* linux and windows kernel do not have bcopy ? */ @@ -250,6 +255,11 @@ sysctlbyname(const char *name, void *oldp, size_t *oldlenp, void *newp, #include #endif +/* skb_dst() was introduced from linux 2.6.31 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) // or 2.4.x +#define skb_dst(_dummy) skb->dst +#endif + /* definitions useful for the kernel side */ struct route_in6 { }; @@ -260,10 +270,6 @@ struct route_in6 { }; #define INET_ADDRSTRLEN 16 -#ifdef linux -/* linux does not have sin_len in sockaddr */ -#define sin_len __pad[0] -#endif /* linux */ /* * List of values used for set/getsockopt options.