Skip to content

Instantly share code, notes, and snippets.

View grooverdan's full-sized avatar
💭
compile, test, repeat

Daniel Black grooverdan

💭
compile, test, repeat
View GitHub Profile
cat align-test.c
#include <stdlib.h>
/* from include/my_compiler.h */
#if defined __GNUC__ || defined __SUNPRO_C || defined __SUNPRO_CC
/* Specifies the minimum alignment of a type. */
# define MY_ALIGNOF(type) __alignof__(type)
/* Determine the alignment requirement of a type. */
/* from include/my_compiler.h */
#if defined __GNUC__ || defined __SUNPRO_C || defined __SUNPRO_CC
/* Specifies the minimum alignment of a type. */
# define MY_ALIGNOF(type) __alignof__(type)
/* Determine the alignment requirement of a type. */
# define MY_ALIGNED(n) __attribute__((__aligned__((n))))
/* Microsoft Visual C++ */
#elif defined _MSC_VER
# define MY_ALIGNOF(type) __alignof(type)
#!/bin/bash
if [ $# -gt 1 ]; then
CLIENT=$1
HOSTNAME=$2
else
echo fail
exit 1
fi
@grooverdan
grooverdan / fail2ban IPv6
Created January 3, 2013 05:02
Fail2Ban IPv6 support - approaches
Fail2ban needs IPv6 support
===========================
Summary
-------
Fail2ban's IPv6 support in the underneath layers is easy enough but how do we process action files? A large number of user defined action files exist, some support IPv6 and some don't. Netfilter and other mechanism like ipset can sometimes require a totally different set of tools to deal with IPv4 vs IPv6. To complicate this more it may be needed to block IPv6 network addresses rather than individual IPv6 addresss as they are often handed out in block. An attacker could quite easily control a /64 IPv6 addresss pace and the single banning approach of IPv4 may not be as effective.