Bug 29071

Summary: relay patch for rwhod
Product: Base System Reporter: Scott Hazen Mueller <scott>
Component: binAssignee: Ceri Davies <ceri>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.3-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Scott Hazen Mueller 2001-07-19 01:00:02 UTC
Enclosed please find a small patch to add a '-r' flag (and underlying support)
to rwhod.  Enabling '-r' turns the daemon into a relay so that it repeats
broadcasts it receives on all interfaces.  This allows a FreeBSD router to
relay rwho packets across multiple subnets w/o using multicast support.  Only
the relay needs to run the modified rwhod and enable relaying; the leaf nodes
need no changes.

Please note that this patch writes a byte of foo into the 'wd_pad' area of the
whod structure so that it can identify packets that it has already touched and
refrain from relaying them again...

How-To-Repeat: 
First, admit to using rwho.

"Hi, my name is Scott, and I use rwho."

Second, decide you'd like machines on different nets, tunneled together over
PPP tunnels, to exchange rwhod data.

Third, find yourself unable to get multicasting and rwhod -m to work.
Comment 1 Brian Somers 2001-07-19 01:23:17 UTC
> >Number:         29071
> >Category:       bin
> >Synopsis:       relay patch for rwhod

I like this idea -- I've thought of doing likewise myself before.

However, I'm not sure I like the idea of sending the packet back out 
with a special X marker.  I'd prefer if the target network(s) could 
be specified:

  rwhod -r 172.17.10.255 -r 10.0.0.255 etc

If rwhod kept a note of the payload it sends out, and simply makes 
sure it doesn't send the same thing out twice in a row within (say) 
15 seconds, it may be better ?  This could be implemented fairly 
easily by just maintaining a list of timestamped outbound packets 
and expiring them when it notices they're out of date....
-- 
Brian <brian@freebsd-services.com>                <brian@Awfulhak.org>
      http://www.freebsd-services.com/        <brian@[uk.]FreeBSD.org>
Don't _EVER_ lose your sense of humour !      <brian@[uk.]OpenBSD.org>
Comment 2 Scott Hazen Mueller 2001-07-19 02:14:05 UTC
>> >Number:         29071
>> >Category:       bin
>> >Synopsis:       relay patch for rwhod

>However, I'm not sure I like the idea of sending the packet back out with a
>special X marker.  I'd prefer if the target network(s) could be specified:

That part of it is inelegant, to say the least.  I looked at trying to
identify the source address and using that for loop control...however, that's
harder than it appears.  The send socket is (of course) bound with INADDR_ANY
(if anything, the structure is actually bzero'ed), so while we get an address
in the received packet, it's moderately hard(*) to correlate it back to our-
selves.  The Right Thing, of course, is to maintain a list of our interface
addresses, and compare all of those against the address in the received
packet.

(*) Moderately hard here means well beyond my exceedingly rusty C programming
skills.

>  rwhod -r 172.17.10.255 -r 10.0.0.255 etc

Assuming connected interfaces, this probably would work.  rwhod builds a list
of "neighbors" when it starts up, so these -r addresses could just be inserted
into the neighbor list...  Question, here, though - syntactically, is the
intent to relay packets from anywhere to 172.17.10.255 & 10.0.0.255, or
packets from 172.17.10.255 & 10.0.0.255 to all interfaces?  Probably the
former, but just checking.  My hack just does all to all...

>If rwhod kept a note of the payload it sends out, and simply makes sure it
>doesn't send the same thing out twice in a row within (say) 15 seconds, it
>may be better ?  This could be implemented fairly easily by just maintaining
>a list of timestamped outbound packets and expiring them when it notices
>they're out of date....

I think looking for it's own interface address(es) as the source would be the
cleaner solution, but I'm not 100% confident it's easily implementable.  This
would be the next best thing.

                                \scott
Comment 3 Jens Schweikhardt freebsd_committer freebsd_triage 2002-08-12 21:55:19 UTC
State Changed
From-To: open->feedback

I think we would need a patch against a recent -current. This patch must 
also include an updated manpage before it could be committed. The C part 
should as much as possible conform to style(9).
Comment 4 Ceri Davies freebsd_committer freebsd_triage 2003-06-08 19:01:53 UTC
State Changed
From-To: feedback->closed

Feedback timeout (6 months or more). 
I will handle any feedback that this closure generates. 


Comment 5 Ceri Davies freebsd_committer freebsd_triage 2003-06-08 19:01:53 UTC
Responsible Changed
From-To: freebsd-bugs->ceri

Feedback timeout (6 months or more). 
I will handle any feedback that this closure generates.