Bug 12111 - Bug in ifup setting [-]arp (and enhancement)
Summary: Bug in ifup setting [-]arp (and enhancement)
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 6.2
Hardware: i386
OS: Linux
low
low
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-06-12 03:50 UTC by Ian Mortimer
Modified: 2016-12-09 14:50 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-06-12 03:50:36 UTC
Embargoed:


Attachments (Terms of Use)

Description Ian Mortimer 2000-06-12 03:50:35 UTC
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 07:46:30 UTC
This will be in initscripts-5.53-1 - thanks for the enhancement.

Comment 2 openshift-github-bot 2016-12-09 14:50:11 UTC
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.