home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.vxworks
- Path: sparky!uunet!gumby!wupost!csus.edu!netcom.com!hjb
- From: hjb@netcom.com (H. J. Bae)
- Subject: Re: More on broadcast problem
- Message-ID: <1993Jan10.184053.9292@netcom.com>
- Organization: Peaceful Star Project
- References: <9301081857.AA11564@cinnabar.netx.com>
- Date: Sun, 10 Jan 1993 18:40:53 GMT
- Lines: 73
-
- In article <9301081857.AA11564@cinnabar.netx.com> thoff@netxwest.com (Todd Hoff) writes:
- >The suggestion here is that code resolving IP addresses isn't looking
- >at the subnet mask. Is seems the broadcast IP address is not recognized
- >as such and is forwarded to the router where the router
- >of course will not forward the broadcast.
-
- here's in_broadcastaddr() from the tahoe code:
-
- /*
- * Return 1 if the address might be a local broadcast address.
- */
- in_broadcast(in)
- struct in_addr in;
- {
- register struct in_ifaddr *ia;
- u_long t;
-
- /*
- * Look through the list of addresses for a match
- * with a broadcast address.
- */
- for (ia = in_ifaddr; ia; ia = ia->ia_next)
- if (ia->ia_ifp->if_flags & IFF_BROADCAST) {
- if (satosin(&ia->ia_broadaddr)->sin_addr.s_addr == in.s_addr)
- return (1);
- /*
- * Check for old-style (host 0) broadcast.
- */
- if ((t = ntohl(in.s_addr)) == ia->ia_subnet || t == ia->ia_net)
- return (1);
- }
- if (in.s_addr == INADDR_BROADCAST || in.s_addr == INADDR_ANY)
- return (1);
- return (0);
- }
-
-
- the only reason this could fail would be some incorrect configuration
- some where (at some participating node). if you're suspecting vxworks
- for not recognizing subnet bcast ip address as such, you can call
- in_broadcast from the shell or write a small piece of code to find out.
- using the shell's built-in debugger (assembly) you could single step
- to track down the exact behavior, if you'd like. but, as the code says,
- if netif bcast ip address is incorrectly set on some node, this code
- will return 0.
-
- if you have a traditional network (the one that has one network/subnet
- per physical segment of ethernet) and your target machine is not
- multi-homed, it is also legal to use all 1's ip address to indicate
- "broadcast to the immediately attached networks only". trying
- "255.255.255.255", for example, should work and you can avoid
- the headaches.
-
- the issue regarding the route entry: ip_output() has to be able to
- resolve the route entry for the given destination address -- to
- fetch the netif pointer used throughout (including arpresolve process
- which uses in_broadcast before actually sending out any arp req's).
- i'd still maintain that you need to keep correct route tables for
- the subnets. given that, and given that the correct netif (which
- will be in the route entry returned by rtalloc) has correct broadcast
- address proper for the subnet, things should work. all participating
- machines should be checked for this. [as i'm not still sure of your
- exact configuration]
-
- if someone has any insight, i'm very interested to hear... [guess
- i'm just very very curious.... :-) ] thanks
-
- hwajin
-
- --
- Peaceful Star Project hjb@netcom.com
- 2899 Ford Street Available for peaceful, responsible work only.
- Oakland, CA 94601 (510) 536-7607
-