Date: Sun, 15 Sep 1996 16:32:06 -0400 (EDT) From: jc@cayman.irbs.com To: FreeBSD-gnats-submit@freebsd.org Subject: bin/1615: Routed byte order problem [FIX] Message-ID: <199609152032.QAA08309@cayman.irbs.com> Resent-Message-ID: <199609152040.NAA12921@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 1615 >Category: bin >Synopsis: Routed byte order problem [FIX] >Confidential: yes >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Sep 15 13:40:01 PDT 1996 >Last-Modified: >Originator: John Capo >Organization: >Release: FreeBSD 2.2-CURRENT i386 >Environment: >Description: Addresses are in network order, masks are in host order. getnet() in parms.c gets it wrong if the address is dotted decimal. >How-To-Repeat: Attempt to use -P subnet=address/mask on the command line or with a net address/mask entry in the config file. >Fix: Index: parms.c =================================================================== RCS file: /usr/cvs/src/usr.sbin/routed/parms.c,v retrieving revision 1.1.3.3 diff -c -r1.1.3.3 parms.c *** parms.c 1996/08/27 16:12:52 1.1.3.3 --- parms.c 1996/09/15 20:20:09 *************** *** 566,572 **** if (np != 0) { in.s_addr = (naddr)np->n_net; } else if (inet_aton(name, &in) == 1) { ! HTONL(in.s_addr); } else { return 0; } --- 566,572 ---- if (np != 0) { in.s_addr = (naddr)np->n_net; } else if (inet_aton(name, &in) == 1) { ! NTOHL(in.s_addr); } else { return 0; } *************** *** 576,582 **** * looked at them yet. */ mask = std_mask(in.s_addr); ! if ((~mask & ntohl(in.s_addr)) != 0) mask = HOST_MASK; } else { mask = (naddr)strtoul(mname, &p, 0); --- 576,582 ---- * looked at them yet. */ mask = std_mask(in.s_addr); ! if ((~mask & in.s_addr) != 0) mask = HOST_MASK; } else { mask = (naddr)strtoul(mname, &p, 0); *************** *** 586,595 **** } if (mask != 0 && in.s_addr == RIP_DEFAULT) return 0; ! if ((~mask & ntohl(in.s_addr)) != 0) return 0; ! *addrp = in.s_addr; *maskp = mask; return 1; } --- 586,596 ---- } if (mask != 0 && in.s_addr == RIP_DEFAULT) return 0; ! ! if ((~mask & in.s_addr) != 0) return 0; ! *addrp = htonl(in.s_addr); *maskp = mask; return 1; } >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609152032.QAA08309>