Browse Source

added detection of private IP registrations

Jiri Kuthan 23 years ago
parent
commit
ba78804018
1 changed files with 9 additions and 0 deletions
  1. 9 0
      etc/iptel.cfg

+ 9 - 0
etc/iptel.cfg

@@ -193,6 +193,15 @@ route{
 							"0" /* no qop -- some phones can't deal with it */);
 			break;
 		};
+
+		# Make sure that is not registration from private IP space (RFC1918)
+		# (note: does not match with folded lines)
+		if (search("(Contact|m): .*@(192\.168\.|10\.|172\.16)")) {
+			log("LOG: Someone trying to register from private IP again\n");
+			sl_send_reply("478", "We dont accept private IP requests" );
+			break;
+		};
+
 		if (!is_user("replicator") & !check_to()) {
 			log("LOG: To Cheating attempt\n");
 			sl_send_reply("403", "That is ugly -- use To=id next time");