PATCH: Allow more than 128 AppleTalk sockets

From: Jens-Uwe Mager (jum@helios.de)
Date: Fri Jul 07 2000 - 11:16:44 EST


The Linux kernel does only allow for 128 AppleTalk sockets as per some
old spec that the low port numbers should be reserved. The only well
known ports that are used in AppleTalk without name binding are up to
port number 6, the zone information socket. The attached patch changes
the algorithm to allocate AppleTalk ports from the high maximum port
number to the lower numbers, changing the reserved to 7 instead of 128.
This allows the use of more sockets if really needed while still not
using the low port numbers until 128 ports have been allocated.

--- linux-2.2.16/include/linux/atalk.h.orig Fri Jul 7 17:45:56 2000
+++ linux-2.2.16/include/linux/atalk.h Fri Jul 7 17:47:54 2000
@@ -9,7 +9,7 @@
 #define __LINUX_ATALK_H__
 
 #define ATPORT_FIRST 1
-#define ATPORT_RESERVED 128
+#define ATPORT_RESERVED 7
 #define ATPORT_LAST 254 /* 254 is only legal on localtalk */
 #define ATADDR_ANYNET (__u16)0
 #define ATADDR_ANYNODE (__u8)0

--- linux-2.2.16/net/appletalk/ddp.c.orig Fri Jul 7 17:48:32 2000
+++ linux-2.2.16/net/appletalk/ddp.c Tue Jun 27 11:53:50 2000
@@ -1238,7 +1238,7 @@
  */
 static int atalk_pick_port(struct sockaddr_at *sat)
 {
- for(sat->sat_port = ATPORT_RESERVED; sat->sat_port < ATPORT_LAST; sat->sat_port++)
+ for(sat->sat_port = ATPORT_LAST; sat->sat_port >= ATPORT_RESERVED; sat->sat_port--)
         {
                 if(atalk_find_socket(sat) == NULL)
                         return sat->sat_port;

-- 
Jens-Uwe Mager

HELIOS Software GmbH Steinriede 3 30827 Garbsen Germany

Phone: +49 5131 709320 FAX: +49 5131 709325 Internet: jum@helios.de

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jul 07 2000 - 21:00:21 EST