Created
October 17, 2009 15:13
-
-
Save bdrewery/212362 to your computer and use it in GitHub Desktop.
FreeBSD 7 kernel patch to block listening on IRCD ports on INADDR_ANY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ./sys/netinet/in_pcb.c.orig 2009-09-17 09:40:42.000000000 -0500 | |
+++ ./sys/netinet/in_pcb.c 2009-10-03 11:07:16.000000000 -0500 | |
@@ -346,6 +346,14 @@ | |
priv_check_cred(cred, PRIV_NETINET_RESERVEDPORT, | |
0)) | |
return (EACCES); | |
+ /* Deny listening on ircd ports on INADDR_ANY */ | |
+ if ((sin->sin_addr.s_addr == INADDR_ANY) && ( | |
+ (ntohs(lport) >= 6660 && ntohs(lport) <= 6669) || | |
+ (ntohs(lport) == 6697) || | |
+ (ntohs(lport) == 7000) || | |
+ (ntohs(lport) == 8067) | |
+ )) | |
+ return (EINVAL); | |
if (!IN_MULTICAST(ntohl(sin->sin_addr.s_addr)) && | |
priv_check_cred(inp->inp_cred, | |
PRIV_NETINET_REUSEPORT, 0) != 0) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment