Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site oddjob.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!oddjob!matt From: matt@oddjob.UUCP (Matt Crawford) Newsgroups: net.bugs.4bsd,net.lan Subject: Sending a broadcast packet to another network Message-ID: <674@oddjob.UUCP> Date: Sun, 14-Apr-85 00:00:08 EST Article-I.D.: oddjob.674 Posted: Sun Apr 14 00:00:08 1985 Date-Received: Mon, 15-Apr-85 01:11:49 EST Reply-To: matt@oddjob.UUCP (Matt Crawford) Organization: U. Chicago, Astronomy & Astrophysics Lines: 52 Xref: watmath net.bugs.4bsd:1461 net.lan:754 At this university we have several class C networks connected by gateways. I modified our rwho daemon to send packets to selected other networks with a local-address-portion of zero. My intent was to get the gateway to perform a broadcast on an adjacent net. It didn't work, and the reason seems to be an accidental side effect of the kernel's internet output code. The gateway is actually a SUN, but we don't have source so I quote the VAX 4.2bsd code below. In netinet/ip_input.c, if a packet is to be forwarded the routine ip_forward does: error = ip_output(dtom(ip), mopt, (struct route *)0, IP_FORWARDING); while ip_output has: ip_output(m, opt, ro, flags) . . . { : : /* * Look for broadcast address and * and verify user is allowed to send * such a packet. */ if (in_lnaof(((struct sockaddr_in *)dst)->sin_addr) == INADDR_ANY) { : : if ((flags & IP_ALLOWBROADCAST) == 0) { error = EACCES; goto bad; } } : : } So the gateway's refusal to forward my packet seems to be a by-product of the restriction that only the super-user can broadcast and the need not to repeat broadcasts endlessly. Can someone out there give a good reason not to allow what I am trying to do? I would like to change the last test above to: if ((flags & (IP_ALLOWBROADCAST|IP_FORWARDING) == 0) { (If I had source for the gateways!) ipintr() would also have to be changed to forward broadcast packets whose source address is not on the destination network. This would mean that certain packets are both forwarded and passed on to the next protocol level. Comments? _____________________________________________________ Matt University crawford@anl-mcs.arpa Crawford of Chicago ihnp4!oddjob!matt