diff options
Diffstat (limited to 'src/libhydra')
-rw-r--r-- | src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c index 0dfb2957a..f8eed5775 100644 --- a/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c +++ b/src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c @@ -41,7 +41,13 @@ #endif /** properly align sockaddrs */ +#ifdef __APPLE__ +/* Apple always uses 4 bytes */ #define SA_ALIGN 4 +#else +/* while on other platforms like FreeBSD it depends on the architecture */ +#define SA_ALIGN sizeof(long) +#endif #define SA_LEN(len) ((len) > 0 ? (((len)+SA_ALIGN-1) & ~(SA_ALIGN-1)) : SA_ALIGN) /** delay before firing roam events (ms) */ @@ -349,7 +355,8 @@ METHOD(enumerator_t, rt_enumerate, bool, *addr = this->addr; *xtype = i; this->remaining -= SA_LEN(this->addr->sa_len); - this->addr = (char*)this->addr + SA_LEN(this->addr->sa_len); + this->addr = (struct sockaddr*)((char*)this->addr + + SA_LEN(this->addr->sa_len)); return TRUE; } } |