From owner-freebsd-current@FreeBSD.ORG Tue Jun 19 22:36:47 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CD81016A41F for ; Tue, 19 Jun 2007 22:36:47 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id 7659913C457 for ; Tue, 19 Jun 2007 22:36:47 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.14.1/8.14.1/NETPLEX) with ESMTP id l5JMadZm007629; Tue, 19 Jun 2007 18:36:39 -0400 (EDT) X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-3.0 (mail.ntplx.net [204.213.176.10]); Tue, 19 Jun 2007 18:36:40 -0400 (EDT) Date: Tue, 19 Jun 2007 18:36:39 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Bruce M Simpson In-Reply-To: <4678529A.3080308@incunabulum.net> Message-ID: References: <46765CB9.9020105@incunabulum.net> <4676C30E.7040300@incunabulum.net> <4676C952.5000607@incunabulum.net> <4676D168.3050502@incunabulum.net> <4678529A.3080308@incunabulum.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Poul-Henning Kamp , Ian FREISLICH , current@freebsd.org Subject: Re: Multicast problems [PATCH] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2007 22:36:47 -0000 On Tue, 19 Jun 2007, Bruce M Simpson wrote: > Bruce M. Simpson wrote: >> >> Here is a patch which explicitly looks for an interface supporting >> multicast, if no default route exists. The KASSERT should only be triggered >> if the routing trie code is broken; it is still possible for the >> last-resort interface lookup to fail if no loopback interface exists, if >> none of the interfaces have IPv4 addresses, or if no interfaces in the >> system support multicast. > > If this patch solves your problems without resorting to adding a 224/4 route > then I shall commit it to -CURRENT. It is not relevant to RELENG_6. Please > let me know... My system's not up to date enough to test this. I do have a test program, that if runs, should be good enough. http://people.freebsd.org/~deischen/test_net.c gcc -o test_net test_net.c -lpthread machine1$ ./test_net -c -b 230.0.0.1 machine2$ ./test_net -b 230.0.0.1 Also, on a slightly different topic... I found while compiling the above test program that socklen_t is uint32_t and that causes a compile error (seen with -Wall). Solaris has: ssize_t recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from, int *fromlen); while we have: ssize_t recvfrom(int s, void * restrict buf, size_t len, int flags, struct sockaddr * restrict from, socklen_t * restrict fromlen); POSIX states that: o The header shall define the type socklen_t, which is an integer type of width of at least 32 bits; see APPLICATION USAGE. and goes on to state: o The header shall define the unsigned integer type sa_family_t. This seems to imply that our socklen_t should not be an unsigned integer (uint32_t), but a signed integer. In APPLICATION USAGE, POSIX states: To forestall portability problems, it is recommended that applications not use values larger than 23^1 -1 for the socklen_t type. I think we would be more portable if we defined socklen_t to be int32_t. -- DE