Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 May 2001 05:40:02 -0700 (PDT)
From:      "Cyril A. Vechera" <cyril@piter.net>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/26506: sendto() syscall returns EINVAL in jail environment
Message-ID:  <200105091240.f49Ce2o79388@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/26506; it has been noted by GNATS.

From: "Cyril A. Vechera" <cyril@piter.net>
To: <freebsd-gnats-submit@FreeBSD.org>, <venglin@freebsd.lublin.pl>
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105091240.f49Ce2o79388>