From owner-freebsd-net@FreeBSD.ORG Sat Nov 13 12:19:24 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 78ECB16A4CE for ; Sat, 13 Nov 2004 12:19:24 +0000 (GMT) Received: from zibbi.icomtek.csir.co.za (zibbi.icomtek.csir.co.za [146.64.24.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id EADEA43D1D for ; Sat, 13 Nov 2004 12:19:21 +0000 (GMT) (envelope-from jhay@icomtek.csir.co.za) Received: from zibbi.icomtek.csir.co.za (localhost [127.0.0.1]) iADCJJZV059737 for ; Sat, 13 Nov 2004 14:19:19 +0200 (SAST) (envelope-from jhay@zibbi.icomtek.csir.co.za) Received: (from jhay@localhost) by zibbi.icomtek.csir.co.za (8.12.10/8.12.10/Submit) id iADCJJl5059736 for freebsd-net@freebsd.org; Sat, 13 Nov 2004 14:19:19 +0200 (SAST) (envelope-from jhay) Date: Sat, 13 Nov 2004 14:19:18 +0200 From: John Hay To: freebsd-net@freebsd.org Message-ID: <20041113121918.GA59462@zibbi.icomtek.csir.co.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: multicast socket behaviour on IPv4 and IPv6 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2004 12:19:24 -0000 Hi Guys, While debugging a misbehaving program, I found that on FreeBSD, if you bind() a udp socket to a multicast address, so that you can receive on it, and you then mistakenly use it to send, the behaviour between IPv4 and IPv6 differ. On IPv6 you get a error EOPNOTSUPP, which is understandable, but on IPv4 the packet is actually send with the source address being the multicast address. Is that the expected behaviour? Looking through the code, I see that in IPv6 there is a lot of sanity checks in the output routine, but very little to check the source address in the IPv4 output routine. John -- John Hay -- John.Hay@icomtek.csir.co.za / jhay@FreeBSD.org