Bug 127284

Summary: add option rwhod -n to prevent broadcast to selected interface
Product: Red Hat Enterprise Linux 3 Reporter: Alois Treindl <alois>
Component: rwhoAssignee: Phil Knirsch <pknirsch>
Status: CLOSED UPSTREAM QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: rvokal, shillman
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-08-19 15:33:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alois Treindl 2004-07-05 23:08:49 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040116

Description of problem:
rwhod sends broadcasts to all interfaces on a machine.
In a Linux LVS (load balanced server cluster) I am running,
the rwhod broadcasts on the external interface were undesired.
They create unwanted ICMP error replies from some devices (DELL RAC
cards).

Only rwho broadcasts to the internal cluster network were desired.

If iptables filtering of rwhod broadcasts are used to filter outgoing
rwho broadcasts, then rwhod itself complains (every 3 minutes) to syslog:
rwhod[2215]: sendto(BROADCAST_ADDRESS): Operation not permitted

I added a patch to rwhod.c which gives it an additionla option:
rwhod -n eth1
prevents broadcasts to interface eth1.

My simple implmentation allows only one such option, no list of
interfaces.


Version-Release number of selected component (if applicable):
rwho-0.17-18

How reproducible:
Always

Steps to Reproduce:
1.it is not a bug, but a new feature
2.
3.
    

Actual Results:  feature works: rwhod -n eth1 
does not broadcast on eth1

Additional info:

here is the patch:
--- netkit-rwho-0.17/rwhod/rwhod.c
+++ netkit-rwho-0.17.modified/rwhod/rwhod.c
@@ -118,6 +118,7 @@
 static int use_broadcast = 0;
 static int need_init = 1;
 static int child_pid = 0;
+static char *ifname_nb = NULL; /* name of no-broadcast interface */

 #define WHDRSIZE       (((caddr_t) &((struct whod *) 0)->wd_we) \
                        - ((caddr_t) 0))
@@ -143,7 +144,7 @@
                exit(1);
        }

-       while ((opt = getopt(argc, argv, "bpau:")) != EOF) {
+       while ((opt = getopt(argc, argv, "bpaun:")) != EOF) {
            switch (opt) {
              case 'b':
                  use_broadcast = 1;
@@ -158,6 +159,9 @@
              case 'u':
                  user = optarg;
                  break;
+             case 'n':
+                 ifname_nb = optarg;
+                 break;
              case '?':
              default:
                  fprintf(stderr, "usage: rwhod [-bpa] [-u user]\n");
@@ -609,6 +613,9 @@
                if (np != NULL)
                        continue;
                ifreq = *ifr;
+                if (ifname_nb != NULL && strcmp(ifname_nb,
ifr->ifr_name) == 0){
+                  continue;
+               }
                np = (struct neighbor *)malloc(sizeof (*np));
                if (np == NULL)
                        continue;

Comment 1 Suzanne Hillman 2004-07-13 21:16:30 UTC
Internal RFE bug #127788 entered.

Comment 6 Suzanne Hillman 2004-08-19 15:33:30 UTC
There is insufficient business justification for making this change.
Suggest submitting upstream.