From owner-freebsd-net Sun Oct 7 10:37: 1 2001 Delivered-To: freebsd-net@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id 4045D37B403; Sun, 7 Oct 2001 10:36:56 -0700 (PDT) Received: (from mike@localhost) by coffee.q9media.com (8.11.6/8.11.6) id f97HbHq43774; Sun, 7 Oct 2001 13:37:17 -0400 (EDT) (envelope-from mike) Date: Sun, 7 Oct 2001 13:37:16 -0400 From: Mike Barcroft To: "Andrey A. Chernov" Cc: Peter Pentchev , freebsd-net@FreeBSD.ORG, freebsd-audit@FreeBSD.ORG Subject: Re: [CFR] whois(1) out-of-bound access patch Message-ID: <20011007133716.C37270@coffee.q9media.com> References: <20011004121640.C1959@ringworld.oblivion.bg> <20011004132801.A64960@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011004132801.A64960@nagual.pp.ru>; from ache@nagual.pp.ru on Thu, Oct 04, 2001 at 01:28:02PM +0400 Organization: The FreeBSD Project Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Andrey A. Chernov writes: > On Thu, Oct 04, 2001 at 12:16:40 +0300, Peter Pentchev wrote: > > + if ((len == 0) || !isspace(buf[len - 1])) { > > Must be isspace((unsigned char)....) Why and where can I find documentation about this? Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Sun Oct 7 10:51:59 2001 Delivered-To: freebsd-net@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 4E23A37B407; Sun, 7 Oct 2001 10:51:52 -0700 (PDT) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id TAA01668; Sun, 7 Oct 2001 19:51:50 +0200 (CEST) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Mike Barcroft Cc: "Andrey A. Chernov" , Peter Pentchev , freebsd-net@FreeBSD.ORG, freebsd-audit@FreeBSD.ORG Subject: Re: [CFR] whois(1) out-of-bound access patch References: <20011004121640.C1959@ringworld.oblivion.bg> <20011004132801.A64960@nagual.pp.ru> <20011007133716.C37270@coffee.q9media.com> From: Dag-Erling Smorgrav Date: 07 Oct 2001 19:51:48 +0200 In-Reply-To: <20011007133716.C37270@coffee.q9media.com> Message-ID: Lines: 16 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Mike Barcroft writes: > Andrey A. Chernov writes: > > On Thu, Oct 04, 2001 at 12:16:40 +0300, Peter Pentchev wrote: > > > + if ((len == 0) || !isspace(buf[len - 1])) { > > Must be isspace((unsigned char)....) > Why and where can I find documentation about this? If buf[len - 1] is a char (which is signed), non-ASCII characters will be sign-extended unless you cast to unsigned char. It so happens that it doesn't make any difference for isspace() because in the character sets we use, no space characters have the high bit set, but strictly speaking you still need the cast. DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Sun Oct 7 11:48:37 2001 Delivered-To: freebsd-net@freebsd.org Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by hub.freebsd.org (Postfix) with ESMTP id AFC6237B407; Sun, 7 Oct 2001 11:48:32 -0700 (PDT) Received: (from ache@localhost) by nagual.pp.ru (8.11.6/8.11.6) id f97ImT232303; Sun, 7 Oct 2001 22:48:29 +0400 (MSD) (envelope-from ache) Date: Sun, 7 Oct 2001 22:48:29 +0400 From: "Andrey A. Chernov" To: Mike Barcroft Cc: Peter Pentchev , freebsd-net@FreeBSD.ORG, freebsd-audit@FreeBSD.ORG Subject: Re: [CFR] whois(1) out-of-bound access patch Message-ID: <20011007224829.A32240@nagual.pp.ru> References: <20011004121640.C1959@ringworld.oblivion.bg> <20011004132801.A64960@nagual.pp.ru> <20011007133716.C37270@coffee.q9media.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011007133716.C37270@coffee.q9media.com> User-Agent: Mutt/1.3.21i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sun, Oct 07, 2001 at 13:37:16 -0400, Mike Barcroft wrote: > > > > Must be isspace((unsigned char)....) > > Why and where can I find documentation about this? isspace(3) -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Sun Oct 7 17:38:26 2001 Delivered-To: freebsd-net@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id E8A6437B409; Sun, 7 Oct 2001 17:38:14 -0700 (PDT) Received: (from mike@localhost) by coffee.q9media.com (8.11.6/8.11.6) id f980cqI44444; Sun, 7 Oct 2001 20:38:52 -0400 (EDT) (envelope-from mike) Date: Sun, 7 Oct 2001 20:38:52 -0400 From: Mike Barcroft To: "Todd C. Miller" Cc: Peter Pentchev , freebsd-net@FreeBSD.ORG, freebsd-audit@FreeBSD.ORG Subject: Final Patch for Review (was Re: [CFR] whois(1) out-of-bound access patch) Message-ID: <20011007203852.G37270@coffee.q9media.com> References: <20011004121640.C1959@ringworld.oblivion.bg> <20011004121933.B31795@coffee.q9media.com> <200110041650.f94GoL10010161@xerxes.courtesan.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200110041650.f94GoL10010161@xerxes.courtesan.com>; from Todd.Miller@courtesan.com on Thu, Oct 04, 2001 at 10:50:20AM -0600 Organization: The FreeBSD Project Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Todd C. Miller writes: > In message <20011004121933.B31795@coffee.q9media.com> > so spake Mike Barcroft (mike): > > > Would you please test the attached patch and confirm that it solves > > the problem? If it does, I'll commit it today. > > I doubt that is sufficient as "buf" is treated as a NUL terminated > string in the calls to strstr(). Also note that it is not necessary > to copy the buffer each time as in the original patch. You can > only get a line w/o a newline as the last line before EOF. After some discussion off the mailing list with Peter, I've come up with a total solution that is fairly elegant, but requires the new libc function strnstr(3) I posted earlier. Most of the patch is a cleanup of the current code. I'd appreciate reviews of this. I plan on committing it in a few days. The patch is at the end of this message and also at: http://people.FreeBSD.org/~mike/patches/whois.20011007.diff Best regards, Mike Barcroft ---------------------------------------------------------------------- whois.20011007.diff o Treat a buffer as a non-NUL terminated string, because the whois server may not return a new line character on the final line. o Remove the whois.networksolutions.com fallback code, which is no longer needed. o Instead of determining a hostname by terminating it when we see whitespace, only allow hostname characters and terminate the string when it's not such a character. o Add a small optimization in a for loop. PR: 30968 MFC after: 4 days Index: whois.c =================================================================== RCS file: /cvs/src/usr.bin/whois/whois.c,v retrieving revision 1.24 diff -u -r1.24 whois.c --- whois.c 5 Aug 2001 19:37:12 -0000 1.24 +++ whois.c 7 Oct 2001 21:38:04 -0000 @@ -71,11 +71,11 @@ #define SNICHOST "whois.6bone.net" #define DEFAULT_PORT "whois" #define WHOIS_SERVER_ID "Whois Server: " -#define NO_MATCH_ID "No match for \"" #define WHOIS_RECURSE 0x01 -#define WHOIS_INIC_FALLBACK 0x02 -#define WHOIS_QUICK 0x04 +#define WHOIS_QUICK 0x02 + +#define ishost(h) (isalnum((unsigned char)h) || h == '.' || h == '-') const char *ip_whois[] = { RNICHOST, PNICHOST, NULL }; const char *port = DEFAULT_PORT; @@ -164,7 +164,7 @@ use_qnichost = 1; host = NICHOST; if (!(flags & WHOIS_QUICK)) - flags |= WHOIS_INIC_FALLBACK | WHOIS_RECURSE; + flags |= WHOIS_RECURSE; } while (argc--) { if (country != NULL) { @@ -251,8 +251,8 @@ { FILE *sfi, *sfo; struct addrinfo *res2; - char *buf, *nhost, *p; - int i, nomatch, s; + char *buf, *host, *nhost, *p; + int i, s; size_t len; for (; res; res = res->ai_next) { @@ -273,45 +273,34 @@ fprintf(sfo, "%s\r\n", name); fflush(sfo); nhost = NULL; - nomatch = 0; while ((buf = fgetln(sfi, &len)) != NULL) { - while (len && isspace(buf[len - 1])) + while (len > 0 && isspace((unsigned char)buf[len - 1])) buf[--len] = '\0'; + printf("%.*s\n", (int)len, buf); if ((flags & WHOIS_RECURSE) && nhost == NULL) { - p = strstr(buf, WHOIS_SERVER_ID); - if (p != NULL) { - p += sizeof(WHOIS_SERVER_ID) - 1; - if ((len = strcspn(p, " \t\n\r")) != 0) { - s_asprintf(&nhost, "%s", p); + host = strnstr(buf, WHOIS_SERVER_ID, len); + if (host != NULL) { + host += sizeof(WHOIS_SERVER_ID) - 1; + for (p = host; p < buf + len; p++) { + if (!ishost(*p)) { + *p = '\0'; + break; + } } + s_asprintf(&nhost, "%.*s", + (int)(buf + len - host), host); } else { for (i = 0; ip_whois[i] != NULL; i++) { - if (strstr(buf, ip_whois[i]) == NULL) + if (strnstr(buf, ip_whois[i], len) == + NULL) continue; s_asprintf(&nhost, "%s", ip_whois[i]); + break; } } } - - if ((flags & WHOIS_INIC_FALLBACK) && nhost == NULL && - !nomatch && (p = strstr(buf, NO_MATCH_ID)) != NULL) { - p += sizeof(NO_MATCH_ID) - 1; - if ((len = strcspn(p, "\"")) && - strncasecmp(name, p, len) == 0 && - name[len] == '\0' && - strchr(name, '.') == NULL) - nomatch = 1; - } - printf("%s\n", buf); } - - /* Do second lookup as needed. */ - if (nomatch && nhost == NULL) { - printf("Looking up %s at %s.\n\n", name, INICHOST); - s_asprintf(&nhost, "%s", INICHOST); - } - if (nhost != NULL) { if ((res2 = gethostinfo(nhost, 0)) == NULL) { free(nhost); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Oct 8 0:32:24 2001 Delivered-To: freebsd-net@freebsd.org Received: from snark.rinet.ru (snark.rinet.ru [195.54.192.73]) by hub.freebsd.org (Postfix) with ESMTP id C72E337B405; Mon, 8 Oct 2001 00:32:17 -0700 (PDT) Received: (from yar@localhost) by snark.rinet.ru (8.11.6/8.11.6) id f987WE768678; Mon, 8 Oct 2001 11:32:14 +0400 (MSD) (envelope-from yar) Date: Mon, 8 Oct 2001 11:32:14 +0400 From: Yar Tikhiy To: net@freebsd.org, hackers@freebsd.org Subject: Some thoughts on if_ioctl() Message-ID: <20011008113214.A68390@snark.rinet.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.22.1i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi there, I'd like to discuss the following issues prior to modifying the kernel. First, the current implementation of the utility function ether_ioctl(), which can do good job common to ethernet drivers, won't indicate the situation when an ioctl command is unsupported by it. It will return 0 in this case. Wouldn't it be better to return EINVAL so the driver can do something about that? Now each driver using ether_ioctl() has to maintain painfully the list of the ioctl commands that may be passed to ether_ioctl(), or the kernel will be likely to panic in copyout() dereferencing a NULL pointer. Second, let's look at the handling of SIOCADDMULTI/SIOCDELMULTI. There is code obviously taken from if_loop.c and used in some drivers, which tries to do something with the third argument "data" of the if_ioctl() driver method if "data" isn't NULL. If I understand the kernel code right, if_ioctl()'s third argument is always NULL and serves nothing since these ioctl commands just notify the driver that the list of multicast groups on an interface has been changed. Is it true? If it is, I'd like to remove the questionable code and document the feature in ifnet(9) for newbie kernel hackers will be confused no longer. -- Yar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Oct 8 8: 4: 4 2001 Delivered-To: freebsd-net@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 5D92137B401; Mon, 8 Oct 2001 08:03:56 -0700 (PDT) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id f98F3tu02313; Mon, 8 Oct 2001 09:03:55 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost [127.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id f98F3s759159; Mon, 8 Oct 2001 09:03:54 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200110081503.f98F3s759159@harmony.village.org> To: Yar Tikhiy Subject: Re: Some thoughts on if_ioctl() Cc: net@FreeBSD.ORG, hackers@FreeBSD.ORG In-reply-to: Your message of "Mon, 08 Oct 2001 11:32:14 +0400." <20011008113214.A68390@snark.rinet.ru> References: <20011008113214.A68390@snark.rinet.ru> Date: Mon, 08 Oct 2001 09:03:54 -0600 From: Warner Losh Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In message <20011008113214.A68390@snark.rinet.ru> Yar Tikhiy writes: : First, the current implementation of the utility function : ether_ioctl(), which can do good job common to ethernet drivers, : won't indicate the situation when an ioctl command is unsupported : by it. It will return 0 in this case. Wouldn't it be better to : return EINVAL so the driver can do something about that? : Now each driver using ether_ioctl() has to maintain painfully the : list of the ioctl commands that may be passed to ether_ioctl(), or : the kernel will be likely to panic in copyout() dereferencing a : NULL pointer. Actaully, it should return ENOTTY rather than EINVAL. ENOTTY means that the ioctl isn't understood. I've had to fix several drivers at work that didn't follow this convention due to ignorance on the part of the driver writer. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Oct 8 8:18:36 2001 Delivered-To: freebsd-net@freebsd.org Received: from ussenterprise.ufp.org (ussenterprise.ufp.org [208.185.30.210]) by hub.freebsd.org (Postfix) with ESMTP id EC38237B405; Mon, 8 Oct 2001 08:18:29 -0700 (PDT) Received: (from bicknell@localhost) by ussenterprise.ufp.org (8.11.1/8.11.1) id f98FIQ100971; Mon, 8 Oct 2001 11:18:26 -0400 (EDT) (envelope-from bicknell) Date: Mon, 8 Oct 2001 11:18:26 -0400 From: Leo Bicknell To: Warner Losh Cc: Yar Tikhiy , net@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: Some thoughts on if_ioctl() Message-ID: <20011008111826.A887@ussenterprise.ufp.org> Mail-Followup-To: Leo Bicknell , Warner Losh , Yar Tikhiy , net@FreeBSD.ORG, hackers@FreeBSD.ORG References: <20011008113214.A68390@snark.rinet.ru> <200110081503.f98F3s759159@harmony.village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200110081503.f98F3s759159@harmony.village.org>; from imp@harmony.village.org on Mon, Oct 08, 2001 at 09:03:54AM -0600 Organization: United Federation of Planets Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, Oct 08, 2001 at 09:03:54AM -0600, Warner Losh wrote: > Actaully, it should return ENOTTY rather than EINVAL. ENOTTY means > that the ioctl isn't understood. I've had to fix several drivers at > work that didn't follow this convention due to ignorance on the part > of the driver writer. I was looking for a discussion about this, and insted came across a much older discussion than I remembered. :-) Unfortunately I can't find a threaded view, so here are some links. http://mail-index.netbsd.org/current-users/1994/07/12/0006.html http://mail-index.netbsd.org/current-users/1994/07/12/0014.html http://mail-index.netbsd.org/current-users/1994/07/12/0016.html http://mail-index.netbsd.org/current-users/1994/07/12/0018.html -- Leo Bicknell - bicknell@ufp.org Systems Engineer - Internetworking Engineer - CCIE 3440 Read TMBG List - tmbg-list-request@tmbg.org, www.tmbg.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Oct 8 11:53:37 2001 Delivered-To: freebsd-net@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id A234A37B407; Mon, 8 Oct 2001 11:53:33 -0700 (PDT) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.11.4/8.11.4) id f98IrWf39097; Mon, 8 Oct 2001 14:53:32 -0400 (EDT) (envelope-from wollman) Date: Mon, 8 Oct 2001 14:53:32 -0400 (EDT) From: Garrett Wollman Message-Id: <200110081853.f98IrWf39097@khavrinen.lcs.mit.edu> To: Yar Tikhiy Cc: net@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Some thoughts on if_ioctl() In-Reply-To: <20011008113214.A68390@snark.rinet.ru> References: <20011008113214.A68390@snark.rinet.ru> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org < said: > Second, let's look at the handling of SIOCADDMULTI/SIOCDELMULTI. > There is code obviously taken from if_loop.c and used in some > drivers, which tries to do something with the third argument "data" > of the if_ioctl() driver method if "data" isn't NULL. The historic implementation passed SIOCADDMULTI directly down to the interface to implement, which resulted in lots of duplicated code all over the place to manage the list of multicast addresses. Several years ago, I rewrote the multicast management code to simply indicate to the driver when the list has changed, obviating the need for the driver itself to manage the list. > If I understand the kernel code right, if_ioctl()'s third argument > is always NULL Not so. Any ioctl() in class 'i' which is not handled by the generic code will get passed down to the driver to handle; some of these requests may require the data pointer. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Oct 8 13:25: 8 2001 Delivered-To: freebsd-net@freebsd.org Received: from mail.tcoip.com.br (cerberus.tcoip.com.br [200.220.254.3]) by hub.freebsd.org (Postfix) with ESMTP id 35F6637B407 for ; Mon, 8 Oct 2001 13:25:02 -0700 (PDT) Received: from tcoip.com.br (w3ksxprt8h1oh05b@[192.168.60.194]) by mail.tcoip.com.br (8.11.1/8.11.1) with ESMTP id f98KOuN12593 for ; Mon, 8 Oct 2001 17:24:56 -0300 Message-ID: <3BC20B97.3060106@tcoip.com.br> Date: Mon, 08 Oct 2001 17:24:55 -0300 From: "Daniel C. Sobral" User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:0.9.4) Gecko/20010919 X-Accept-Language: en, pt-br, ja MIME-Version: 1.0 To: net@freebsd.org Subject: VLAN speed Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Why does vlans announce themselves as being 10 Mbits/s? I'm getting this from snmp on vlans that are attached to 100 Mbits/s cards. -- Daniel C. Sobral (8-DCS) Daniel.Sobral@tcoip.com.br dcs@newsguy.com dcs@freebsd.org capo@notorious.bsdconspiracy.net You cannot kill time without injuring eternity. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Oct 8 13:35:55 2001 Delivered-To: freebsd-net@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id B42C737B405; Mon, 8 Oct 2001 13:35:48 -0700 (PDT) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.6/8.11.5) with SMTP id f98KZVB98474; Mon, 8 Oct 2001 16:35:31 -0400 (EDT) (envelope-from robert@fledge.watson.org) Date: Mon, 8 Oct 2001 16:35:31 -0400 (EDT) From: Robert Watson X-Sender: robert@fledge.watson.org To: Terry Lambert Cc: hackers@freebsd.org, net@freebsd.org Subject: Re: IPSEC code error In-Reply-To: <3BBEC607.CC098104@mindspring.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I haven't reviewed that particular piece of code for correctness, but noticed that the caching of the privilege check there actually does cause problems for a variety of reasons in my work. I'd much rather individual uses of suser() appeared in the netinet6 tree, and that appropriate context for the check was passed down the stack to where the knowledge of privilege is needed, rather than just the flag. Sometime, I'll get around to some diffs. Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services On Sat, 6 Oct 2001, Terry Lambert wrote: > On a related topic, there appears to be a code error in the > IPSEC code. > > Specifically, the priv flag is set to 1 if the user is root > and the socket is non-null (this lets the code be called > from the bridging code as well, so ignore the first half of > the "if" test, and concentrate on the "uid == 0" test). > > In the code that examines this flag, the comment is that it > is looking at whether or not the port is a priviledged port, > not whether or not the user who owns it is root. > > This implies that the "rootness" check improperly flags any > ports opened by root, regardless of whether or not they are > priviledged ports. > > Is the code where the flag is initialized correct, or is the > comment where the flag is observed correct? > > -- Terry > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Oct 8 17:46:29 2001 Delivered-To: freebsd-net@freebsd.org Received: from holly.dyndns.org (adsl-208-191-149-224.dsl.hstntx.swbell.net [208.191.149.224]) by hub.freebsd.org (Postfix) with ESMTP id 38B1837B406; Mon, 8 Oct 2001 17:46:23 -0700 (PDT) Received: (from chris@localhost) by holly.dyndns.org (8.11.6/8.9.3) id f990krF06222; Mon, 8 Oct 2001 19:46:54 -0500 (CDT) (envelope-from chris) Date: Mon, 8 Oct 2001 19:46:43 -0500 From: Chris Costello To: Mike Barcroft Cc: "Todd C. Miller" , Peter Pentchev , freebsd-net@FreeBSD.ORG, freebsd-audit@FreeBSD.ORG Subject: Re: Final Patch for Review (was Re: [CFR] whois(1) out-of-bound access patch) Message-ID: <20011008194642.A696@holly.calldei.com> Reply-To: chris@FreeBSD.ORG References: <20011004121640.C1959@ringworld.oblivion.bg> <20011004121933.B31795@coffee.q9media.com> <200110041650.f94GoL10010161@xerxes.courtesan.com> <20011007203852.G37270@coffee.q9media.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011007203852.G37270@coffee.q9media.com>; from mike@FreeBSD.ORG on Sun, Oct 07, 2001 at 08:38:52PM -0400 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sunday, October 07, 2001, Mike Barcroft wrote: > for (i = 0; ip_whois[i] != NULL; i++) { > - if (strstr(buf, ip_whois[i]) == NULL) > + if (strnstr(buf, ip_whois[i], len) == > + NULL) > continue; > s_asprintf(&nhost, "%s", ip_whois[i]); > + break; Should be for (i = 0; ip_whois[i] != NULL; i++) { if (strnstr(buf, ip_whois[i]) != NULL) { s_asprintf(&nhost, "%s", ip_whois[i]); break; } } for simplicity's sake. -- +-------------------+------------------------------------------+ | Chris Costello | To iterate is human; to recurse, divine. | | chris@FreeBSD.org | | +-------------------+------------------------------------------+ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Oct 8 23:15:13 2001 Delivered-To: freebsd-net@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 23E0737B403; Mon, 8 Oct 2001 23:15:07 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id QAA25502; Tue, 9 Oct 2001 16:14:58 +1000 Date: Tue, 9 Oct 2001 16:14:14 +1000 (EST) From: Bruce Evans X-X-Sender: To: Warner Losh Cc: Yar Tikhiy , , Subject: Re: Some thoughts on if_ioctl() In-Reply-To: <200110081503.f98F3s759159@harmony.village.org> Message-ID: <20011009155802.A23072-100000@delplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, 8 Oct 2001, Warner Losh wrote: > In message <20011008113214.A68390@snark.rinet.ru> Yar Tikhiy writes: > : First, the current implementation of the utility function > : ether_ioctl(), which can do good job common to ethernet drivers, > : won't indicate the situation when an ioctl command is unsupported > : by it. It will return 0 in this case. Wouldn't it be better to > : return EINVAL so the driver can do something about that? > : Now each driver using ether_ioctl() has to maintain painfully the > : list of the ioctl commands that may be passed to ether_ioctl(), or > : the kernel will be likely to panic in copyout() dereferencing a > : NULL pointer. > > Actaully, it should return ENOTTY rather than EINVAL. ENOTTY means > that the ioctl isn't understood. I've had to fix several drivers at > work that didn't follow this convention due to ignorance on the part > of the driver writer. Actually, it should return ENOIOCTL rather than ENOTTY or EINVAL. ENOTTY means that the ioctl _is_ understood by the current layer, but the operation is not supported for the current device type. ENOIOCTL means that current layer doesn't handle this ioctl at all, at least for the current device type. I introduced this error code to disambiguate it from ERESTART. It is only currently used for disk and tty ioctls AFAIK. In 4.4BSD, it was hard-coded as -1 and used only for tty ioctls AFAIK. -1 conflicted with ERESTART, and the conflict caused breakage for at least disk ioctls. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Mon Oct 8 23:26:48 2001 Delivered-To: freebsd-net@freebsd.org Received: from coconut.itojun.org (coconut.itojun.org [210.160.95.97]) by hub.freebsd.org (Postfix) with ESMTP id 26D1D37B401; Mon, 8 Oct 2001 23:26:42 -0700 (PDT) Received: from itojun.org (localhost [127.0.0.1]) by coconut.itojun.org (Postfix) with ESMTP id 1F5FE4B22; Tue, 9 Oct 2001 15:26:36 +0900 (JST) To: Shoichi Sakane Cc: core@kame.net Cc: hackers@freebsd.org, net@freebsd.org In-reply-to: sakane's message of Tue, 09 Oct 2001 15:21:30 +0900. <20011009152130C.sakane@kame.net> X-Template-Reply-To: itojun@itojun.org X-Template-Return-Receipt-To: itojun@itojun.org X-PGP-Fingerprint: F8 24 B4 2C 8C 98 57 FD 90 5F B4 60 79 54 16 E2 Subject: Re: kame ipsec policy From: itojun@iijlab.net Date: Tue, 09 Oct 2001 15:26:36 +0900 Message-ID: <3958.1002608796@itojun.org> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >> On a related topic, there appears to be a code error in the >> IPSEC code. >> >> Specifically, the priv flag is set to 1 if the user is root >> and the socket is non-null (this lets the code be called >> from the bridging code as well, so ignore the first half of >> the "if" test, and concentrate on the "uid == 0" test). >> >> In the code that examines this flag, the comment is that it >> is looking at whether or not the port is a priviledged port, >> not whether or not the user who owns it is root. >> >> This implies that the "rootness" check improperly flags any >> ports opened by root, regardless of whether or not they are >> priviledged ports. no, i guess you got something wrong. "uid == 0" check is used in ipsec code to control the behavior of policy lookups. it has nothing to do with "privileged port" (port number < 1024). if you need more discussions you'd need to specify the line numberes for the code you are worrying about. itojun To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Oct 9 9: 5:42 2001 Delivered-To: freebsd-net@freebsd.org Received: from cluttered.com (w024.z064002058.sjc-ca.dsl.cnc.net [64.2.58.24]) by hub.freebsd.org (Postfix) with ESMTP id 9C6D837B408; Tue, 9 Oct 2001 09:05:34 -0700 (PDT) Received: from orgasmotron.cluttered.com (jsd [10.10.10.3]) by cluttered.com (Postfix) with ESMTP id 2FA5CC984E; Tue, 9 Oct 2001 09:05:36 -0700 (PDT) Message-Id: <4.3.2.7.2.20011009085651.00b4a2e8@10.10.10.1> X-Sender: jsd@10.10.10.1 X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Tue, 09 Oct 2001 09:05:05 -0700 To: freebsd-net@freebsd.org, freebsd-questions@freebsd.org From: Jon Drukman Subject: 4.4-R: need to ifconfig/route twice to use net Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I just did a totally fresh install of 4.4-RELEASE on a brand new machine - totally blank unpartitioned hard disks. The installation appeared to go smoothly until I got to the "set root password" phase, at which point the installer hung. I aborted out of that and booted up from the new install. It all seems complete except for one extremely bizarre problem. The machine boots up normally, goes through the rc scripts fine, but cannot access the network at all. I can ping my own IP and localhost, but not the gateway IP, or anything else on the local net (and of course the internet). ifconfig -a and netstat -rn produce: Destination Gateway Flags Refs Use Netif Expire default 10.10.10.1 UGSc 0 0 sis0 10.10.10/24 link#1 UC 1 0 sis0 10.10.10.1 link#1 UHLW 1 0 sis0 127.0.0.1 127.0.0.1 UH 0 0 lo0 sis0: flags=8843 mtu 1500 inet 10.10.10.24 netmask 0xffffff00 broadcast 10.10.10.255 ether 00:d0:09:fb:8d:0c media: Ethernet 10baseT/UTP (none) status: active lo0: flags=8049 mtu 16384 inet 127.0.0.1 netmask 0xff000000 i recompiled a new kernel without ipv6 just to be on the safe side, but this problem is exactly the same with both the GENERIC kernel and my own. now the really weird part is, if i just issue the ifconfig and route commands again, it all works perfectly. # ifconfig sis0 inet 10.10.10.24 netmask 0xffffff00 media 10baseT/UTP mediaopt full-duplex # route add default 10.10.10.1 the output from ifconfig & netstat now looks like this: Destination Gateway Flags Refs Use Netif Expire default 10.10.10.1 UGSc 1 2 sis0 10.10.10/24 link#1 UC 1 0 sis0 10.10.10.1 0:e0:29:73:ee:11 UHLW 2 14 sis0 1028 127.0.0.1 127.0.0.1 UH 0 0 lo0 sis0: flags=8843 mtu 1500 inet 10.10.10.24 netmask 0xffffff00 broadcast 10.10.10.255 ether 00:d0:09:fb:8d:0c media: Ethernet 10baseT/UTP status: active lo0: flags=8049 mtu 16384 inet 127.0.0.1 netmask 0xff000000 i diff'd the two and the only things i find are the new mac address for 10.10.10.1 in the routing table (understandable) and the "(none)" on the end of sis0's media line is gone. i'm cc'ing net thinking that maybe this is some kind of weird sis-driver bug, maybe because i'm using 10baseT instead of 100baseT? oh yeah, my rc.conf file is: sshd_enable="YES" hostname="db.gamespot.com" ifconfig_sis0="inet 10.10.10.24 netmask 255.255.255.0 media 10BaseT/UTP mediaopt full-duplex" defaultrouter="10.10.10.1" sendmail_enable="NO" any ideas? this machine has to go into a colo soon so it really needs to be able to get on the net on its own from a cold boot! thanks! -jsd- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Oct 9 13:55:46 2001 Delivered-To: freebsd-net@freebsd.org Received: from wren.cs.unc.edu (wren.cs.unc.edu [152.2.128.86]) by hub.freebsd.org (Postfix) with ESMTP id E83FC37B409 for ; Tue, 9 Oct 2001 13:55:39 -0700 (PDT) Received: from le-cs.cs.unc.edu (IDENT:le@le-cs.cs.unc.edu [152.2.131.150]) by wren.cs.unc.edu (8.9.3/8.9.3) with ESMTP id QAA22318 for ; Tue, 9 Oct 2001 16:55:36 -0400 (EDT) Date: Tue, 9 Oct 2001 16:55:36 -0400 (EDT) From: Nguyen-Tuong Long Le To: Subject: Connect(2) problem Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi all, I have a software that simulates web clients and servers to create network congestion (for the purpose of doing research in network congestion). In our experiment, a client opens an HTTP connection to a server, fetches a number of objects, and then closes the connection. A problem I seem to have right now is that a client machine cannot simulate more than 3000 connections. When my client machine simulates more than 3000 connections, it's able to open a socket but then connect(2) fails with errno 35 (Resource temporarily unavailable). Another interesting notice is that the connect(2) system call blocks for a few miliseconds before it fails although fcntl(2) was used to make the socket non-blocking. The OS version I am using is FreeBSD 4.3-release. I used sysctl to bump up kern.maxfiles and kern.maxfilesperproc to 16384. I also bumped up kern.ipc.somaxconn to 8192 on the server side. I recompiled the kernel with option NMBCLUSTERS=65536 to increase the number of mbufs. I guess that CPU is not the bottleneck since I have the same problem regardless whether I use a 300 MHz or a 1 GHz machine. Does anyone have any suggestion what kind of resources my client machine runs out and how I can fix it? Thanks, Long P.S. Please kindly email your reply to me since I am not on the list. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Oct 9 13:56:39 2001 Delivered-To: freebsd-net@freebsd.org Received: from smtp1.sentex.ca (smtp1.sentex.ca [199.212.134.4]) by hub.freebsd.org (Postfix) with ESMTP id B9A2C37B401 for ; Tue, 9 Oct 2001 13:56:36 -0700 (PDT) Received: from simoeon.sentex.net (pyroxene.sentex.ca [199.212.134.18]) by smtp1.sentex.ca (8.11.6/8.11.6) with ESMTP id f99KuZR40845 for ; Tue, 9 Oct 2001 16:56:35 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <5.1.0.14.0.20011009164757.036f5080@marble.sentex.ca> X-Sender: mdtpop@marble.sentex.ca X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Tue, 09 Oct 2001 16:50:39 -0400 To: freebsd-net@freebsd.org From: Mike Tancsa Subject: strange side effect of net.inet.ip.fastforwarding: 1 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org When enabling this, I found that my kernel logs were full of all sorts of arplookup xxx.yyy.zzz.aaa failed: host is not on local network. The strange this is that, that is correct, they are NOT on my local network and never have been. So, why would the box suddenly think, seemingly random networks would be local to my machine. Note, the box is running bgp with a full view (110,000+ routes). Any idea why this would be the case ? A bug ? An effect of a cache lookup/miss? ---Mike -------------------------------------------------------------------- Mike Tancsa, tel +1 519 651 3400 Sentex Communications, mike@sentex.net Providing Internet since 1994 www.sentex.net Cambridge, Ontario Canada www.sentex.net/mike To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Oct 9 14: 0:20 2001 Delivered-To: freebsd-net@freebsd.org Received: from iguana.aciri.org (iguana.aciri.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id CE0BE37B408 for ; Tue, 9 Oct 2001 14:00:15 -0700 (PDT) Received: (from rizzo@localhost) by iguana.aciri.org (8.11.3/8.11.1) id f99Kv5k94419; Tue, 9 Oct 2001 13:57:05 -0700 (PDT) (envelope-from rizzo) From: Luigi Rizzo Message-Id: <200110092057.f99Kv5k94419@iguana.aciri.org> Subject: Re: strange side effect of net.inet.ip.fastforwarding: 1 In-Reply-To: <5.1.0.14.0.20011009164757.036f5080@marble.sentex.ca> from Mike Tancsa at "Oct 9, 2001 4:50:39 pm" To: mike@sentex.net (Mike Tancsa) Date: Tue, 9 Oct 2001 13:57:05 -0700 (PDT) Cc: freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > > When enabling this, I found that my kernel logs were full of all sorts of > > arplookup xxx.yyy.zzz.aaa failed: host is not on local network. > > The strange this is that, that is correct, they are NOT on my local network > and never have been. So, why would the box suddenly think, seemingly > random networks would be local to my machine. Note, the box is running bgp > with a full view (110,000+ routes). > Any idea why this would be the case ? A bug ? An effect of a cache > lookup/miss? requests are being normally filtered by the firewall somehow ? (i know, arp is not ip, so they should get through anyways...) cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Oct 9 14: 5:38 2001 Delivered-To: freebsd-net@freebsd.org Received: from smtp1.sentex.ca (smtp1.sentex.ca [199.212.134.4]) by hub.freebsd.org (Postfix) with ESMTP id 3774B37B406 for ; Tue, 9 Oct 2001 14:05:34 -0700 (PDT) Received: from simoeon.sentex.net (pyroxene.sentex.ca [199.212.134.18]) by smtp1.sentex.ca (8.11.6/8.11.6) with ESMTP id f99L5W742016; Tue, 9 Oct 2001 17:05:32 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <5.1.0.14.0.20011009165532.0368b110@marble.sentex.ca> X-Sender: mdtpop@marble.sentex.ca X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Tue, 09 Oct 2001 16:59:36 -0400 To: Luigi Rizzo From: Mike Tancsa Subject: Re: strange side effect of net.inet.ip.fastforwarding: 1 Cc: freebsd-net@FreeBSD.ORG In-Reply-To: <200110092057.f99Kv5k94419@iguana.aciri.org> References: <5.1.0.14.0.20011009164757.036f5080@marble.sentex.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org At 01:57 PM 10/9/01 -0700, Luigi Rizzo wrote: > > > > When enabling this, I found that my kernel logs were full of all sorts of > > > > arplookup xxx.yyy.zzz.aaa failed: host is not on local network. > > Any idea why this would be the case ? A bug ? An effect of a cache > > lookup/miss? > >requests are being normally filtered by the firewall somehow ? >(i know, arp is not ip, so they should get through anyways...) This was on a box that had a regular set of OPEN rules. i.e. 00100 allow ip from any to any via lo0 00200 deny ip from any to 127.0.0.0/8 65000 allow ip from any to any 65535 deny ip from any to any Also, in terms of queue drops, the fastforwarding did make a small difference, but I still am seeing a series of drops somewhere between 5 and 10min. If you think it would be useful to track down to see if it is exactly some interval, I can do so. ---Mike To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Oct 9 14:25: 6 2001 Delivered-To: freebsd-net@freebsd.org Received: from measurement-factory.com (measurement-factory.com [206.168.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 59AFA37B412 for ; Tue, 9 Oct 2001 14:24:50 -0700 (PDT) Received: (from rousskov@localhost) by measurement-factory.com (8.9.3/8.9.3) id PAA40949; Tue, 9 Oct 2001 15:24:38 -0600 (MDT) (envelope-from rousskov) Date: Tue, 9 Oct 2001 15:24:38 -0600 (MDT) From: Alex Rousskov To: Nguyen-Tuong Long Le Cc: freebsd-net@FreeBSD.ORG Subject: Re: Connect(2) problem In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Are you running out of ephemeral ports? See net.inet.ip.portrange sysctl or do your own port management. Alex. On Tue, 9 Oct 2001, Nguyen-Tuong Long Le wrote: > Hi all, > > I have a software that simulates web clients and servers to create > network congestion (for the purpose of doing research in network > congestion). In our experiment, a client opens an HTTP connection > to a server, fetches a number of objects, and then closes the > connection. A problem I seem to have right now is that a client > machine cannot simulate more than 3000 connections. When my client > machine simulates more than 3000 connections, it's able to open > a socket but then connect(2) fails with errno 35 (Resource > temporarily unavailable). Another interesting notice is that the > connect(2) system call blocks for a few miliseconds before it > fails although fcntl(2) was used to make the socket non-blocking. > The OS version I am using is FreeBSD 4.3-release. > > I used sysctl to bump up kern.maxfiles and kern.maxfilesperproc to > 16384. I also bumped up kern.ipc.somaxconn to 8192 on the server > side. I recompiled the kernel with option NMBCLUSTERS=65536 to > increase the number of mbufs. I guess that CPU is not the bottleneck > since I have the same problem regardless whether I use a 300 MHz or > a 1 GHz machine. > > Does anyone have any suggestion what kind of resources my client machine > runs out and how I can fix it? > > Thanks, > Long > > P.S. Please kindly email your reply to me since I am not on the list. > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Tue Oct 9 22:19:15 2001 Delivered-To: freebsd-net@freebsd.org Received: from mail-blue.research.att.com (mail-blue.research.att.com [135.207.30.102]) by hub.freebsd.org (Postfix) with ESMTP id 14BB537B401 for ; Tue, 9 Oct 2001 22:19:12 -0700 (PDT) Received: from alliance.research.att.com (alliance.research.att.com [135.207.26.26]) by mail-blue.research.att.com (Postfix) with ESMTP id 4F43B4CE34; Wed, 10 Oct 2001 01:19:11 -0400 (EDT) Received: from windsor.research.att.com (windsor.research.att.com [135.207.26.46]) by alliance.research.att.com (8.8.7/8.8.7) with ESMTP id BAA18235; Wed, 10 Oct 2001 01:19:10 -0400 (EDT) From: Bill Fenner Received: (from fenner@localhost) by windsor.research.att.com (8.8.8+Sun/8.8.5) id WAA03152; Tue, 9 Oct 2001 22:19:10 -0700 (PDT) Message-Id: <200110100519.WAA03152@windsor.research.att.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII To: daniel.sobral@tcoip.com.br Subject: Re: VLAN speed Cc: net@freebsd.org Date: Tue, 9 Oct 2001 22:19:09 -0700 Versions: dmail (solaris) 2.2j/makemail 2.9b Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Why does vlans announce themselves as being 10 Mbits/s? I'm getting this >from snmp on vlans that are attached to 100 Mbits/s cards. Because if_vlan.c calls ether_ifattach() without setting ifp->if_baudrate? I think "0" would be the most accurate value to return; if you really want to know the parent's ifSpeed you could [implement the ifStackTable and then] use the ifStackTable to find it. (ifSpeed says "For a sub-layer which has no concept of bandwidth, this object should be zero." I'd argue that this describes VLAN interfaces.) Bill To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 2:35:59 2001 Delivered-To: freebsd-net@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id AA3D237B407; Wed, 10 Oct 2001 02:35:55 -0700 (PDT) Received: from blossom.cjclark.org (dialup-209.245.138.251.Dial1.SanJose1.Level3.net [209.245.138.251]) by albatross.prod.itd.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id CAA20290; Wed, 10 Oct 2001 02:35:52 -0700 (PDT) Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.3) id f9A9Zmx03199; Wed, 10 Oct 2001 02:35:48 -0700 (PDT) (envelope-from cjc) Date: Wed, 10 Oct 2001 02:35:47 -0700 From: "Crist J. Clark" To: Tim Burgess Cc: freebsd-gnats-submit@FreeBSD.ORG, freebsd-net@FreeBSD.ORG Subject: Re: kern/31130: ipfw tee functionality causes malfunction and security hole Message-ID: <20011010023547.I387@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <200110090920.f999K2X17814@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200110090920.f999K2X17814@freefall.freebsd.org>; from cristjc@earthlink.net on Tue, Oct 09, 2001 at 02:20:02AM -0700 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Tue, Oct 09, 2001 at 02:20:02AM -0700, Crist J. Clark wrote: [snip] > On the wire and the packets never get routed to the "real" 172.16.0.1. > Trying to figure out if, > > a) This is the expected behavior, but is poorly documented, or > b) Something is broken. > > I'm thinking (b), but still wading through src/sys/netinet to verify. Well, I see why this happens, but still not sure if it is supposed to happen. If we look at src/sys/netinet/ip_input.c, we see that all diverted or teed packets are accepted by the host as destined for itself, #ifdef IPDIVERT if (i != 0 && (i & IP_FW_PORT_DYNT_FLAG) == 0) { /* Divert or tee packet */ divert_info = i; goto ours; } #endif The packets are clearly going to be processed by the gateway. You seem to have already found this in the code snipped in your original PR, but I didn't notice your change. Please post changes to code as unified diffs. I now understand the 'fix' you were talking about. Have you actually built a kernel with your modifications? Does it seem to work? But packets _leaving_ the system seem to be processed as one would expect. That is, a copy is divert(4)ed and then the packet heads out onto to the wire. This apparent inconsistency is a bug since it is either unintended behavior or at least undocumented behavior. But the inconsistency gives you a temporary workaround. Instead of, 600 tee 8665 ip from any to any in Does, 600 tee 8665 ip from any to any out Work as you would expect? -- Crist J. Clark cjclark@alum.mit.edu cjclark@jhu.edu cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 4:25:47 2001 Delivered-To: freebsd-net@freebsd.org Received: from smtp1.oskarmobil.cz (smtp1.oskarmobil.cz [217.77.161.133]) by hub.freebsd.org (Postfix) with ESMTP id C9DB037B403 for ; Wed, 10 Oct 2001 04:25:43 -0700 (PDT) Received: from wh01ex01.ceskymobil.cz (wh01ex01.oskarmobil.cz [172.20.116.17]) by smtp1.oskarmobil.cz (8.11.2/8.11.1) with ESMTP id f9ABMFV29283 for ; Wed, 10 Oct 2001 13:22:16 +0200 (CEST) (envelope-from Milon.Papezik@oskarmobil.cz) Received: by wh01ex01.oskarmobil.cz with Internet Mail Service (5.5.2653.19) id ; Wed, 10 Oct 2001 13:23:15 +0200 Message-ID: From: Milon Papezik To: net@freebsd.org Subject: Link re-negotiation on tl0 after Cisco 35xx reboot Date: Wed, 10 Oct 2001 13:23:12 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="ISO-8859-2" Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi all, I just came accross and interesting problem - with autnegotiation (re-negotiation?). I have Compaq 1850R with 'tl' interface (FreeBSD 4.4R) and Sun Netra connected to Cisco switch 35xx. I use link auto-negotiation on both sides for both hosts. Ater reset of Cisco switch and also after power cycling the switch: - Sun seems to be happy. - Compaq with FreeBSD the tl0 interface accepts ARP requests from other hosts - Compaq host sends ARP reply (as seen with tcpdum on tl0) - switch sees the packed with CRC error - this setup works perfectly for both Sun and NT, (which puts me into position of envagelist of _no-go_ platform :-((( It seems that the link is not re-negotiated(?). I went through sources and there are some changes in CURRENT introducing link_changed method/callback, but it doen not not seem to be directly related (and it's not in RELEASE). Any hints or pointers ? Thanks in advance, Milon -- milon.papezik@oskarmobil.cz To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 7:40:51 2001 Delivered-To: freebsd-net@freebsd.org Received: from ada.snu.ac.kr (ada.snu.ac.kr [147.46.106.49]) by hub.freebsd.org (Postfix) with ESMTP id 690CF37B409 for ; Wed, 10 Oct 2001 07:40:42 -0700 (PDT) Received: (from redjade@localhost) by ada.snu.ac.kr (8.11.6/8.11.3) id f9AEedv02197 for freebsd-net@freebsd.org; Wed, 10 Oct 2001 23:40:39 +0900 (KST) (envelope-from redjade) Date: Wed, 10 Oct 2001 23:40:39 +0900 From: Kim Kyung-hwan To: freebsd-net@freebsd.org Subject: Getting link level addr using SIOCGIFADDR Message-ID: <20011010234039.A2120@ada.snu.ac.kr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hello, In most case of printing (ethernet) link level address, program does a SIOCGIFCONF ioctl, gets a ifconf structure(the whole interface list), finds the very interface and prints the address. What I want to is to use SIOCGIFADDR so that program finds the address. My program does 1) get a socket (AF_INET) 2) make appropriate ifreq structure; copy interface name and set sa_family to AF_LINK 3) SIOCGIFADDR ioctl But returned ifreq structure doesn't have sockaddr_dl structure. It is impossible to get link level address using SIOCGIFADDR? Regards, Kyunghwan KIM To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 8:33:11 2001 Delivered-To: freebsd-net@freebsd.org Received: from snark.rinet.ru (snark.rinet.ru [195.54.192.73]) by hub.freebsd.org (Postfix) with ESMTP id C16E637B405; Wed, 10 Oct 2001 08:33:03 -0700 (PDT) Received: (from yar@localhost) by snark.rinet.ru (8.11.6/8.11.6) id f9AFWuT64862; Wed, 10 Oct 2001 19:32:56 +0400 (MSD) (envelope-from yar) Date: Wed, 10 Oct 2001 19:32:56 +0400 From: Yar Tikhiy To: Garrett Wollman Cc: net@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: Some thoughts on if_ioctl() Message-ID: <20011010193256.A64375@snark.rinet.ru> References: <20011008113214.A68390@snark.rinet.ru> <200110081853.f98IrWf39097@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200110081853.f98IrWf39097@khavrinen.lcs.mit.edu> User-Agent: Mutt/1.3.22.1i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Mon, Oct 08, 2001 at 02:53:32PM -0400, Garrett Wollman wrote: > < said: > > > Second, let's look at the handling of SIOCADDMULTI/SIOCDELMULTI. > > There is code obviously taken from if_loop.c and used in some > > drivers, which tries to do something with the third argument "data" > > of the if_ioctl() driver method if "data" isn't NULL. > > The historic implementation passed SIOCADDMULTI directly down to the > interface to implement, which resulted in lots of duplicated code all > over the place to manage the list of multicast addresses. Several > years ago, I rewrote the multicast management code to simply indicate > to the driver when the list has changed, obviating the need for the > driver itself to manage the list. > > > If I understand the kernel code right, if_ioctl()'s third argument > > is always NULL > > Not so. Any ioctl() in class 'i' which is not handled by the generic > code will get passed down to the driver to handle; some of these > requests may require the data pointer. Sorry, I wrote an unclear phrase. I implied not all possible ioctl(2) requests, but only the SIOC{ADD|DEL}MULTI case. In that case, "data" seems to be always NULL since it's the way if_addmulti() and if_delmulti() call ifp->if_ioctl(), and there is no other way to pass SIOC{ADD|DEL}MULTI to a driver's if_ioctl(). If it's true, all the old ugly code about AF_INET and AF_INET6 multicast groups may be safely removed from the interface drivers. All the interface drivers will fall into two categories: - those which may simply do nothing on these requests (if_loop, if_sl...) - those which will rebuild some sort of a hardware multicast filter. -- Yar To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 8:46:55 2001 Delivered-To: freebsd-net@freebsd.org Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by hub.freebsd.org (Postfix) with ESMTP id 65C1237B405 for ; Wed, 10 Oct 2001 08:46:46 -0700 (PDT) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id f9AFkd805323; Wed, 10 Oct 2001 08:46:39 -0700 (PDT) (envelope-from jdp@wall.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.11.6/8.11.0) id f9AFkcd86407; Wed, 10 Oct 2001 08:46:38 -0700 (PDT) (envelope-from jdp) Date: Wed, 10 Oct 2001 08:46:38 -0700 (PDT) Message-Id: <200110101546.f9AFkcd86407@vashon.polstra.com> To: net@freebsd.org From: John Polstra Cc: le@cs.unc.edu Subject: Re: Connect(2) problem In-Reply-To: References: Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In article , Nguyen-Tuong Long Le wrote: > > I have a software that simulates web clients and servers to create > network congestion (for the purpose of doing research in network > congestion). In our experiment, a client opens an HTTP connection > to a server, fetches a number of objects, and then closes the > connection. A problem I seem to have right now is that a client > machine cannot simulate more than 3000 connections. When my client > machine simulates more than 3000 connections, it's able to open > a socket but then connect(2) fails with errno 35 (Resource > temporarily unavailable). Another interesting notice is that the > connect(2) system call blocks for a few miliseconds before it > fails although fcntl(2) was used to make the socket non-blocking. > The OS version I am using is FreeBSD 4.3-release. In addition to the suggestion from Alex Rousskov, adding these lines to "/boot/loader.conf" may help: kern.ipc.maxsockets="8192" kern.ipc.nmbclusters="32768" John -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 9:12:38 2001 Delivered-To: freebsd-net@freebsd.org Received: from hotmail.com (oe53.law14.hotmail.com [64.4.20.46]) by hub.freebsd.org (Postfix) with ESMTP id 2408C37B405 for ; Wed, 10 Oct 2001 09:12:34 -0700 (PDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 10 Oct 2001 09:12:30 -0700 X-Originating-IP: [130.85.20.10] From: "Aihua Guo" To: Subject: Trying to find out which interface an IP packet is coming from in ip_output() routine Date: Wed, 10 Oct 2001 12:12:29 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00F6_01C15184.D539C330" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: X-OriginalArrivalTime: 10 Oct 2001 16:12:30.0530 (UTC) FILETIME=[5CBB8A20:01C151A6] Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org This is a multi-part message in MIME format. ------=_NextPart_000_00F6_01C15184.D539C330 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, =20 Can anybody help me find a way to find out which interface an IP = packet is coming from in ip_output()/ip_input() routine? You help is = greatly appreciated. Thks a lot! Aihua Guo ------=_NextPart_000_00F6_01C15184.D539C330 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
  
   Can anybody help = me find=20 a way to find out which interface an IP packet is coming = from in=20 ip_output()/ip_input() routine?  You help is greatly appreciated. = Thks a=20 lot!
 
 Aihua = Guo
------=_NextPart_000_00F6_01C15184.D539C330-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 9:18:38 2001 Delivered-To: freebsd-net@freebsd.org Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by hub.freebsd.org (Postfix) with ESMTP id EF31237B407 for ; Wed, 10 Oct 2001 09:18:34 -0700 (PDT) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.11.3/8.11.3) with ESMTP id f9AGIW805515; Wed, 10 Oct 2001 09:18:32 -0700 (PDT) (envelope-from jdp@wall.polstra.com) Received: (from jdp@localhost) by vashon.polstra.com (8.11.6/8.11.0) id f9AGIVA86599; Wed, 10 Oct 2001 09:18:31 -0700 (PDT) (envelope-from jdp) Date: Wed, 10 Oct 2001 09:18:31 -0700 (PDT) Message-Id: <200110101618.f9AGIVA86599@vashon.polstra.com> To: net@freebsd.org From: John Polstra Cc: aihguo1@hotmail.com Subject: Re: Trying to find out which interface an IP packet is coming from in ip_output() routine In-Reply-To: References: Organization: Polstra & Co., Seattle, WA Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org In article , Aihua Guo wrote: > Can anybody help me find a way to find out which interface an IP > packet is coming from in ip_output()/ip_input() routine? The mb->m_pkthdr.rcvif field of the mbuf points to the interface on which the packet was received. John -- John Polstra John D. Polstra & Co., Inc. Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 9:59:42 2001 Delivered-To: freebsd-net@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 05F6537B409 for ; Wed, 10 Oct 2001 09:59:29 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.6/8.11.2) id f9AGwaq66858; Wed, 10 Oct 2001 19:58:36 +0300 (EEST) (envelope-from ru) Date: Wed, 10 Oct 2001 19:58:36 +0300 From: Ruslan Ermilov To: Kim Kyung-hwan Cc: freebsd-net@FreeBSD.ORG Subject: Re: Getting link level addr using SIOCGIFADDR Message-ID: <20011010195836.A63046@sunbay.com> References: <20011010234039.A2120@ada.snu.ac.kr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011010234039.A2120@ada.snu.ac.kr>; from redjade@ada.snu.ac.kr on Wed, Oct 10, 2001 at 11:40:39PM +0900 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, Oct 10, 2001 at 11:40:39PM +0900, Kim Kyung-hwan wrote: > Hello, > > In most case of printing (ethernet) link level address, > program does a SIOCGIFCONF ioctl, gets a ifconf structure(the whole > interface list), finds the very interface and prints the address. > What I want to is to use SIOCGIFADDR so that program finds the > address. > > My program does > 1) get a socket (AF_INET) > 2) make appropriate ifreq structure; > copy interface name and set sa_family to AF_LINK > 3) SIOCGIFADDR ioctl > > But returned ifreq structure doesn't have sockaddr_dl structure. > It is impossible to get link level address using SIOCGIFADDR? > Nope, not possible. But this could be done with CTL_NET.PF_ROUTE.NET_RT_IFLIST sysctl(3), by setting the fourth level to AF_LINK. See lib/libc/net/getifaddrs.c for a working example. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 10:20:56 2001 Delivered-To: freebsd-net@freebsd.org Received: from wren.cs.unc.edu (wren.cs.unc.edu [152.2.128.86]) by hub.freebsd.org (Postfix) with ESMTP id 2424C37B40B for ; Wed, 10 Oct 2001 10:20:47 -0700 (PDT) Received: from le-cs.cs.unc.edu (IDENT:le@le-cs.cs.unc.edu [152.2.131.150]) by wren.cs.unc.edu (8.9.3/8.9.3) with ESMTP id NAA11321; Wed, 10 Oct 2001 13:20:38 -0400 (EDT) Date: Wed, 10 Oct 2001 13:20:38 -0400 (EDT) From: Nguyen-Tuong Long Le To: Alex Rousskov Cc: Subject: Re: Connect(2) problem In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hello Alex, Thanks very much for your reply! Just our of curiosity, what is the use of net.inet.ip.portrange.hifirst and net.inet.ip.portrange.hilast ? Thanks, Long On Tue, 9 Oct 2001, Alex Rousskov wrote: > > Are you running out of ephemeral ports? See net.inet.ip.portrange > sysctl or do your own port management. > > Alex. > > On Tue, 9 Oct 2001, Nguyen-Tuong Long Le wrote: > > > Hi all, > > > > I have a software that simulates web clients and servers to create > > network congestion (for the purpose of doing research in network > > congestion). In our experiment, a client opens an HTTP connection > > to a server, fetches a number of objects, and then closes the > > connection. A problem I seem to have right now is that a client > > machine cannot simulate more than 3000 connections. When my client > > machine simulates more than 3000 connections, it's able to open > > a socket but then connect(2) fails with errno 35 (Resource > > temporarily unavailable). Another interesting notice is that the > > connect(2) system call blocks for a few miliseconds before it > > fails although fcntl(2) was used to make the socket non-blocking. > > The OS version I am using is FreeBSD 4.3-release. > > > > I used sysctl to bump up kern.maxfiles and kern.maxfilesperproc to > > 16384. I also bumped up kern.ipc.somaxconn to 8192 on the server > > side. I recompiled the kernel with option NMBCLUSTERS=65536 to > > increase the number of mbufs. I guess that CPU is not the bottleneck > > since I have the same problem regardless whether I use a 300 MHz or > > a 1 GHz machine. > > > > Does anyone have any suggestion what kind of resources my client machine > > runs out and how I can fix it? > > > > Thanks, > > Long > > > > P.S. Please kindly email your reply to me since I am not on the list. > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-net" in the body of the message > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 10:39:17 2001 Delivered-To: freebsd-net@freebsd.org Received: from measurement-factory.com (measurement-factory.com [206.168.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 01D9C37B406 for ; Wed, 10 Oct 2001 10:39:13 -0700 (PDT) Received: (from rousskov@localhost) by measurement-factory.com (8.9.3/8.9.3) id LAA79177; Wed, 10 Oct 2001 11:39:09 -0600 (MDT) (envelope-from rousskov) Date: Wed, 10 Oct 2001 11:39:09 -0600 (MDT) From: Alex Rousskov To: Nguyen-Tuong Long Le Cc: freebsd-net@FreeBSD.ORG Subject: Re: Connect(2) problem In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, 10 Oct 2001, Nguyen-Tuong Long Le wrote: > Just our of curiosity, what is the use of > net.inet.ip.portrange.hifirst and net.inet.ip.portrange.hilast ? Even FreeBSD gurus/committers are unsure :-) http://people.freebsd.org/~adrian/sysctl.descriptions The answer is in "man ip". Alex. > On Tue, 9 Oct 2001, Alex Rousskov wrote: > > > > > Are you running out of ephemeral ports? See net.inet.ip.portrange > > sysctl or do your own port management. > > > > Alex. > > > > On Tue, 9 Oct 2001, Nguyen-Tuong Long Le wrote: > > > > > Hi all, > > > > > > I have a software that simulates web clients and servers to create > > > network congestion (for the purpose of doing research in network > > > congestion). In our experiment, a client opens an HTTP connection > > > to a server, fetches a number of objects, and then closes the > > > connection. A problem I seem to have right now is that a client > > > machine cannot simulate more than 3000 connections. When my client > > > machine simulates more than 3000 connections, it's able to open > > > a socket but then connect(2) fails with errno 35 (Resource > > > temporarily unavailable). Another interesting notice is that the > > > connect(2) system call blocks for a few miliseconds before it > > > fails although fcntl(2) was used to make the socket non-blocking. > > > The OS version I am using is FreeBSD 4.3-release. > > > > > > I used sysctl to bump up kern.maxfiles and kern.maxfilesperproc to > > > 16384. I also bumped up kern.ipc.somaxconn to 8192 on the server > > > side. I recompiled the kernel with option NMBCLUSTERS=65536 to > > > increase the number of mbufs. I guess that CPU is not the bottleneck > > > since I have the same problem regardless whether I use a 300 MHz or > > > a 1 GHz machine. > > > > > > Does anyone have any suggestion what kind of resources my client machine > > > runs out and how I can fix it? > > > > > > Thanks, > > > Long > > > > > > P.S. Please kindly email your reply to me since I am not on the list. > > > > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > > with "unsubscribe freebsd-net" in the body of the message > > > > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 10:47: 2 2001 Delivered-To: freebsd-net@freebsd.org Received: from silby.com (cb34181-a.mdsn1.wi.home.com [24.14.173.39]) by hub.freebsd.org (Postfix) with ESMTP id 6780737B40A for ; Wed, 10 Oct 2001 10:46:59 -0700 (PDT) Received: (qmail 23817 invoked by uid 1000); 10 Oct 2001 17:46:58 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 10 Oct 2001 17:46:58 -0000 Date: Wed, 10 Oct 2001 12:46:58 -0500 (CDT) From: Mike Silbersack To: Nguyen-Tuong Long Le Cc: Alex Rousskov , Subject: Re: Connect(2) problem In-Reply-To: Message-ID: <20011010124421.E23388-100000@achilles.silby.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, 10 Oct 2001, Nguyen-Tuong Long Le wrote: > Hello Alex, > > Thanks very much for your reply! > > Just our of curiosity, what is the use of > net.inet.ip.portrange.hifirst and net.inet.ip.portrange.hilast ? > > Thanks, > Long hifirst and hilast represent the range of ports that we should be using for outbound connections. If you need more ephemeral ports, change .first and .last to equal the corresponding hi values. For more background, read one of Stevens's books. (This is mentioned in UNIX network programming volume 1, I'd assume the tcp books cover it as well.) Mike "Silby" Silbersack To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 10:57:21 2001 Delivered-To: freebsd-net@freebsd.org Received: from mail.tcoip.com.br (cerberus.tcoip.com.br [200.220.254.3]) by hub.freebsd.org (Postfix) with ESMTP id 1E47837B403 for ; Wed, 10 Oct 2001 10:57:09 -0700 (PDT) Received: from tcoip.com.br (wuxr838moqwbqari@[192.168.60.194]) by mail.tcoip.com.br (8.11.1/8.11.1) with ESMTP id f9AHutN18793; Wed, 10 Oct 2001 14:56:55 -0300 Message-ID: <3BC48BE7.1060302@tcoip.com.br> Date: Wed, 10 Oct 2001 14:56:55 -0300 From: "Daniel C. Sobral" User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:0.9.4) Gecko/20010919 X-Accept-Language: en, pt-br, ja MIME-Version: 1.0 To: Bill Fenner Cc: net@freebsd.org Subject: Re: VLAN speed References: <200110100519.WAA03152@windsor.research.att.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Bill Fenner wrote: >>Why does vlans announce themselves as being 10 Mbits/s? I'm getting this >> >>from snmp on vlans that are attached to 100 Mbits/s cards. > > I know that real experts can communicate in very few words, but I'd appreciate a few more words. :-) Zero is a bit too little for me. :-) -- Daniel C. Sobral (8-DCS) Daniel.Sobral@tcoip.com.br dcs@newsguy.com dcs@freebsd.org capo@notorious.bsdconspiracy.net Real programmers always have a better idea. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 12:37: 0 2001 Delivered-To: freebsd-net@freebsd.org Received: from elvis.mu.org (elvis.mu.org [216.33.66.196]) by hub.freebsd.org (Postfix) with ESMTP id 4A04537B403 for ; Wed, 10 Oct 2001 12:36:53 -0700 (PDT) Received: by elvis.mu.org (Postfix, from userid 1098) id 1A15681D01; Wed, 10 Oct 2001 14:36:48 -0500 (CDT) Date: Wed, 10 Oct 2001 14:36:48 -0500 From: Bill Fumerola To: Bill Fenner Cc: daniel.sobral@tcoip.com.br, net@freebsd.org Subject: Re: VLAN speed Message-ID: <20011010143648.O51024@elvis.mu.org> References: <200110100519.WAA03152@windsor.research.att.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200110100519.WAA03152@windsor.research.att.com>; from fenner@research.att.com on Tue, Oct 09, 2001 at 10:19:09PM -0700 X-Operating-System: FreeBSD 4.4-FEARSOME-20010909 i386 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Tue, Oct 09, 2001 at 10:19:09PM -0700, Bill Fenner wrote: > (ifSpeed says "For a sub-layer which has no concept of bandwidth, this > object should be zero." I'd argue that this describes VLAN interfaces.) not that the vendor is always right or anything, but at least one implementation (juniper) behaves this way: interfaces.ifTable.ifEntry.ifDescr.9 = fxp1.0 interfaces.ifTable.ifEntry.ifType.9 = ethernetCsmacd(6) interfaces.ifTable.ifEntry.ifSpeed.9 = Gauge: 100000000 interfaces.ifTable.ifEntry.ifDescr.36 = ge-2/0/0.401 interfaces.ifTable.ifEntry.ifType.36 = ethernetCsmacd(6) interfaces.ifTable.ifEntry.ifSpeed.36 = Gauge: 1000000000 crisco only creates entries in the ifTable for physical interfaces in their routers (or at least for the ones that I have access to that use .1q or isl). cisco msfc2 reports gigabit for vlans, but that doesn't count. just a reference point. I would argue that vlans are definitely "a sub-layer which has no concept of bandwidth" too. -- - bill fumerola / fumerola@yahoo-inc.com / billf@FreeBSD.org / billf@mu.org - my anger management counselor can beat up your self-affirmation therapist To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 12:42:40 2001 Delivered-To: freebsd-net@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 01CB037B405 for ; Wed, 10 Oct 2001 12:42:38 -0700 (PDT) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.11.4/8.11.4) id f9AJgL666027; Wed, 10 Oct 2001 15:42:21 -0400 (EDT) (envelope-from wollman) Date: Wed, 10 Oct 2001 15:42:21 -0400 (EDT) From: Garrett Wollman Message-Id: <200110101942.f9AJgL666027@khavrinen.lcs.mit.edu> To: Bill Fumerola Cc: net@FreeBSD.ORG Subject: Re: VLAN speed In-Reply-To: <20011010143648.O51024@elvis.mu.org> References: <200110100519.WAA03152@windsor.research.att.com> <20011010143648.O51024@elvis.mu.org> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org < said: > On Tue, Oct 09, 2001 at 10:19:09PM -0700, Bill Fenner wrote: >> (ifSpeed says "For a sub-layer which has no concept of bandwidth, this >> object should be zero." I'd argue that this describes VLAN interfaces.) > not that the vendor is always right or anything, but at least one > implementation (juniper) behaves this way: Extreme implements the spec as Bill Fenner described it. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 13:34:41 2001 Delivered-To: freebsd-net@freebsd.org Received: from mail6.bigmailbox.com (mail6.bigmailbox.com [209.132.220.37]) by hub.freebsd.org (Postfix) with ESMTP id 64CFF37B403 for ; Wed, 10 Oct 2001 13:34:39 -0700 (PDT) Received: (from www@localhost) by mail6.bigmailbox.com (8.10.0/8.10.0) id f9AKXRi26016; Wed, 10 Oct 2001 13:33:27 -0700 Date: Wed, 10 Oct 2001 13:33:27 -0700 Message-Id: <200110102033.f9AKXRi26016@mail6.bigmailbox.com> Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: binary X-Mailer: MIME-tools 4.104 (Entity 4.116) Mime-Version: 1.0 X-Originating-Ip: [200.229.133.210] From: "irado@nettaxi.com" To: irado@globecom.net Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org but *not* connected to Internet (yet) I am intending to mount a ipsec or vtun vpn, but in a practical sense, I am intending to emulate the internet at home, instead to real connections to the internet, as the real conn will be far away (1,400 km apart) from the other. I am speculating in something like: lan-1/---/gw~fwall-ipsec(vtund)--/fake router/---/fake \\ router/--/gw~fw-ipsec(vtun)/--/lan-2 what do you think about such plans?? Note that gw~fw at both ends will be FreeBSD, the intermediate (up to 3) fake router can be Linux boxes or FreeBSD, with real (routable) ip-addresses, but dropping rfc-1918's private addresses. saudações, irado furioso com tudo linux user 179402 deus é construído à imagem e semelhança do homem. Principalmente em seus defeitos. por favor, clique aqui: http://www.thehungersite.com e aqui também: http://cf6.uol.com.br/umminuto/ ------------------------------------------------------------ Nettaxi would like to ask for your help in donations to the RED CROSS today! http://www.nyredcross.org/donate/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 18:15: 7 2001 Delivered-To: freebsd-net@freebsd.org Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by hub.freebsd.org (Postfix) with ESMTP id BCE3737B405 for ; Wed, 10 Oct 2001 18:15:05 -0700 (PDT) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id SAA14151; Wed, 10 Oct 2001 18:06:22 -0700 (PDT) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.3/8.11.3) id f9B16L514629; Wed, 10 Oct 2001 18:06:21 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200110110106.f9B16L514629@arch20m.dellroad.org> Subject: Re: Trying to find out which interface an IP packet is coming from in ip_output() routine In-Reply-To: <200110101618.f9AGIVA86599@vashon.polstra.com> "from John Polstra at Oct 10, 2001 09:18:31 am" To: John Polstra Date: Wed, 10 Oct 2001 18:06:21 -0700 (PDT) Cc: net@FreeBSD.ORG, aihguo1@hotmail.com X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org John Polstra writes: > > Can anybody help me find a way to find out which interface an IP > > packet is coming from in ip_output()/ip_input() routine? > > The mb->m_pkthdr.rcvif field of the mbuf points to the interface on > which the packet was received. ...if any. In ip_input(), mb->m_pkthdr.rcvif is always non-NULL, but in ip_output() it may be NULL e.g. if the packet was locally generated. -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Wed Oct 10 22:52:48 2001 Delivered-To: freebsd-net@freebsd.org Received: from sofia.digsys.bg (sofia.digsys.bg [193.68.3.250]) by hub.freebsd.org (Postfix) with ESMTP id 6D60937B403 for ; Wed, 10 Oct 2001 22:52:42 -0700 (PDT) Received: from comm.uni-svishtov.bg (ns.uni-svishtov.bg [193.68.172.1]) by sofia.digsys.bg (8.9.0/8.9.0) with ESMTP id IAA00987 for ; Thu, 11 Oct 2001 08:52:33 +0300 (EEST) Received: from grinch.uni-svishtov.bg (root@grinch.uni-svishtov.bg [193.68.172.9]) by comm.uni-svishtov.bg (8.9.3/8.9.3) with ESMTP id IAA06001 for ; Thu, 11 Oct 2001 08:52:33 +0300 (EEST) Received: from there (deckland.uni-svishtov.bg [193.68.173.82]) by grinch.uni-svishtov.bg (8.9.3/8.9.1) with SMTP id IAA13171 for ; Thu, 11 Oct 2001 08:52:32 +0300 (EEST) Message-Id: <200110110552.IAA13171@grinch.uni-svishtov.bg> Content-Type: text/plain; charset="iso-8859-1" From: Radoslav Vasilev Reply-To: rvasilev@uni-svishtov.bg Organization: Academic Computer Center - Tsenov Academy To: net@freebsd.org Subject: cisco 2509 to FreeBSD PPP Date: Thu, 11 Oct 2001 08:52:33 +0300 X-Mailer: KMail [version 1.3] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hello, Recently I got the chance of playing with Cisco 2509 access server. The bad thing is it has only 1 Ethernet port, so if I want to play with routing..etc I need establishing connection through some other port, the AUX for example. I was told I could try connecting AUX on cisco with null modem cable(RG45 <->DB9 female) to the COM port of FreeBSD machine. So far , I've used PPP for dial-up access only, that's why it's complete darkness for me what set of ppp/at commands I need on the bsd-box, and what settings on the aux line on cisco. Can anyone help me with this? Thanks in advance! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Oct 11 9:25:41 2001 Delivered-To: freebsd-net@freebsd.org Received: from smtp1.sentex.ca (smtp1.sentex.ca [199.212.134.4]) by hub.freebsd.org (Postfix) with ESMTP id A33BA37B408 for ; Thu, 11 Oct 2001 09:25:36 -0700 (PDT) Received: from simoeon.sentex.net (pyroxene.sentex.ca [199.212.134.18]) by smtp1.sentex.ca (8.11.6/8.11.6) with ESMTP id f9BGP9079091; Thu, 11 Oct 2001 12:25:09 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <5.1.0.14.0.20011011121308.053ddc20@marble.sentex.ca> X-Sender: mdtpop@marble.sentex.ca X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 11 Oct 2001 12:19:01 -0400 To: Luigi Rizzo From: Mike Tancsa Subject: strange results with increased net.inet.ip.intr_queue_maxlen Cc: freebsd-net@freebsd.org In-Reply-To: <200110092255.f99Mtd195040@iguana.aciri.org> References: <5.1.0.14.0.20011009165532.0368b110@marble.sentex.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Queue drops generally corresponded to bandwidth. Charting the bandwidth going through the box and the rate at which queue drops increased certainly seemed to correspond. I didnt run any statistical analysis, as the visual correlation was very evident... But here is a strange result I dont quite understand. I increased net.inet.ip.intr_queue_maxlen from 50 to 100. and there didnt seem to be any positive results in terms of lessening the rate of net.inet.ip.intr_queue_drops. On another machine that also was showing drops, I decided to start tracking it as well. I increased net.inet.ip.intr_queue_maxlen to 256 unintentionally from the standard 50. However, this had the strange result of reducing the rate at which net.inet.ip.intr_queue_maxlen was increasing to zero. Huh ? Why would there not be a more gradual/measured effect ? Does this make sense? ---Mike At 03:55 PM 10/9/01 -0700, Luigi Rizzo wrote: > > Also, in terms of queue drops, the fastforwarding did make a small > > difference, but I still am seeing a series of drops somewhere between 5 > and > > 10min. If you think it would be useful to track down to see if it is > > exactly some interval, I can do so. > >it is dependent on external drive, anyways.. so the nice thing >to see perhaps would be run a 'netstat -i' every second and >see if there are evenly spaced traffic spikes. > > cheers > luigi > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Oct 11 11:12:47 2001 Delivered-To: freebsd-net@freebsd.org Received: from beppo.feral.com (beppo.feral.com [192.67.166.79]) by hub.freebsd.org (Postfix) with ESMTP id 4EA3337B406 for ; Thu, 11 Oct 2001 11:12:43 -0700 (PDT) Received: from wonky.feral.com (wonky.feral.com [192.67.166.7]) by beppo.feral.com (8.11.3/8.11.3) with ESMTP id f9BICgH83835 for ; Thu, 11 Oct 2001 11:12:42 -0700 (PDT) (envelope-from mjacob@feral.com) Date: Thu, 11 Oct 2001 11:11:35 -0700 (PDT) From: Matthew Jacob Reply-To: To: Subject: review of change to bridge.h In-Reply-To: <20011002190406.W4030-100000@wonky.feral.com> Message-ID: <20011011111056.R84793-100000@wonky.feral.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Fix the silly warning: Index: bridge.h =================================================================== RCS file: /home/ncvs/src/sys/net/bridge.h,v retrieving revision 1.8 diff -u -r1.8 bridge.h --- bridge.h 2001/10/05 05:45:26 1.8 +++ bridge.h 2001/10/11 18:11:51 @@ -92,8 +92,17 @@ *((unsigned int *)(a)) == 0xffffffff && \ ((unsigned short *)(a))[2] == 0xffff ) #else -#warning... must complete these for the alpha etc. +/* + * unaligned version + */ #define BDG_MATCH(a,b) (!bcmp(a, b, ETHER_ADDR_LEN) ) +#define IS_ETHER_BROADCAST(a) ( \ + ((unsigned char *)(a))[0] == 0xff && \ + ((unsigned char *)(a))[1] == 0xff && \ + ((unsigned char *)(a))[2] == 0xff && \ + ((unsigned char *)(a))[3] == 0xff && \ + ((unsigned char *)(a))[4] == 0xff && \ + ((unsigned char *)(a))[5] == 0xff) #endif /* * The following constants are not legal ifnet pointers, and are used To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Oct 11 11:18:49 2001 Delivered-To: freebsd-net@freebsd.org Received: from iguana.aciri.org (iguana.aciri.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id D2F7137B403 for ; Thu, 11 Oct 2001 11:18:45 -0700 (PDT) Received: (from rizzo@localhost) by iguana.aciri.org (8.11.3/8.11.1) id f9BIFaT12658; Thu, 11 Oct 2001 11:15:36 -0700 (PDT) (envelope-from rizzo) From: Luigi Rizzo Message-Id: <200110111815.f9BIFaT12658@iguana.aciri.org> Subject: Re: review of change to bridge.h In-Reply-To: <20011011111056.R84793-100000@wonky.feral.com> from Matthew Jacob at "Oct 11, 2001 11:11:35 am" To: mjacob@feral.com Date: Thu, 11 Oct 2001 11:15:36 -0700 (PDT) Cc: freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I guess it might be marginally more efficient to call bcmp() (and rely on it being optimized), or do 3 comparisons with unsigned short * > +#define IS_ETHER_BROADCAST(a) ( \ > + ((unsigned short *)(a))[0] == 0xffff && \ > + ((unsigned short *)(a))[1] == 0xffff && \ > + ((unsigned short *)(a))[2] == 0xffff) Apart from this, have you actually tested bridging on the alpha ? The purpose of the warning was also to say "look, this code might not work on architectures not supporting unaligned accesses, so you might need to hack on the code yourself" cheers luigi > Fix the silly warning: > > Index: bridge.h > =================================================================== > RCS file: /home/ncvs/src/sys/net/bridge.h,v > retrieving revision 1.8 > diff -u -r1.8 bridge.h > --- bridge.h 2001/10/05 05:45:26 1.8 > +++ bridge.h 2001/10/11 18:11:51 > @@ -92,8 +92,17 @@ > *((unsigned int *)(a)) == 0xffffffff && \ > ((unsigned short *)(a))[2] == 0xffff ) > #else > -#warning... must complete these for the alpha etc. > +/* > + * unaligned version > + */ > #define BDG_MATCH(a,b) (!bcmp(a, b, ETHER_ADDR_LEN) ) > +#define IS_ETHER_BROADCAST(a) ( \ > + ((unsigned char *)(a))[0] == 0xff && \ > + ((unsigned char *)(a))[1] == 0xff && \ > + ((unsigned char *)(a))[2] == 0xff && \ > + ((unsigned char *)(a))[3] == 0xff && \ > + ((unsigned char *)(a))[4] == 0xff && \ > + ((unsigned char *)(a))[5] == 0xff) > #endif > /* > * The following constants are not legal ifnet pointers, and are used > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Oct 11 11:28:58 2001 Delivered-To: freebsd-net@freebsd.org Received: from beppo.feral.com (beppo.feral.com [192.67.166.79]) by hub.freebsd.org (Postfix) with ESMTP id BAE3337B409 for ; Thu, 11 Oct 2001 11:28:55 -0700 (PDT) Received: from wonky.feral.com (wonky.feral.com [192.67.166.7]) by beppo.feral.com (8.11.3/8.11.3) with ESMTP id f9BISpH83980; Thu, 11 Oct 2001 11:28:51 -0700 (PDT) (envelope-from mjacob@feral.com) Date: Thu, 11 Oct 2001 11:27:46 -0700 (PDT) From: Matthew Jacob Reply-To: To: Luigi Rizzo Cc: Subject: Re: review of change to bridge.h In-Reply-To: <200110111815.f9BIFaT12658@iguana.aciri.org> Message-ID: <20011011112700.T84793-100000@wonky.feral.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Thu, 11 Oct 2001, Luigi Rizzo wrote: > I guess it might be marginally more efficient to > call bcmp() (and rely on it being optimized), or do 3 > comparisons with unsigned short * > > > +#define IS_ETHER_BROADCAST(a) ( \ > > + ((unsigned short *)(a))[0] == 0xffff && \ > > + ((unsigned short *)(a))[1] == 0xffff && \ > > + ((unsigned short *)(a))[2] == 0xffff) You can't assume a short * is aligned either. BTW- this also applies to sparc. > > Apart from this, have you actually tested bridging on > the alpha ? The purpose of the warning was also to > say "look, this code might not work on architectures > not supporting unaligned accesses, so you might need to > hack on the code yourself" Nope. But a better place to say "Bridging is not tested" is to look in a kernel config file. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Oct 11 11:38:36 2001 Delivered-To: freebsd-net@freebsd.org Received: from iguana.aciri.org (iguana.aciri.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id 10D6737B405 for ; Thu, 11 Oct 2001 11:38:33 -0700 (PDT) Received: (from rizzo@localhost) by iguana.aciri.org (8.11.3/8.11.1) id f9BIZTn12830; Thu, 11 Oct 2001 11:35:29 -0700 (PDT) (envelope-from rizzo) From: Luigi Rizzo Message-Id: <200110111835.f9BIZTn12830@iguana.aciri.org> Subject: Re: review of change to bridge.h In-Reply-To: <20011011112700.T84793-100000@wonky.feral.com> from Matthew Jacob at "Oct 11, 2001 11:27:46 am" To: mjacob@feral.com Date: Thu, 11 Oct 2001 11:35:29 -0700 (PDT) Cc: rizzo@aciri.org, freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > > > On Thu, 11 Oct 2001, Luigi Rizzo wrote: > > > I guess it might be marginally more efficient to > > call bcmp() (and rely on it being optimized), or do 3 > > comparisons with unsigned short * > > > > > +#define IS_ETHER_BROADCAST(a) ( \ > > > + ((unsigned short *)(a))[0] == 0xffff && \ > > > + ((unsigned short *)(a))[1] == 0xffff && \ > > > + ((unsigned short *)(a))[2] == 0xffff) > > You can't assume a short * is aligned either. well, in this case a is always on an even boundary, but whether this is also a multiple of 4 is very driver-specific. Anyways, feel free to commit whatever version you prefer -- it is better than the current code anyways. I would probably use bcmp... i find myself trying to rely more and more on compiler optimizations, because the hand optimization that we all liked to do in the early years are very architecture specific and tend to become bad ideas as architectures evolve. There are parts of the code (e.g. in mbuf handling) where "optimized" versions of some routines (e.g. m_copym vs. m_copypacket) save maybe a couple of jumps/calls at the price of 500-1000 bytes of extra code (and associated cache pollution). cheers luigi ----------------------------------+----------------------------------------- Luigi RIZZO, luigi@iet.unipi.it . ACIRI/ICSI (on leave from Univ. di Pisa) http://www.iet.unipi.it/~luigi/ . 1947 Center St, Berkeley CA 94704 Phone: (510) 666 2927 ----------------------------------+----------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Oct 11 11:42:36 2001 Delivered-To: freebsd-net@freebsd.org Received: from beppo.feral.com (beppo.feral.com [192.67.166.79]) by hub.freebsd.org (Postfix) with ESMTP id 0034137B403 for ; Thu, 11 Oct 2001 11:42:32 -0700 (PDT) Received: from wonky.feral.com (wonky.feral.com [192.67.166.7]) by beppo.feral.com (8.11.3/8.11.3) with ESMTP id f9BIgUH84156; Thu, 11 Oct 2001 11:42:30 -0700 (PDT) (envelope-from mjacob@feral.com) Date: Thu, 11 Oct 2001 11:42:30 -0700 (PDT) From: Matthew Jacob Reply-To: To: Luigi Rizzo Cc: Subject: Re: review of change to bridge.h In-Reply-To: <200110111835.f9BIZTn12830@iguana.aciri.org> Message-ID: <20011011114158.G84793-100000@wonky.feral.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Maybe bcmp is right. I believe having IS_ETHER_BROADCAST is too useful a macro.... On Thu, 11 Oct 2001, Luigi Rizzo wrote: > > > > > > On Thu, 11 Oct 2001, Luigi Rizzo wrote: > > > > > I guess it might be marginally more efficient to > > > call bcmp() (and rely on it being optimized), or do 3 > > > comparisons with unsigned short * > > > > > > > +#define IS_ETHER_BROADCAST(a) ( \ > > > > + ((unsigned short *)(a))[0] == 0xffff && \ > > > > + ((unsigned short *)(a))[1] == 0xffff && \ > > > > + ((unsigned short *)(a))[2] == 0xffff) > > > > You can't assume a short * is aligned either. > > well, in this case a is always on > an even boundary, but whether this is also a multiple of 4 > is very driver-specific. > > Anyways, feel free to commit whatever version you prefer -- it > is better than the current code anyways. > > I would probably use bcmp... i find myself trying to rely > more and more on compiler optimizations, because the hand > optimization that we all liked to do in the early years are > very architecture specific and tend to become bad ideas as > architectures evolve. > > There are parts of the code (e.g. in mbuf handling) where "optimized" > versions of some routines (e.g. m_copym vs. m_copypacket) save > maybe a couple of jumps/calls at the price of 500-1000 bytes of > extra code (and associated cache pollution). > > cheers > luigi > ----------------------------------+----------------------------------------- > Luigi RIZZO, luigi@iet.unipi.it . ACIRI/ICSI (on leave from Univ. di Pisa) > http://www.iet.unipi.it/~luigi/ . 1947 Center St, Berkeley CA 94704 > Phone: (510) 666 2927 > ----------------------------------+----------------------------------------- > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Oct 11 11:45:52 2001 Delivered-To: freebsd-net@freebsd.org Received: from iguana.aciri.org (iguana.aciri.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id 1188737B406 for ; Thu, 11 Oct 2001 11:45:51 -0700 (PDT) Received: (from rizzo@localhost) by iguana.aciri.org (8.11.3/8.11.1) id f9BIglx12911; Thu, 11 Oct 2001 11:42:47 -0700 (PDT) (envelope-from rizzo) From: Luigi Rizzo Message-Id: <200110111842.f9BIglx12911@iguana.aciri.org> Subject: Re: review of change to bridge.h In-Reply-To: <20011011114158.G84793-100000@wonky.feral.com> from Matthew Jacob at "Oct 11, 2001 11:42:30 am" To: mjacob@feral.com Date: Thu, 11 Oct 2001 11:42:47 -0700 (PDT) Cc: rizzo@aciri.org, freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > > Maybe bcmp is right. I believe having IS_ETHER_BROADCAST is too > useful a macro.... yes, i mean leave it as a macro which calls bcmp, and let the compiler handle the issue. #define IS_ETHER_BROADCAST(a) (!bcmp(a, "\377\377\377\377\377\377", 6)) luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Oct 11 11:50: 2 2001 Delivered-To: freebsd-net@freebsd.org Received: from beppo.feral.com (beppo.feral.com [192.67.166.79]) by hub.freebsd.org (Postfix) with ESMTP id 1D18637B403 for ; Thu, 11 Oct 2001 11:49:58 -0700 (PDT) Received: from wonky.feral.com (wonky.feral.com [192.67.166.7]) by beppo.feral.com (8.11.3/8.11.3) with ESMTP id f9BInuH84225; Thu, 11 Oct 2001 11:49:56 -0700 (PDT) (envelope-from mjacob@feral.com) Date: Thu, 11 Oct 2001 11:49:56 -0700 (PDT) From: Matthew Jacob Reply-To: To: Luigi Rizzo Cc: Subject: Re: review of change to bridge.h In-Reply-To: <200110111842.f9BIglx12911@iguana.aciri.org> Message-ID: <20011011114924.O84793-100000@wonky.feral.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Yes- I think I agree with you on this. On Thu, 11 Oct 2001, Luigi Rizzo wrote: > > > > Maybe bcmp is right. I believe having IS_ETHER_BROADCAST is too > > useful a macro.... > > yes, i mean leave it as a macro which calls bcmp, and > let the compiler handle the issue. > > #define IS_ETHER_BROADCAST(a) (!bcmp(a, "\377\377\377\377\377\377", 6)) > > luigi > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Oct 11 13:45: 7 2001 Delivered-To: freebsd-net@freebsd.org Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by hub.freebsd.org (Postfix) with ESMTP id 26F7737B403 for ; Thu, 11 Oct 2001 13:45:05 -0700 (PDT) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id NAA19884; Thu, 11 Oct 2001 13:38:48 -0700 (PDT) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.3/8.11.3) id f9BKclh17562; Thu, 11 Oct 2001 13:38:47 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200110112038.f9BKclh17562@arch20m.dellroad.org> Subject: Re: strange results with increased net.inet.ip.intr_queue_maxlen In-Reply-To: <5.1.0.14.0.20011011121308.053ddc20@marble.sentex.ca> "from Mike Tancsa at Oct 11, 2001 12:19:01 pm" To: Mike Tancsa Date: Thu, 11 Oct 2001 13:38:47 -0700 (PDT) Cc: Luigi Rizzo , freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org [ jumping into the middle of this discussion... ] Mike Tancsa writes: > net.inet.ip.intr_queue_maxlen from 50 to 100. and there didnt seem to be > any positive results in terms of lessening the rate of > net.inet.ip.intr_queue_drops. This is consistent with the situation where packets are received at a rate faster than they are being consumed. No matter how big your queue is, it's going to fill up eventually and overflow, and all you're doing by increasing the queue length is adding latency to all of those packets that you do process. -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Oct 11 13:56:59 2001 Delivered-To: freebsd-net@freebsd.org Received: from smtp1.sentex.ca (smtp1.sentex.ca [199.212.134.4]) by hub.freebsd.org (Postfix) with ESMTP id 94F2137B403 for ; Thu, 11 Oct 2001 13:56:55 -0700 (PDT) Received: from simoeon.sentex.net (pyroxene.sentex.ca [199.212.134.18]) by smtp1.sentex.ca (8.11.6/8.11.6) with ESMTP id f9BKupO16640; Thu, 11 Oct 2001 16:56:51 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <5.1.0.14.0.20011011164834.0728c2e0@marble.sentex.ca> X-Sender: mdtpop@marble.sentex.ca X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 11 Oct 2001 16:50:42 -0400 To: Archie Cobbs From: Mike Tancsa Subject: Re: strange results with increased net.inet.ip.intr_queue_maxlen Cc: Luigi Rizzo , freebsd-net@FreeBSD.ORG In-Reply-To: <200110112038.f9BKclh17562@arch20m.dellroad.org> References: <5.1.0.14.0.20011011121308.053ddc20@marble.sentex.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org At 01:38 PM 10/11/01 -0700, Archie Cobbs wrote: >[ jumping into the middle of this discussion... ] > >Mike Tancsa writes: > > net.inet.ip.intr_queue_maxlen from 50 to 100. and there didnt seem to be > > any positive results in terms of lessening the rate of > > net.inet.ip.intr_queue_drops. > >This is consistent with the situation where packets are received >at a rate faster than they are being consumed. No matter how big >your queue is, it's going to fill up eventually and overflow, and >all you're doing by increasing the queue length is adding latency >to all of those packets that you do process. Hi, thanks for the info. But wont I still pay a price, presumably at the application layer for any packets that are lost and retransmitted ? Apart from pinging the other side of the OC-3 or ethernet connection and measuring the response time, how can I see how much latency is added by increasing these buffers ? ---Mike To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Oct 11 18:30: 7 2001 Delivered-To: freebsd-net@freebsd.org Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by hub.freebsd.org (Postfix) with ESMTP id 8539737B403 for ; Thu, 11 Oct 2001 18:30:03 -0700 (PDT) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id SAA21285; Thu, 11 Oct 2001 18:16:15 -0700 (PDT) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.3/8.11.3) id f9C1GEv18196; Thu, 11 Oct 2001 18:16:14 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200110120116.f9C1GEv18196@arch20m.dellroad.org> Subject: Re: strange results with increased net.inet.ip.intr_queue_maxlen In-Reply-To: <5.1.0.14.0.20011011164834.0728c2e0@marble.sentex.ca> "from Mike Tancsa at Oct 11, 2001 04:50:42 pm" To: Mike Tancsa Date: Thu, 11 Oct 2001 18:16:14 -0700 (PDT) Cc: rizzo@aciri.org, freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Mike Tancsa writes: > > > net.inet.ip.intr_queue_maxlen from 50 to 100. and there didnt seem to be > > > any positive results in terms of lessening the rate of > > > net.inet.ip.intr_queue_drops. > > > >This is consistent with the situation where packets are received > >at a rate faster than they are being consumed. No matter how big > >your queue is, it's going to fill up eventually and overflow, and > >all you're doing by increasing the queue length is adding latency > >to all of those packets that you do process. > > Hi, thanks for the info. But wont I still pay a price, presumably at the > application layer for any packets that are lost and retransmitted ? Apart > from pinging the other side of the OC-3 or ethernet connection and > measuring the response time, how can I see how much latency is added by > increasing these buffers ? If the forwarding path is maxed out, then it is the application layer's responsibility to back off (think TCP). Pinging is an excellent way to determine latency. -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Thu Oct 11 18:33:47 2001 Delivered-To: freebsd-net@freebsd.org Received: from iguana.aciri.org (iguana.aciri.org [192.150.187.36]) by hub.freebsd.org (Postfix) with ESMTP id 0335337B401 for ; Thu, 11 Oct 2001 18:33:46 -0700 (PDT) Received: (from rizzo@localhost) by iguana.aciri.org (8.11.3/8.11.1) id f9C1Ubw15419; Thu, 11 Oct 2001 18:30:37 -0700 (PDT) (envelope-from rizzo) From: Luigi Rizzo Message-Id: <200110120130.f9C1Ubw15419@iguana.aciri.org> Subject: Re: strange results with increased net.inet.ip.intr_queue_maxlen In-Reply-To: <200110120116.f9C1GEv18196@arch20m.dellroad.org> from Archie Cobbs at "Oct 11, 2001 6:16:14 pm" To: archie@dellroad.org (Archie Cobbs) Date: Thu, 11 Oct 2001 18:30:37 -0700 (PDT) Cc: mike@sentex.net, rizzo@aciri.org, freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL43 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org > > from pinging the other side of the OC-3 or ethernet connection and > > measuring the response time, how can I see how much latency is added by > > increasing these buffers ? of course the latency increase depends on how full are the buffers, and the worst case is easier to determine by back-of-the-envelope calculations: queue_slots * max_pkt_size / bottleneck_link_speed e.g. if you have 100 slots and an MSS of 1500 and a 10Mbit bottleneck you are adding (100*1500*8 / 10000000) = 120ms latency. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Oct 12 1:32:46 2001 Delivered-To: freebsd-net@freebsd.org Received: from hotmail.com (f260.law14.hotmail.com [64.4.20.135]) by hub.freebsd.org (Postfix) with ESMTP id 7A48C37B408 for ; Fri, 12 Oct 2001 01:32:44 -0700 (PDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 12 Oct 2001 01:32:44 -0700 Received: from 203.130.214.173 by lw14fd.law14.hotmail.msn.com with HTTP; Fri, 12 Oct 2001 08:32:44 GMT X-Originating-IP: [203.130.214.173] From: "himura kenshin" To: freebsd-net@FreeBSD.org Date: Fri, 12 Oct 2001 16:32:44 +0800 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 12 Oct 2001 08:32:44.0232 (UTC) FILETIME=[76D80480:01C152F8] Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org subscribe _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Oct 12 3: 3:16 2001 Delivered-To: freebsd-net@freebsd.org Received: from mx0.grolier.fr (relay.grolier.fr [194.158.96.33]) by hub.freebsd.org (Postfix) with ESMTP id AC4CA37B403; Fri, 12 Oct 2001 03:03:09 -0700 (PDT) Received: from hautmedoc.dockes.com (bas30-235.idf.w.club-internet.fr [212.194.14.235]) by mx0.grolier.fr (Postfix) with ESMTP id 15BC3C2FD; Fri, 12 Oct 2001 12:03:07 +0200 (CEST) Received: (from dockes@localhost) by hautmedoc.dockes.com (8.11.6/8.11.6) id f9CA37p10022; Fri, 12 Oct 2001 12:03:07 +0200 (CEST) (envelope-from dockes) Date: Fri, 12 Oct 2001 12:03:07 +0200 (CEST) Message-Id: <200110121003.f9CA37p10022@hautmedoc.dockes.com> From: Jean-Francois Dockes To: freebsd-doc@FreeBSD.org Cc: freebsd-net@FreeBSD.org Subject: Updated 'diskless operation' section for the handbook X-Mailer: VM 6.95 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I recently configured a diskless FreeBSD machine, and I found the handbook section to be outdated to the point of irrelevance. I wrote an updated version, which I hereby submit for review, as suggested by the documentation project 'Submitting documentation' section. I hope that the text is mostly technically correct. At least, the things I describe work for me, with a 4.4-STABLE system, using the standard rc files, and they are consistent with any recent information I could find on the subject. In any case it can't be *less* helpful than the old, netboot based, version. The text will certainly require some amount of translation from 'french english' to the real thing, and a lot of style editing. The document can be found at http://perso.wanadoo.fr/dockes/patches/diskless.html 'chapter.sgml', in the same directory, has the docbook source. I am eagerly waiting for comments. Jean-Francois Dockes To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Oct 12 4:44:24 2001 Delivered-To: freebsd-net@freebsd.org Received: from mta02-svc.ntlworld.com (mta02-svc.ntlworld.com [62.253.162.42]) by hub.freebsd.org (Postfix) with ESMTP id B3BD337B403 for ; Fri, 12 Oct 2001 04:44:09 -0700 (PDT) Received: from eborcom.com ([62.255.96.74]) by mta02-svc.ntlworld.com (InterMail vM.4.01.03.00 201-229-121) with SMTP id <20011012114402.XIBZ29790.mta02-svc.ntlworld.com@eborcom.com> for ; Fri, 12 Oct 2001 12:44:02 +0100 Received: (qmail 8017 invoked by uid 1001); 12 Oct 2001 11:43:51 -0000 Date: Fri, 12 Oct 2001 12:43:51 +0100 From: Tom Hukins To: Jean-Francois Dockes Cc: freebsd-doc@FreeBSD.org, freebsd-net@FreeBSD.org Subject: Re: Updated 'diskless operation' section for the handbook Message-ID: <20011012124351.A7169@eborcom.com> Mail-Followup-To: Tom Hukins , Jean-Francois Dockes , freebsd-doc@FreeBSD.org, freebsd-net@FreeBSD.org References: <200110121003.f9CA37p10022@hautmedoc.dockes.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200110121003.f9CA37p10022@hautmedoc.dockes.com>; from jean-francois.dockes@wanadoo.fr on Fri, Oct 12, 2001 at 12:03:07PM +0200 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Oct 12, 2001 at 12:03:07PM +0200, Jean-Francois Dockes wrote: > > I recently configured a diskless FreeBSD machine, and I found the > handbook section to be outdated to the point of irrelevance. > > I wrote an updated version, which I hereby submit for review, as suggested > by the documentation project 'Submitting documentation' section. Great work! Your document seems very useful, although I've never used diskless booting. The attached patch contains fixes for some of the English, a minor stylistic change (linking directly to a man page) and a few examples of removing unecessary space within tags. The last point is something you've done throughout the document, which causes it to render peculiarly. For example, you've got space after a word before a full-stop in several places. The end of the patch contains a few examples of this. Hopefully your work can be incorporated into the Handbook soon. Thanks, Tom --UugvWAfsgieZRqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="diskless.patch" --- diskless-chapter.sgml.orig Fri Oct 12 12:33:02 2001 +++ diskless-chapter.sgml Fri Oct 12 12:18:26 2001 @@ -1109,8 +1109,8 @@ A FreeBSD machine can boot over the network and operate without a local disk, using file systems mounted from an NFS server. No system - modification is necessary, beyond standard configuration files. - Such a system is easy to set up because all the necessary elements + modification is necessary, beyond standard configuration files, and + such a system is easy to set up because all the necessary elements are readily available: @@ -1156,15 +1156,15 @@ There are many ways to set up diskless workstations. Many elements are involved, and most can be customized to suit local taste. The following will describe the setup of a complete system, - emphasising simplicity and compatibility with the + with an emphasis on simplicity and compatibility with the standard FreeBSD startup scripts. The system described has the following characteristics: The diskless workstations use a shared - read-only root filesystem, and a shared - read-only /usr. + readonly root filesystem, and a shared + readonly /usr. The root file system is a copy of a standard FreeBSD root (typically the server's), with some configuration files overriden by ones specific to diskless @@ -1179,9 +1179,9 @@ - As described, this system is insecure. It should - live in a protected area of a network, and be untrusted by - other hosts. + The security of the whole system (server+workstations) + is probably very bad. It should live in a protected area + of a network, and be untrusted by other hosts. @@ -1191,8 +1191,8 @@ Configuring DHCP/BOOTP - There are two protocols that are commonly used to boot a - workstation that retrieves its configuration over the network: BOOTP + There are two main standard protocols used by a booting + workstation to retrieve its configuration over the network: BOOTP and DHCP. They are used at several points in the workstation bootstrap: @@ -1206,7 +1206,7 @@ It is possible to configure a system to use only BOOTP. - The &man.bootpd.8; server program is included in the + The bootpd server program is included in the base FreeBSD system. However, DHCP has a number of advantages over BOOTP (nicer @@ -1222,8 +1222,8 @@ The isc-dhcp server can answer both BOOTP and DHCP requests. - As of release 4.4, isc-dhcp is not part of the base - system. You will first need to install the + isc-dhcp is not part of the base + system (as of release 4.4). You will first need to install the /usr/ports/net/isc-dhcp3 port or the corresponding package. Please refer to for general information about ports and packages. @@ -1324,11 +1324,12 @@ Preparing a boot program with <application>Etherboot</application> - Etherboot's Web - site contains + You can find extensive - extensive documentation mainly intended for Linux - systems, but nonetheless containing useful information. The following + etherboot documentation + on its home site + . This documentation is mainly intended for Linux + systems, but contains a lot of useful explanations. The following will just outline how you would use etherboot on a FreeBSD system. @@ -1488,9 +1489,9 @@ conf/31200 for the small adjustment needed in clone_root . Also see PR - conf/29870 - about a small adjustment needed in - /etc/rc.diskless2. + + conf/29870 about a small adjustment needed in + /etc/rc.diskless2 . @@ -1498,8 +1499,8 @@ Configuring swap If needed, it is possible to do swapping over NFS, to a file - on the server. The exact bootptab /filename> or - dhcpd.conf options are a little mysterious + on the server. The exact bootptab or + dhcpd.conf options are a little mysterious and poorly documented. Anyway, here is what worked for me, using isc-dhcp 3.0rc11. @@ -1558,7 +1559,7 @@ - Running with a read-only <filename>/usr</filename>Running with a readonly /usrIf the diskless workstation is configured to run X, you will have to adjust the xdm configuration file, which puts the error log on /usr by default. --UugvWAfsgieZRqgk-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message From owner-freebsd-net Fri Oct 12 6:20:48 2001 Delivered-To: freebsd-net@freebsd.org Received: from smtp.inode.at (goliath.inode.at [195.58.161.55]) by hub.freebsd.org (Postfix) with ESMTP id 9236E37B403 for ; Fri, 12 Oct 2001 06:20:37 -0700 (PDT) Received: from line29.adsl.wien.inode.at ([213.229.7.29] helo=inode.at) by smtp.inode.at with esmtp (Exim 3.32 #1) id 15s2Er-00037n-00 for freebsd-net@freebsd.org; Fri, 12 Oct 2001 15:20:34 +0200 Message-ID: <3BC6EE8A.AACD8E72@inode.at> Date: Fri, 12 Oct 2001 15:22:18 +0200 From: Michael Bretterklieber X-Mailer: Mozilla 4.75 [de] (Windows NT 5.0; U) X-Accept-Language: de MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: PCCard Problem (Telecom Device SuperSocket HPC100) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hi, I tried to run my PC-Card-Network-Card with FreeBSD 4.4-RELEASE. If i insert the card, the pccardd recognizes the card as: Telecom Device SuperSocket HPC100 inserted. If the ifconfig is made, then the system hangs completely. If i remove the card, then the system works. pccardc dumpcis: Configuration data for card in slot 0 Tuple #1, code = 0x1 (Common memory descriptor), length = 2 000: 00 ff Common memory device information: Device number 1, type No device, WPS = OFF Speed = No speed, Memory block size = reserved, 32 units Tuple #2, code = 0x15 (Version 1 info), length = 29 000: 04 01 50 43 4d 43 49 41 00 46 61 73 74 45 74 68 010: 65 72 6e 65 74 00 56 00 31 2e 30 00 ff Version = 4.1, Manuf = [PCMCIA], card vers = [FastEthernet] Addit. info = [V],[1.0] Tuple #3, code = 0x20 (Manufacturer ID), length = 4 000: 1b 02 02 02 PCMCIA ID = 0x21b, OEM ID = 0x202 Tuple #4, code = 0x1a (Configuration map), length = 5 000: 01 01 c0 03 63 Reg len = 2, config register addr = 0x3c0, last config = 0x1 Registers: XX---XX- Tuple #5, code = 0x1b (Configuration entry), length = 11 000: c7 81 19 07 55 4d 5d 65 30 ff ff Config index = 0x7(default) Interface byte = 0x81 (I/O) wait signal supported Vcc pwr: Nominal operating supply voltage: 5 x 1V Minimum operating supply voltage: 4.5 x 1V Maximum operating supply voltage: 5.5 x 1V Card decodes 5 address lines, full 8/16 Bit I/O IRQ modes: Level IRQs: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Tuple #6, code = 0x1b (Configuration entry), length = 7 000: 07 08 ca 60 00 03 1f Config index = 0x7 Card decodes 10 address lines, limited 8/16 Bit I/O I/O address # 1: block start = 0x300 block length = 0x20 Tuple #7, code = 0x1b (Configuration entry), length = 7 000: 07 08 ca 60 20 03 1f Config index = 0x7 Card decodes 10 address lines, limited 8/16 Bit I/O I/O address # 1: block start = 0x320 block length = 0x20 Tuple #8, code = 0x1b (Configuration entry), length = 7 000: 07 08 ca 60 40 03 1f Config index = 0x7 Card decodes 10 address lines, limited 8/16 Bit I/O I/O address # 1: block start = 0x340 block length = 0x20 Tuple #9, code = 0x1b (Configuration entry), length = 7 000: 07 08 ca 60 60 03 1f Config index = 0x7 Card decodes 10 address lines, limited 8/16 Bit I/O I/O address # 1: block start = 0x360 block length = 0x20 Tuple #10, code = 0x1b (Configuration entry), length = 7 000: 07 08 ca 60 00 02 1f Config index = 0x7 Card decodes 10 address lines, limited 8/16 Bit I/O I/O address # 1: block start = 0x200 block length = 0x20 Tuple #11, code = 0x1b (Configuration entry), length = 7 000: 07 08 ca 60 20 02 1f Config index = 0x7 Card decodes 10 address lines, limited 8/16 Bit I/O I/O address # 1: block start = 0x220 block length = 0x20 Tuple #12, code = 0x21 (Functional ID), length = 2 000: 06 00 Network/LAN adapter Tuple #13, code = 0x14 (No link), length = 0 Tuple #14, code = 0xff (Terminator), length = 0 2 slots found dmesg output: Oct 9 11:15:55 bug /kernel: Copyright (c) 1992-2001 The FreeBSD Project. Oct 9 11:15:55 bug /kernel: Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 Oct 9 11:15:55 bug /kernel: The Regents of the University of California. All rights reserved. Oct 9 11:15:55 bug /kernel: FreeBSD 4.4-RELEASE #2: Sun Oct 7 22:09:42 CEST 2001 Oct 9 11:15:55 bug /kernel: root@bug.jawa.at:/usr/src/sys/compile/BUG Oct 9 11:15:55 bug /kernel: Timecounter "i8254" frequency 1193182 Hz Oct 9 11:15:55 bug /kernel: CPU: Pentium III/Pentium III Xeon/Celeron (597.41-MHz 686-class CPU) Oct 9 11:15:55 bug /kernel: Origin = "GenuineIntel" Id = 0x681 Stepping = 1 Oct 9 11:15:55 bug /kernel: Features=0x387f9ff Oct 9 11:15:55 bug /kernel: real memory = 201261056 (196544K bytes) Oct 9 11:15:55 bug /kernel: config> q Oct 9 11:15:55 bug /kernel: avail memory = 192270336 (187764K bytes) Oct 9 11:15:55 bug /kernel: Preloaded elf kernel "kernel" at 0xc0384000. Oct 9 11:15:55 bug /kernel: Preloaded userconfig_script "/boot/kernel.conf" at 0xc038409c. Oct 9 11:15:55 bug /kernel: Pentium Pro MTRR support enabled Oct 9 11:15:55 bug /kernel: md0: Malloc disk Oct 9 11:15:55 bug /kernel: apm0: on motherboard Oct 9 11:15:55 bug /kernel: apm: found APM BIOS v1.2, connected at v1.2 Oct 9 11:15:55 bug /kernel: npx0: on motherboard Oct 9 11:15:55 bug /kernel: npx0: INT 16 interface Oct 9 11:15:55 bug /kernel: pcib0: on motherboard Oct 9 11:15:55 bug /kernel: pci0: on pcib0 Oct 9 11:15:55 bug /kernel: pcib1: at device 1.0 on pci0 Oct 9 11:15:55 bug /kernel: pci1: on pcib1 Oct 9 11:15:55 bug /kernel: pci1: at 0.0 Oct 9 11:15:55 bug /kernel: isab0: at device 7.0 on pci0 Oct 9 11:15:55 bug /kernel: isa0: on isab0 Oct 9 11:15:56 bug /kernel: atapci0: port 0x1100-0x110f at device 7.1 on pci0 Oct 9 11:15:56 bug /kernel: ata0: at 0x1f0 irq 14 on atapci0 Oct 9 11:15:56 bug /kernel: ata1: at 0x170 irq 15 on atapci0 Oct 9 11:15:56 bug /kernel: uhci0: port 0xff80-0xff9f irq 128 at device 7.2 on pci0 Oct 9 11:15:56 bug /kernel: uhci0: Could not allocate irq Oct 9 11:15:56 bug /kernel: device_probe_and_attach: uhci0 attach returned 6 Oct 9 11:15:56 bug /kernel: chip1: port 0x1400-0x140f at device 7.3 on pci0 Oct 9 11:15:56 bug /kernel: pcic0: irq 10 at device 8.0 on pci0 Oct 9 11:15:56 bug /kernel: pcic0: PCI Memory allocated: 0x44000000 Oct 9 11:15:56 bug /kernel: pcic0: TI12XX PCI Config Reg: [speaker enable][pwr save][CSC serial isa irq] Oct 9 11:15:56 bug /kernel: pccard0: on pcic0 Oct 9 11:15:56 bug /kernel: pcic1: irq 10 at device 8.1 on pci0 Oct 9 11:15:56 bug /kernel: pcic1: PCI Memory allocated: 0x44001000 Oct 9 11:15:56 bug /kernel: pcic1: TI12XX PCI Config Reg: [speaker enable][pwr save][CSC serial isa irq] Oct 9 11:15:56 bug /kernel: pccard1: on pcic1 Oct 9 11:15:56 bug /kernel: csa0: mem 0xe9000000-0xe90fffff,0xe8000000-0xe8000fff irq 5 at device 9.0 on pci0 Oct 9 11:15:56 bug /kernel: csa: card is Unknown/invalid SSID (CS4614) Oct 9 11:15:56 bug /kernel: pcm0: on csa0 Oct 9 11:15:56 bug /kernel: orm0: