From owner-freebsd-net Fri Dec 6 15:28:21 2002 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 90CF437B401 for ; Fri, 6 Dec 2002 15:28:19 -0800 (PST) Received: from mail-out2.apple.com (mail-out2.apple.com [17.254.0.51]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E46A43EBE for ; Fri, 6 Dec 2002 15:28:19 -0800 (PST) (envelope-from jgraessley@apple.com) Received: from mailgate1.apple.com (A17-128-100-225.apple.com [17.128.100.225]) by mail-out2.apple.com (8.11.3/8.11.3) with ESMTP id gB6NSII26946 for ; Fri, 6 Dec 2002 15:28:18 -0800 (PST) Received: from scv3.apple.com (scv3.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.2.5) with ESMTP id for ; Fri, 6 Dec 2002 15:27:56 -0800 Received: from apple.com (graejo.apple.com [17.202.40.111]) by scv3.apple.com (8.11.3/8.11.3) with ESMTP id gB6NSI920668 for ; Fri, 6 Dec 2002 15:28:18 -0800 (PST) Date: Fri, 6 Dec 2002 15:28:15 -0800 Subject: Re: broadcast over loopback Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v548) From: Joshua Graessley To: freebsd-net@FreeBSD.ORG Content-Transfer-Encoding: 7bit In-Reply-To: <3DEFF442.6030203@obluda.cz> Message-Id: <65242A88-0972-11D7-AE67-000393760260@apple.com> X-Mailer: Apple Mail (2.548) Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Thank you for the reply Dan! I am aware of the issues with broadcast, and I strongly urge people to use multicast instead of broadcast for a variety of reasons. All the same, I've been asked to address this issue and I wanted to understand why FreeBSD doesn't allow broadcast on the loopback interface. Conceptually, it sort of makes sense to allow it. Using a broadcast should result in everyone on some link receiving your packet. If loopback is your only interface that's up, then why not use that? In the case of loopback, you are the only one on your link, so you should still receive your broadcast. Is there a technical reason this was done (i.e. if I set the broadcast flag on loopback I'll be chasing down other bugs until my hair turns grey or falls out) or is it a conceptual reason (i.e. broadcast, on loopback, are you out of your mind?). Other platforms out there will handle broadcast on the loopback interface. Is it desirable to make changes to the FreeBSD stack to get this behavior? Thanks, -josh On Thursday, December 5, 2002, at 04:50 PM, Dan Lukes wrote: > jgraessley@apple.com wrote, On 12/05/02 20:41: > >> Is there a reason that the broadcast flag is not set on the loopback >> interface? It seems like it might be useful to allow applications that >> use broadcast to continue to work even when loopback is the only >> interface. > > Your application shouldn't use broadcast unless it knows it run in > broadcast capable environment or it shouldn't refuse to run when it > cannot send a packet - as it doesn't care where it's packets are sent > to. > > > BTW, the broadcast are handled in mad way in TCP/IP stack already - > the destination of 255.255.255.255 is silently rewritten to network > broadcast and sent over first interface (if it is broadcast capable) > or it is routed (often to default route). You can't send the > non-network broadcast to interface of your choice (unless you use > bpf). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message