From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 23 16:17:22 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A3BB16A404 for ; Fri, 23 Mar 2007 16:17:22 +0000 (UTC) (envelope-from steve@Watt.COM) Received: from wattres.watt.com (wattres.watt.com [66.93.133.130]) by mx1.freebsd.org (Postfix) with ESMTP id DF3D613C4C3 for ; Fri, 23 Mar 2007 16:17:21 +0000 (UTC) (envelope-from steve@Watt.COM) Received: from wattres.watt.com (localhost.watt.com [127.0.0.1]) by wattres.watt.com (8.13.8/8.13.8) with ESMTP id l2NGHG55074162; Fri, 23 Mar 2007 09:17:21 -0700 (PDT) (envelope-from steve@wattres.watt.com) Received: (from steve@localhost) by wattres.watt.com (8.13.8/8.13.8/Submit) id l2NGHDlu074159; Fri, 23 Mar 2007 09:17:13 -0700 (PDT) (envelope-from steve) Message-Id: <200703231617.l2NGHDlu074159@wattres.watt.com> X-Newsgroups: local.freebsd-hackers In-Reply-To: <200703221201.35028.doconnor@gsoft.com.au> From: steve@Watt.COM (Steve Watt) Organization: Watt Consultants, San Jose, CA, USA Date: Fri, 23 Mar 2007 09:17:13 -0700 X-Mailer: Mail User's Shell (7.2.6 beta(5) 10/07/98) To: doconnor@gsoft.com.au X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (wattres.watt.com [127.0.0.1]); Fri, 23 Mar 2007 08:17:21 -0800 (PST) X-Archived: 1174666641.368493844@wattres.Watt.COM Cc: freebsd-hackers@freebsd.org Subject: Re: sendto() giving EPERM outside a jail X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Mar 2007 16:17:22 -0000 In <200703221201.35028.doconnor@gsoft.com.au>, Daniel O'Connor wrote: >Hi, >I am trying to port miniupnpd (http://miniupnp.tuxfamily.org/) and by in large >it seems to work fine (evil idea as it is :) However it spews out a lot of.. >miniupnpd[13010]: sendto(udp_notify): Operation not permitted > >According to my reading of the man page it is not possible to get this error >unless I'm using jails (which I'm not). The code in question does.. That's probably a buglet in the man page. >memset(&sockname, 0, sizeof(struct sockaddr_in)); >sockname.sin_family = AF_INET; >sockname.sin_port = htons(PORT); >sockname.sin_addr.s_addr = inet_addr(UPNP_MCAST_ADDR); >while(known_service_types[i]) >{ > snprintf(bufr, sizeof(bufr), > "NOTIFY * HTTP/1.1\r\n" > "HOST:%s:%d\r\n" >... > n = sendto(s, bufr, strlen(bufr), 0, > (struct sockaddr *)&sockname, sizeof(struct sockaddr_in) ); > >(line 278 of miniupnpd.c). > >Can someone shed light on what the problem is? The application appears to work >fine even with this error though. man setsockopt, search for SO_BROADCAST. -- Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.5" / 37N 20' 15.3" Internet: steve @ Watt.COM Whois: SW32-ARIN Free time? There's no such thing. It just comes in varying prices...