Skip to content

Instantly share code, notes, and snippets.

@cvsync
Created August 28, 2015 03:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cvsync/f1d4affa9a5e8f08829d to your computer and use it in GitHub Desktop.
Save cvsync/f1d4affa9a5e8f08829d to your computer and use it in GitHub Desktop.
IPv6 アドレスを除外したいなら?
--- mod_dosdetector.c.orig 2015-08-28 12:06:01.000000000 +0900
+++ mod_dosdetector.c 2015-08-28 12:07:32.000000000 +0900
@@ -307,6 +307,11 @@
#endif
}
if(cfg->forwarded || addr.s_addr == 0){
+ struct in6_addr addr6;
+ if (inet_pton(AF_INET6, address, &addr6) == 1) {
+ /* *VALID* IPv6 address */
+ return DECLINED;
+ }
if (inet_aton(address, &addr) == 0) {
TRACELOG("dosdetector: '%s' is not a valid IP addresss", address);
return DECLINED;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment