[dhcwg] question about basic broadcast

Ranganath Sudarshan <tsranga@stanford.edu> Thu, 27 September 2001 23:53 UTC

Received: from optimus.ietf.org (ietf.org [132.151.1.19] (may be forged)) by ietf.org (8.9.1a/8.9.1a) with ESMTP id TAA15684; Thu, 27 Sep 2001 19:53:04 -0400 (EDT)
Received: from optimus.ietf.org (localhost [127.0.0.1]) by optimus.ietf.org (8.9.1a/8.9.1) with ESMTP id TAA08507; Thu, 27 Sep 2001 19:52:11 -0400 (EDT)
Received: from ietf.org (odin [132.151.1.176]) by optimus.ietf.org (8.9.1a/8.9.1) with ESMTP id SAA06350 for <dhcwg@ns.ietf.org>; Thu, 27 Sep 2001 18:29:46 -0400 (EDT)
Received: from mail.bucknell.edu (marge.bucknell.edu [134.82.9.1]) by ietf.org (8.9.1a/8.9.1a) with ESMTP id SAA14552 for <dhcwg@ietf.org>; Thu, 27 Sep 2001 18:29:44 -0400 (EDT)
Received: from fable5.Stanford.EDU (fable5.Stanford.EDU [171.64.15.198]) by mail.bucknell.edu (8.11.6/8.11.6) with ESMTP id f8RMTki19365 for <dhcp-v4@bucknell.edu>; Thu, 27 Sep 2001 18:29:46 -0400 (EDT)
Received: (from tsranga@localhost) by fable5.Stanford.EDU (8.11.6/8.11.6) id f8RMTds11590; Thu, 27 Sep 2001 15:29:39 -0700 (PDT)
Date: Thu, 27 Sep 2001 15:29:39 -0700
From: Ranganath Sudarshan <tsranga@stanford.edu>
To: dhcp-v4@bucknell.edu
Message-ID: <Pine.GSO.4.33.0109271518260.11576-100000@fable5.Stanford.EDU>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset="US-ASCII"
Subject: [dhcwg] question about basic broadcast
Sender: dhcwg-admin@ietf.org
Errors-To: dhcwg-admin@ietf.org
X-Mailman-Version: 1.0
Precedence: bulk
List-Id: <dhcwg.ietf.org>
X-BeenThere: dhcwg@ietf.org

Hi,
I was trying to get the following scenario to work:

On one machine on the LAN, you have a Java program listening on some port
X for datagram packets coming in.

On another box, which is running FreeBSD and which does NOT have an IP
address configured (pre-DHCP configuration), I want to have code which
broadcasts a message to 255.255.255.255, port X, and I want the other box
running Java to pick up this datagram packet.

int on = 1;
char *msg = strdup("message");
sockfd = socket(AF_INET, SOCK_DGRAM, 0);
setsockopt(sockfd, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
their_addr.sin_family = AF_INET;
their_addr.sin_port = htons(MYPORT);
their_addr.sin_addr.s_addr = inet_addr("255.255.255.255");
memset(&(their_addr.sin_zero), '\0', 8);
numbytes = sendto(sockfd, msg, strlen(msg), MSG_DONTROUTE);

numbytes is returned as -1 and the error: Network is Unreachable is
returned.

Does anyone know what the problem may be?  My basic aim is to have the
FreeBSD box without IP configured be able to communicate with my box
running a Java Datagram listener.  I would greatly appreciate any help on
this matter.  I realize that the problem is a subset of what DHCP enables
one to do, but I wish to only have this simple functionality, and not all
of the DHCP protocol.

Thanks,
RTS



_______________________________________________
dhcwg mailing list
dhcwg@ietf.org
http://www1.ietf.org/mailman/listinfo/dhcwg