Bug 127284 - add option rwhod -n to prevent broadcast to selected interface
add option rwhod -n to prevent broadcast to selected interface
Status: CLOSED UPSTREAM
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: rwho (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Knirsch
Ben Levenson
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-07-05 19:08 EDT by Alois Treindl
Modified: 2015-03-04 20:14 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-19 11:33:30 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Alois Treindl 2004-07-05 19:08:49 EDT
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 17:16:30 EDT
Internal RFE bug #127788 entered.
Comment 6 Suzanne Hillman 2004-08-19 11:33:30 EDT
There is insufficient business justification for making this change.
Suggest submitting upstream.

Note You need to log in before you can comment on or make changes to this bug.