From owner-freebsd-bugs Wed May 9 5:40: 6 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 5086F37B423 for ; Wed, 9 May 2001 05:40:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f49Ce2o79388; Wed, 9 May 2001 05:40:02 -0700 (PDT) (envelope-from gnats) Date: Wed, 9 May 2001 05:40:02 -0700 (PDT) Message-Id: <200105091240.f49Ce2o79388@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "Cyril A. Vechera" Subject: Re: kern/26506: sendto() syscall returns EINVAL in jail environment Reply-To: "Cyril A. Vechera" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/26506; it has been noted by GNATS. From: "Cyril A. Vechera" To: , Cc: Subject: Re: kern/26506: sendto() syscall returns EINVAL in jail environment Date: Wed, 9 May 2001 16:35:30 +0400 Sorry, previous patch produces a little performance leak. Please, attend to this. *** in_pcb.c.orig Tue Mar 13 01:10:51 2001 --- in_pcb.c Wed May 9 16:36:13 2001 *************** *** 485,499 **** struct sockaddr_in sa; int error; - if (inp->inp_laddr.s_addr == INADDR_ANY && p->p_prison != NULL) { - bzero(&sa, sizeof (sa)); - sa.sin_addr.s_addr = htonl(p->p_prison->pr_ip); - sa.sin_len=sizeof (sa); - sa.sin_family = AF_INET; - error = in_pcbbind(inp, (struct sockaddr *)&sa, p); - if (error) - return (error); - } /* * Call inner routine, to assign local interface address. */ --- 485,490 ---- *************** *** 507,513 **** } if (inp->inp_laddr.s_addr == INADDR_ANY) { if (inp->inp_lport == 0) { ! error = in_pcbbind(inp, (struct sockaddr *)0, p); if (error) return (error); } --- 498,511 ---- } if (inp->inp_laddr.s_addr == INADDR_ANY) { if (inp->inp_lport == 0) { ! if (p->p_prison ) { ! bzero(&sa, sizeof (sa)); ! sa.sin_addr.s_addr = htonl(p->p_prison->pr_ip); ! sa.sin_len = sizeof (sa); ! sa.sin_family = AF_INET; ! error = in_pcbbind(inp, (struct sockaddr *)&sa, p); ! } else ! error = in_pcbbind(inp, (struct sockaddr *)0, p); if (error) return (error); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message