kern/26506: sendto() syscall returns EINVAL in jail environment

Lupe Christoph lupe at lupe-christoph.de
Sun Sep 14 06:40:13 PDT 2003


The following reply was made to PR kern/26506; it has been noted by GNATS.

From: lupe at lupe-christoph.de (Lupe Christoph)
To: freebsd-gnats-submit at FreeBSD.org
Cc: venglin at freebsd.lublin.pl
Subject: Re: kern/26506: sendto() syscall returns EINVAL in jail environment
Date: Sun, 14 Sep 2003 15:33:10 +0200

 The two-line patch does not work for snmpwalk. It fails on the *second*
 invocation of sendto(), with or without the patch:
 
 275   socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 6
 275   setsockopt(6, SOL_SOCKET, SO_SNDBUF, [131072], 4) = 0
 275   setsockopt(6, SOL_SOCKET, SO_RCVBUF, [131072], 4) = 0
 275   sendto(6, "0&\2\1\0\4\6public\241\31\2\4NE\335\376\2\1\0\2\1\0000"..., 40, 0, {sa_family=AF_INET, sin_port=htons(161), sin_addr=inet_addr("172.17.0.7")}, 16) = 40   
 275   gettimeofday({1063545390, 64920}, NULL) = 0   
 275   gettimeofday({1063545390, 65344}, NULL) = 0
 275   select(7, [6], NULL, NULL, {0, 999576}) = 1 (in [6])
 275   break(0x809b000)                  = 0
 275   recvfrom(6, "0\201\200\2\1\0\4\6public\242s\2\4NE\335\376\2\1\0\2\1"..., 65536, 0, {sa_family=AF_INET, sin_port=htons(161), sin_addr=inet_addr("172.17.0.8")}, [16]) = 131
 275   fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(5, 0), ...}) = 0
 275   ioctl(1, TIOCGETA, {B38400 opost isig icanon echo ...}) = 0
 275   write(1, "SNMPv2-MIB::sysDescr.0 = STRING:"..., 121) = 121
 275   sendto(6, "0)\2\1\0\4\6public\241\34\2\4NE\335\377\2\1\0\2\1\0000"..., 43, 0, {sa_family=AF_INET, sin_port=htons(161), sin_addr=inet_addr("172.17.0.7")}, 16) = -1 EINVAL (Invalid argument)
 275   write(2, "snmpwalk: Failure in sendto (Inv"..., 47) = 47
 275   close(6)                          = 0
 275   exit(1)                           = ?
 
 This is on 4.8-RELEASE-p4. Przemyslaw Frasunek's patch for 4.5-STABLE
 does not apply to 4.8-STABLE, so I can't check if that method works.
 It's possible this problem is caused by something else, anyway.
 -- 
 | lupe at lupe-christoph.de       |           http://www.lupe-christoph.de/ |
 | "Violence is the resort of the violent" Lu Tze                         |
 | "Thief of Time", Terry Pratchett                                       |


More information about the freebsd-bugs mailing list