From owner-freebsd-bugs@FreeBSD.ORG Fri Apr 22 22:00:45 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3422816A4D5 for ; Fri, 22 Apr 2005 22:00:45 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id AEF2843D54 for ; Fri, 22 Apr 2005 22:00:44 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3MM0ild081266 for ; Fri, 22 Apr 2005 22:00:44 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3MM0ikc081265; Fri, 22 Apr 2005 22:00:44 GMT (envelope-from gnats) Resent-Date: Fri, 22 Apr 2005 22:00:44 GMT Resent-Message-Id: <200504222200.j3MM0ikc081265@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Keith White Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6136916A4CE for ; Fri, 22 Apr 2005 21:54:58 +0000 (GMT) Received: from mail.site.uottawa.ca (mailn.site.uottawa.ca [137.122.89.142]) by mx1.FreeBSD.org (Postfix) with ESMTP id 49CF843D1D for ; Fri, 22 Apr 2005 21:54:57 +0000 (GMT) (envelope-from Keith.White@site.uottawa.ca) Received: from admin16.site.uottawa.ca (admin16.site.uottawa.ca [137.122.90.250]) by mail.site.uottawa.ca (8.9.3/8.9.3) with ESMTP id RAA01546 for ; Fri, 22 Apr 2005 17:54:55 -0400 (EDT) Received: from admin16.site.uottawa.ca (localhost [127.0.0.1]) j3MLoBcC066754 for ; Fri, 22 Apr 2005 17:50:11 -0400 (EDT) (envelope-from kwhite@admin16.site.uottawa.ca) Received: (from kwhite@localhost) by admin16.site.uottawa.ca (8.12.11/8.13.1/Submit) id j3MLoBs3066753; Fri, 22 Apr 2005 17:50:11 -0400 (EDT) (envelope-from kwhite) Message-Id: <200504222150.j3MLoBs3066753@admin16.site.uottawa.ca> Date: Fri, 22 Apr 2005 17:50:11 -0400 (EDT) From: Keith White To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/80266: IPX routing doesn't work X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Keith White List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Apr 2005 22:00:45 -0000 >Number: 80266 >Category: kern >Synopsis: IPX routing doesn't work >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Apr 22 22:00:43 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Keith White >Release: FreeBSD 5.4-RC3 i386 >Organization: SITE, University of Ottawa >Environment: System: FreeBSD 5.4-RC3 FreeBSD 5.4-RC3 #3: Fri Apr 22 14:18:59 EDT 2005 root@:/usr/obj/usr/src/sys/NOSMPPAE i386 >Description: IPX routing in 5.4-RC3 doesn't work. See also: kern/74105 Some more structures need to be declared as "packed" for IPXrouted(8) and kernel routines that use "struct sockaddr_ipx" so that routes are created correctly. >How-To-Repeat: Find a busy IPX network. Run "IPXrouted -q -t". Notice misaligned hostnames, invalid IPX network addresses, negative ticks and extreme metric. Run "netstat -rnf ipx". Notice how all "Destinations" are "default" rather than "network.*" Run "ncplist s". Wait for output (it'll likely timeout). >Fix: Patches against 5.4-RC3 --- usr/src/usr.sbin/IPXrouted/protocol.h Fri Aug 27 21:15:03 1999 +++ /usr/src/usr.sbin/IPXrouted/protocol.h Fri Apr 22 11:30:40 2005 @@ -49,12 +49,12 @@ union ipx_net rip_dst; /* destination net */ u_short rip_metric; /* cost of route */ u_short rip_ticks; /* cost of route */ -}; +} __packed; struct rip { u_short rip_cmd; /* request/response */ struct netinfo rip_nets[1]; /* variable length */ -}; +} __packed; /* * Packet types. --- usr/src/usr.sbin/IPXrouted/sap.h Fri Aug 27 21:15:03 1999 +++ /usr/src/usr.sbin/IPXrouted/sap.h Thu Apr 21 10:57:10 2005 @@ -47,19 +47,19 @@ #define MAXSAPENTRIES 7 #define SAP_WILDCARD 0xFFFF #define SERVNAMELEN 48 -typedef struct sap_info { +typedef struct __attribute__ ((packed)) sap_info { u_short ServType; char ServName[SERVNAMELEN]; struct ipx_addr ipx; u_short hops; - }sap_info; + }sap_info; -typedef struct sap_packet { +typedef struct __attribute__ ((packed)) sap_packet { u_short sap_cmd; sap_info sap[0]; /* Variable length. */ }sap_packet; -typedef struct sap_entry { +typedef struct __attribute__ ((packed)) sap_entry { struct sap_entry *forw; struct sap_entry *back; struct sap_entry *clone; @@ -73,7 +73,7 @@ #define SAPHASHSIZ 256 /* Should be a power of 2 */ #define SAPHASHMASK (SAPHASHSIZ-1) -typedef struct sap_hash { +typedef struct __attribute__ ((packed)) sap_hash { struct sap_entry *forw; struct sap_entry *back; }sap_hash; --- usr/src/usr.sbin/IPXrouted/trace.c Sat Nov 15 12:10:56 2003 +++ /usr/src/usr.sbin/IPXrouted/trace.c Thu Apr 21 12:45:04 2005 @@ -500,7 +500,7 @@ { static char buf[100]; net.net_e = val; - (void)sprintf(buf, "%u", ntohl(net.long_e)); + (void)sprintf(buf, "%x", ntohl(net.long_e)); return (buf); } --- usr/src/usr.sbin/IPXrouted/main.c Sat Nov 15 12:10:56 2003 +++ /usr/src/usr.sbin/IPXrouted/main.c Thu Apr 21 15:09:52 2005 @@ -77,7 +77,7 @@ int timeval; /* local idea of time */ int noteremoterequests; /* squawk on requests from non-local nets */ int r; /* Routing socket to install updates with */ -struct sockaddr_ipx ipx_netmask; /* Used in installing routes */ +struct __attribute__ ((packed)) sockaddr_ipx ipx_netmask; /* Used in installing routes */ char packet[MAXRXPACKETSIZE+1]; --- usr/src/lib/libncp/ipxsap.h Tue Oct 12 07:56:37 1999 +++ /usr/src/lib/libncp/ipxsap.h Fri Apr 22 10:23:45 2005 @@ -58,7 +58,7 @@ u_char server_name[IPX_SAP_SERVER_NAME_LEN]; struct ipx_addr ipx; u_short hops; -}; +} __packed; struct sap_packet { u_short operation; --- usr/src/sys/netipx/ipx.h Mon Jan 31 18:26:42 2005 +++ /usr/src/sys/netipx/ipx.h Fri Apr 22 14:13:51 2005 @@ -130,7 +130,7 @@ u_char sipx_family; struct ipx_addr sipx_addr; char sipx_zero[2]; -}; +} __packed; #define sipx_port sipx_addr.x_port #define sipx_network sipx_addr.x_net.u_net #define sipx_node sipx_addr.x_host.c_host >Release-Note: >Audit-Trail: >Unformatted: