From owner-freebsd-bugs Sat Jul 14 20:10: 9 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id C4A1737B401 for ; Sat, 14 Jul 2001 20:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f6F3A2L24497; Sat, 14 Jul 2001 20:10:02 -0700 (PDT) (envelope-from gnats) Date: Sat, 14 Jul 2001 20:10:02 -0700 (PDT) Message-Id: <200107150310.f6F3A2L24497@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Brian Somers Subject: Re: kern/28974: PPPoE software fails when SOCK_RAW employed Reply-To: Brian Somers Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/28974; it has been noted by GNATS. From: Brian Somers To: brad@brad-x.com Cc: FreeBSD-gnats-submit@FreeBSD.ORG, brian@Awfulhak.org, roman@xpert.com Subject: Re: kern/28974: PPPoE software fails when SOCK_RAW employed Date: Sun, 15 Jul 2001 04:01:56 +0100 > >Number: 28974 > >Category: kern > >Synopsis: PPPoE software fails when SOCK_RAW employed Heh, I tried the hping port and found that it didn't work at all for me. After looking at the sources, it seems that it's misparsing the results of the SIOCGIFCONF (patch attached), but after looking at the sources for a bit longer, I really think this port should be marked BROKEN -- see the rest of my rantings below. I've cc'd the maintainer. I've only looked at two functions. The first is get_if_name() in getifname.c: o It mis parses the ifreq array returned from SIOCGIFCONF (see patch below) o It's got a rather pessimistic idea that a machine will only have up to 16 interface addresses -- unlikely in my experience. o It doesn't find the most appropriate interface, it just picks the first one it finds that's UP. This program doesn't look like it works on machines with more than one interface. o It doesn't handle non-AF_INET addresses. o It hard-codes the MTU at 1500 The second function I looked at -- which prevents hping working for PPPoE is get_linkhdr_size() in getlhs.c. This function is ridiculous. Not only does it hard-code lots of interface names (leaving out tun*), but it even gets that wrong by using strstr(). roman, is there any chance of fixing this port -- or should I just mark it BROKEN ? brad, it seems that when the above two functions are made to work (with a little hard-coding in my case), hpinging an address that's reached through the tun interface over a PPPoE link works. I think you should raise several bug reports, one for each of the programs that you find doesn't work. Let's leave this one as applying to hping. Is that ok ? Cheers. -- Brian http://www.freebsd-services.com/ Don't _EVER_ lose your sense of humour ! --- getifname.c.orig Thu Jul 6 18:06:10 2000 +++ getifname.c Sun Jul 15 02:52:01 2001 @@ -52,7 +52,7 @@ ifrp = ibuf; ifend = (struct ifreq*) ((char*)ibuf + ifc.ifc_len); - for (; ifrp < ifend; ifrp++) { + for (; ifrp < ifend; ifrp = (char *)&ifrp->ifr_addr + ifrp->ifr_addr.sa_len) { strncpy(ifr.ifr_name, ifrp->ifr_name, sizeof(ifr.ifr_name)); if ( ioctl(fd, SIOCGIFFLAGS, (char*)&ifr) == -1) { To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message