Bug 30741 - cryptic "ipcalc: netmask expected" error
Summary: cryptic "ipcalc: netmask expected" error
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.1
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
URL:
Whiteboard:
: 31463 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-03-06 01:24 UTC by Hunter Matthews
Modified: 2014-03-17 02:19 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2001-03-06 19:06:33 UTC
Embargoed:


Attachments (Terms of Use)

Description Hunter Matthews 2001-03-06 01:24:08 UTC
/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-06 02:16:54 UTC
You don't have a gateway set. Is that intentional?

Comment 2 Hunter Matthews 2001-03-06 16:00:58 UTC
Yes. Its a local only network, with no connection (not even a modem) to 
the outside world.

Comment 3 Bill Nottingham 2001-03-06 17:09:11 UTC
What is GATEWAY getting set to in that script?

Comment 4 Hunter Matthews 2001-03-06 17:49:08 UTC
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 19:06:30 UTC
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-12 02:52:20 UTC
Will be fixed in 5.71-1.

Comment 7 Bill Nottingham 2001-03-12 02:52:29 UTC
*** 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.