From key@Network-Alchemy.COM Fri Apr 21 11:18:33 2000 Return-Path: Received: from lithium.network-alchemy.com (NAT-10-net.Network-Alchemy.COM [199.46.17.205]) by hub.freebsd.org (Postfix) with ESMTP id 12EB137BA45 for ; Fri, 21 Apr 2000 11:18:32 -0700 (PDT) (envelope-from key@Network-Alchemy.COM) Received: (from root@localhost) by lithium.network-alchemy.com (8.9.3/8.8.8) id LAA02934; Fri, 21 Apr 2000 11:19:24 -0700 (PDT) (envelope-from key) Message-Id: <200004211819.LAA02934@lithium.network-alchemy.com> Date: Fri, 21 Apr 2000 11:19:24 -0700 (PDT) From: Ken Key Reply-To: key@network-alchemy.com To: FreeBSD-gnats-submit@freebsd.org Subject: pppd - MAX_IFS in sys-bsd.c too small for most GENERIC-based kernels. X-Send-Pr-Version: 3.2 >Number: 18131 >Category: misc >Synopsis: MAX_IFS in pppd/sys-bsd.c too small for most GENERIC-based kernels today. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Apr 21 11:20:02 PDT 2000 >Closed-Date: Thu Feb 28 01:09:11 PST 2002 >Last-Modified: Thu Feb 28 01:10:04 PST 2002 >Originator: Ken Key >Release: FreeBSD 4.0-RELEASE i386 >Organization: Network Alchemy >Environment: Sony VIAO 505TX with a WaveLAN Turbo PCMCIA card using a mostly GENERIC kernel. >Description: In pppd/sys-bsd.c, MAX_IFS for get_ether_addr() is set to 32, which would seem a goodly number of interfaces. However, since the INET6 addresses are bigger than struct sockaddr in ifreq, this gets truncated with only 11 interfaces (in my case). The symptom is that a PCCARD ethernet (WaveLAN) adapter that is the currently active interface but at the end of the interface list is left off and pppd, which it tries to set the proxy ARP cannot determine what interface to use. Since INET6 is on turned on in the default (GENERIC) kernel, we should probably make the rest of the OS still function in that environment. >How-To-Repeat: Create a GENERIC kernel with a couple of ethernet interfaces, most notably a PCCARD interface so it will be at the end of the list. Here is my ifconfig -a output: fxp0: flags=8843 mtu 1500 inet6 fe80::a00:46ff:fe05:84cc%fxp0 prefixlen 64 scopeid 0x1 inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255 ether 08:00:46:05:84:cc media: autoselect status: no carrier supported media: autoselect 100baseTX 100baseTX 10baseT/UTP 10baseT/UTP lp0: flags=8810 mtu 1500 sl0: flags=c010 mtu 552 ppp0: flags=8151 mtu 1500 inet 10.0.4.46 --> 10.0.4.91 netmask 0xfffffe00 lo0: flags=8049 mtu 16384 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 inet6 ::1 prefixlen 128 inet 127.0.0.1 netmask 0xff000000 gif0: flags=8010 mtu 1280 inet6 fe80::a00:46ff:fe05:84cc%gif0 prefixlen 64 scopeid 0x6 gif1: flags=8010 mtu 1280 inet6 fe80::a00:46ff:fe05:84cc%gif1 prefixlen 64 scopeid 0x7 gif2: flags=8010 mtu 1280 inet6 fe80::a00:46ff:fe05:84cc%gif2 prefixlen 64 scopeid 0x8 gif3: flags=8010 mtu 1280 inet6 fe80::a00:46ff:fe05:84cc%gif3 prefixlen 64 scopeid 0x9 stf0: flags=8000 mtu 1280 inet6 fe80::a00:46ff:fe05:84cc%stf0 prefixlen 64 scopeid 0xa faith0: flags=8000 mtu 1500 wi0: flags=8843 mtu 1500 inet6 fe80::260:1dff:fef0:e544%wi0 prefixlen 64 scopeid 0xc inet 10.0.4.46 netmask 0xfffffe00 broadcast 10.0.5.255 ether 00:60:1d:f0:e5:44 >Fix: Short term, bump MAX_IFS to some larger number - 128 worked for me. Longer term, make allocation dynamically sized and retry ifconf's until all is retrieved. Even longer term, move to sysctl() and NET_RT_IFLIST. I noticed that sbin/arp.c also has MAX_IFS set to 32 and will most likely suffer a similar problem. A quick grep of the source tree shows is in very heavy use. >Release-Note: >Audit-Trail: State-Changed-From-To: open->closed State-Changed-By: maxim State-Changed-When: Thu Feb 28 01:09:11 PST 2002 State-Changed-Why: Duplicated with bin/9379. http://www.FreeBSD.org/cgi/query-pr.cgi?pr=18131 >Unformatted: