Bug 30741 - cryptic "ipcalc: netmask expected" error
cryptic "ipcalc: netmask expected" error
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.1
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
:
: 31463 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-03-05 20:24 EST by Hunter Matthews
Modified: 2014-03-16 22:19 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-03-06 14:06:33 EST
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 Hunter Matthews 2001-03-05 20:24:08 EST
/etc/sysconfig/network 
-----------------------
NETWORKING=yes
HOSTNAME=jade.biology.duke.edu

/etc/sysconfig/network-scripts/ifcfg-eth1
-----------------------------------------
DEVICE=eth0
BOOTPROTO=static
ONBOOT=no
IPADDR=10.0.0.3
NETMASK=255.255.255.0


When I do a ifup eth1, I get 
ipcalc: netmask expected
yet it brings the interface up just fine. Same config files under 6.2/7.0 produced no error/warning.

echo's put in the ifup script show that the ipcalc that is doing this 
is the one here:
    if [ "${GATEWAYDEV}" = "" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then
        # set up default gateway
        echo GATEWAY
        if [ "${GATEWAY}" != "" -a "`ipcalc --network ${GATEWAY} ${NETMASK}`" = "NETWORK=${NETWORK}" ]; then
            route add default gw ${GATEWAY} ${DEVICE}
            DEFGW=${GATEWAY}
        elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then
            route add default ${DEVICE}
        fi
        echo end GATEWAY
    fi

but as that ipcalc call is the same as one before. Some goofy echo's 
in there show that the NETMASK variable is getting set, but I don't know why ipcalc isn't "seeing" it.

(For reference, this laptop doesn't have 2 ethernet interfaces - I use
eth1 as an alternate config file for a different network.)

If you need more info, please email.
Comment 1 Bill Nottingham 2001-03-05 21:16:54 EST
You don't have a gateway set. Is that intentional?
Comment 2 Hunter Matthews 2001-03-06 11:00:58 EST
Yes. Its a local only network, with no connection (not even a modem) to 
the outside world.
Comment 3 Bill Nottingham 2001-03-06 12:09:11 EST
What is GATEWAY getting set to in that script?
Comment 4 Hunter Matthews 2001-03-06 12:49:08 EST
BUGZILLA IS HAVING A BAD DAY.

Text has been lost in this bug - twice now I've seen the midair collision error.

-----------------------------------------------------------------------------
Bill, in answer to your question of "Is $GATEWAY being set at all?" The 
answer is no, which is why ipcalc is erroring out - its not seeing two variables like it expects.

As a workaround, I can set a fake $GATEWAY, but I still claim thats a bug
in the script (not handling a missing var with a most explicit error message). But its not a major bug in any case.
Comment 5 Bill Nottingham 2001-03-06 14:06:30 EST
That's what's confusing me. The case where there is no $GATEWAY should
be caught by the check if [ "$GATEWAY" != "" ... ]
Comment 6 Bill Nottingham 2001-03-11 21:52:20 EST
Will be fixed in 5.71-1.
Comment 7 Bill Nottingham 2001-03-11 21:52:29 EST
*** Bug 31463 has been marked as a duplicate of this bug. ***

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