From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jul 24 08:50:04 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF692106564A for ; Tue, 24 Jul 2012 08:50:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B16A88FC19 for ; Tue, 24 Jul 2012 08:50:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6O8o3vJ084360 for ; Tue, 24 Jul 2012 08:50:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6O8o3iq084359; Tue, 24 Jul 2012 08:50:03 GMT (envelope-from gnats) Resent-Date: Tue, 24 Jul 2012 08:50:03 GMT Resent-Message-Id: <201207240850.q6O8o3iq084359@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, William Waites Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41428106564A for ; Tue, 24 Jul 2012 08:44:39 +0000 (UTC) (envelope-from root@gallows.inf.ed.ac.uk) Received: from nougat.ucs.ed.ac.uk (nougat.ucs.ed.ac.uk [129.215.13.205]) by mx1.freebsd.org (Postfix) with ESMTP id B2FBA8FC1C for ; Tue, 24 Jul 2012 08:44:38 +0000 (UTC) Received: from gallows.inf.ed.ac.uk (gallows.inf.ed.ac.uk [129.215.164.39]) by nougat.ucs.ed.ac.uk (8.13.8/8.13.4) with ESMTP id q6O8ibha002855 for ; Tue, 24 Jul 2012 09:44:37 +0100 (BST) Received: by gallows.inf.ed.ac.uk (Postfix, from userid 0) id 2C4B35E58; Tue, 24 Jul 2012 09:43:32 +0100 (BST) Message-Id: <20120724084332.2C4B35E58@gallows.inf.ed.ac.uk> Date: Tue, 24 Jul 2012 09:43:32 +0100 (BST) From: William Waites To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/170104: error setting source interface in net/mcast-tools, net/mrouted X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: William Waites List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2012 08:50:04 -0000 >Number: 170104 >Category: ports >Synopsis: error setting source interface in net/mcast-tools, net/mrouted >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jul 24 08:50:03 UTC 2012 >Closed-Date: >Last-Modified: >Originator: William Waites >Release: FreeBSD 8.2-RELEASE amd64 >Organization: University of Stirling >Environment: System: FreeBSD gallows.inf.ed.ac.uk 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Some of the older multicast utilities, such as mcastread and mcastsend from net/mcast-tools as well as the net/mrouted DVMRP routing daemon seem to use what must be an old convention for determining the source address to use. From mcastread.c, ifindex = if_nametoindex(ifname); ... /* XXX uses "0.0.0.0/8 for interface index" API */ a.s_addr = htonl(ifindex); if (setsockopt(so, IPPROTO_IP, IP_MULTICAST_IF, &a, sizeof(a)) < 0) { emsg = "setsockopt(IP_MULTICAST_IF)"; if (vflag) warn("%s", emsg); close(so); so = -1; continue; } the comment suggests what is happening here. Nevertheless, the value that is placed in a.s_addr should be an IP address that is configured on the system. Done this way it always fails. >How-To-Repeat: # mcastread -v -4 vr0 234.194.35.194 6666 mcastread: trying 234.194.35.194 mcastread: setsockopt(IP_MULTICAST_IF): Can't assign requested address mcastread: can't allocate socket Changing the a.s_addr assignment, for example hardcoding to the result of inet_addr("192.0.2.1") makes the program work. >Fix: All the affected programs need fixed, because they tend to use the device directly on the command line or in the configuration file, either their command-line syntax needs changed or some calls to getifaddrs(3) to determine a suitable address need to be made, and the results used in this setsockopt call. No patch as of yet... -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. >Release-Note: >Audit-Trail: >Unformatted: