From owner-freebsd-net@FreeBSD.ORG Tue Jul 1 14:46:06 2003 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 A277237B401 for ; Tue, 1 Jul 2003 14:46:06 -0700 (PDT) Received: from hole.shrew.net (cs24354-246.austin.rr.com [24.243.54.246]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6267D44005 for ; Tue, 1 Jul 2003 14:46:05 -0700 (PDT) (envelope-from mgrooms@shrew.net) Received: from mail.shrew.net (localhost.shrew.net [127.0.0.1]) by hole.shrew.net (8.12.9/8.12.9) with SMTP id h61LkXOW001888; Tue, 1 Jul 2003 21:46:34 GMT (envelope-from mgrooms@shrew.net) Message-Id: <200307012146.h61LkXOW001888@hole.shrew.net> Received: from 65.118.63.254 (auth. user mgrooms@mail.shrew.net) by mail.shrew.net with HTTP; Tue, 01 Jul 2003 21:46:33 +0000 To: "Chuck Swiger" Date: Tue, 01 Jul 2003 21:46:33 +0000 X-Mailer: IlohaMail/0.8.7 (On: mail.shrew.net) In-Reply-To: <3F01DA79.4080709@mac.com> From: "Matthew Grooms" Bounce-To: "Matthew Grooms" Errors-To: "Matthew Grooms" MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable cc: "freebsd-net@freebsd.org" Subject: Re: broadcast udp packets ... 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: Tue, 01 Jul 2003 21:46:06 -0000 Well, Ok, sounds stupid right, well here is a bit of background. My friend and I have an IPSEC tunnel in between our two private networks connected by BSD firewalls w/ cable modems. Without going into too much detail, certain programs ( win32 games ) use all-routes broadcasts to advertise the info pertaining to the workstaion hosting a particular game. After much searching, I could find no mechanism in FreeBSD that would allow me to pass these broadcasts from a private network, across the IPSEC tunnel and to the distant private network. ( tried all sorts of nat and bridging configurations ) As a result, I decided to write a small relay daemon that used bpf to pick up the broadcast messages from the local private network, forward them to a peer that in turn drops it on to the distant private network. ( I know, its a lot of work to play a game but it sounded like a fun project ) In any case, I have most of it working well but am getting loops when the bpf dropps the packet on the wire at the far end. It reads the packet in after writing it out and forwards it back to the originating relay partner, just like a really bad pong game. Setting BIOCSSEESENT on the fd does not seem to do the trick. Any Ideas? In any case, I wrote a quick little program to generate a broadcast message for use with testing the relay daemon ( I got tired of waiting for bootp requests to be picked up by my cable modem as a test case ). Unfortunately, I can never get the test program generate an all-routes broadcast, they always come out as network directed broadcasts. ... If there is not a more conventional way of going about it, I guess I will just have to generate one using the bpf. On 7/1/2003, "Chuck Swiger" wrote: >Matthew Grooms wrote: >> Is there any way to generate a udp broadcast ( all routes >> 255.255.255.255 ) packet using a standard sendto() without it being >> translated into a local network broadcast? Is this just not "allowed"? > >Are you trying to use 255.255.255.255 to reach something not on a local subnet? > >If you have multiple interfaces, a broadcast to 255.255.255.255 should go out on >all of them. That being said, the all-ones broadcast address means "all local >networks", and most routers will block such traffic from passing on in any event. > >-- >-Chuck >