[23147] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r22808 - trunk/athena/lib/zephyr/server

daemon@ATHENA.MIT.EDU (ghudson@MIT.EDU)
Thu Apr 3 12:17:14 2008

Date: Thu, 3 Apr 2008 12:16:45 -0400 (EDT)
From: ghudson@MIT.EDU
Message-Id: <200804031616.MAA05634@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: ghudson
Date: 2008-04-03 12:16:43 -0400 (Thu, 03 Apr 2008)
New Revision: 22808

Modified:
   trunk/athena/lib/zephyr/server/dispatch.c
Log:
In the Zephyr server, remove the IP address and port checks in an
effort to make the protocol a bit more NAT-friendly, at the cost of
making spoofing slightly easier.


Modified: trunk/athena/lib/zephyr/server/dispatch.c
===================================================================
--- trunk/athena/lib/zephyr/server/dispatch.c	2008-04-03 16:07:26 UTC (rev 22807)
+++ trunk/athena/lib/zephyr/server/dispatch.c	2008-04-03 16:16:43 UTC (rev 22808)
@@ -223,15 +223,6 @@
 	}
     }
 
-    if (whoisit.sin_port != hm_port && whoisit.sin_port != hm_srv_port &&
-	strcasecmp(new_notice.z_class, ZEPHYR_ADMIN_CLASS) != 0 &&
-	whoisit.sin_port != srv_addr.sin_port &&
-	new_notice.z_kind != CLIENTACK) {
-	syslog(LOG_ERR, "bad port %s/%d", inet_ntoa(whoisit.sin_addr),
-	       ntohs(whoisit.sin_port));
-	return;
-    }
-
     message_notices.val++;
     dispatch(&new_notice, authentic, &whoisit, from_server);
     return;
@@ -395,34 +386,6 @@
 	}
       }
     }
-    if (!realm_which_realm(who)) {
-	if (memcmp(&notice->z_sender_addr.s_addr, &who->sin_addr.s_addr,
-		   sizeof(notice->z_sender_addr.s_addr))) {
-	    /* someone is playing games... */
-	    /* inet_ntoa returns pointer to static area */
-	    /* max size is 255.255.255.255 */
-	    char buffer[16];
-	    strcpy(buffer, inet_ntoa(who->sin_addr));
-	    if (!auth) {
-		syslog(LOG_WARNING,
-		       "sendit unauthentic fake packet: claimed %s, real %s",
-		       inet_ntoa(notice->z_sender_addr), buffer);
-		clt_ack(notice, who, AUTH_FAILED);
-		free_string(class);
-		return;
-	    }
-	    if (ntohl(notice->z_sender_addr.s_addr) != 0) {
-		syslog(LOG_WARNING,
-		       "sendit invalid address: claimed %s, real %s",
-		       inet_ntoa(notice->z_sender_addr), buffer);
-		clt_ack(notice, who, AUTH_FAILED);
-		free_string(class);
-		return;
-	    }
-	    syslog(LOG_WARNING, "sendit addr mismatch: claimed %s, real %s",
-		   inet_ntoa(notice->z_sender_addr), buffer);
-	}
-    }
 
     /* Increment the send counter, used to prevent duplicate sends to
      * clients.  On the off-chance that we wrap around to 0, skip over


home help back first fref pref prev next nref lref last post