Bug 12111 - Bug in ifup setting [-]arp (and enhancement)
Bug in ifup setting [-]arp (and enhancement)
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
6.2
i386 Linux
low Severity low
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-06-11 23:50 EDT by Ian Mortimer
Modified: 2016-12-09 09:50 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-06-11 23:50:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ian Mortimer 2000-06-11 23:50:35 EDT
The initscripts documentation (sysconfig.txt) says you can 
set ARP=yes|no in ifcfg-eth?.  
The line of code which implements this is:

   ifconfig ${DEVICE} ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
${ARP:+arp}

This will turn arp on no matter what ARP is set to in the 
configuration file and provides no way of turning it off.

In addition it would be nice to have a similar mechanism
for turning promiscuous mode on and off.  And while we're
at it we might as well throw in the other toggle allmulti.

Here is my suggested patch for ifup to fix arp and add the 
same functionality for promisc and allmulti:

> diff -u ifup.orig ifup
--- ifup.orig   Mon Jun 12 13:18:29 2000
+++ ifup        Mon Jun 12 13:12:33 2000
@@ -4,6 +4,21 @@
 cd /etc/sysconfig/network-scripts
 . network-functions

+# Return the value of a toggle.  $1 is toggle name, $2 is yes|no|null.
+toggle_value ()
+{
+   if [ -z $2 ]
+   then
+      echo ''
+   elif [ $2 = yes  -o $2 = YES ] ; then
+      echo "$1"
+   elif [ $2 = no  -o $2 = NO ] ; then
+      echo "-$1"
+   else
+      echo ''
+   fi
+}
+
 need_hostname

 CONFIG=$1
@@ -108,7 +123,10 @@
        eval `/bin/ipcalc --network ${IPADDR} ${NETMASK}`
     fi

-    ifconfig ${DEVICE} ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
${ARP:+arp}
+    ifconfig ${DEVICE} ${IPADDR} netmask ${NETMASK} broadcast ${BROADCAST}
\
+       $(toggle_value arp $ARP) \
+       $(toggle_value promisc $PROMISC) \
+       $(toggle_value allmulti $ALLMULTI)
     # don't re-add subnet route on 2.2 kernels, but add a route
     # to a non-local subnet.
     # stupid hack, but it should work

And here is the corresponding patch for the documentation:

> diff -u sysconfig.txt.orig sysconfig.txt
--- sysconfig.txt.orig  Mon Jun 12 13:18:46 2000
+++ sysconfig.txt       Mon Jun 12 13:18:24 2000
@@ -329,6 +329,8 @@
     Managed from /etc/sysconfig/network-scripts/ifup-ipx
     ARP=yes|no (adds 'arp' flag to ifconfig, for use with the
       ethertap device)
+    PROMISC=yes|no (enable or disable promiscuous mode)
+    ALLMULTI=yes|no (enable or disable all-multicast mode)

   PPP/SLIP items:
     PERSIST=yes|no


Ian
Comment 1 Bill Nottingham 2000-12-12 02:46:30 EST
This will be in initscripts-5.53-1 - thanks for the enhancement.
Comment 2 openshift-github-bot 2016-12-09 09:50:11 EST
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/69afb3a0d129da37c00702f78ba20171af654a92
Merge pull request #12138 from jim-minter/issue12111

Merged by openshift-bot

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