Next-in-Thread Next Message

Idea Nit in 3.0.14 pcmcia/network script 

Forum: PCMCIA Network Adapter Issues
Date: 2000, Feb 26
From: Glen Ditchfield gjditchfield

My network.opts script used to contain

    # Host's IP address, netmask, network address, broadcast address
    IPADDR="192.168.0.1"
    #NETMASK=""
    #NETWORK=""
    #BROADCAST=""

This worked, but /var/log/messages contained warning messages:

	...cardmgr[361]: executing: './network start eth0'
	...cardmgr[361]: + Usage:
	...cardmgr[361]: +   ifconfig [-a] [-i] [-v] <interface> [[<AF>] <address>]
	...cardmgr[361]: +   [add <address>[/<prefixlen>]]
	...

The problem was that NETWORK wasn't set when network executed the lines

        # Basic network setup
        BC=${BROADCAST:+broadcast $BROADCAST}
        /sbin/ifconfig $DEVICE up $IPADDR netmask $NETMASK $BC

Shouldn't the 'netmask' parameter be guarded in the same way as 'broadcast'?

***************
*** 75,86 ****
      if [ "$IPADDR" ] ; then

  	# Basic network setup
  	BC=${BROADCAST:+broadcast $BROADCAST}
! 	/sbin/ifconfig $DEVICE up $IPADDR netmask $NETMASK $BC

  	if [ "$NETWORK" ] ; then
  	    /sbin/ifuser $DEVICE $NETWORK || \
! 		/sbin/route add -net $NETWORK netmask $NETMASK dev $DEVICE
  	elif [ "$GATEWAY" ] ; then
  	    /sbin/ifuser $DEVICE $GATEWAY || \
  		/sbin/route add $GATEWAY $DEVICE
--- 75,87 ----
      if [ "$IPADDR" ] ; then

  	# Basic network setup
+ 	NM=${NETMASK:+netmask $NETMASK}
  	BC=${BROADCAST:+broadcast $BROADCAST}
! 	/sbin/ifconfig $DEVICE up $IPADDR $NM $BC

  	if [ "$NETWORK" ] ; then
  	    /sbin/ifuser $DEVICE $NETWORK || \
! 		/sbin/route add -net $NETWORK $NM dev $DEVICE
  	elif [ "$GATEWAY" ] ; then
  	    /sbin/ifuser $DEVICE $GATEWAY || \
  		/sbin/route add $GATEWAY $DEVICE

Next-in-Thread Next Message

Messages Inline: 1 All Outline: 1 2 All

1. None You're right by David Hinds, 2000, Feb 28

Add Message to: "Nit in 3.0.14 pcmcia/network script"

Members Subscribe Admin Mode Show Frames Help for HyperNews at pcmcia-cs.sourceforge.net 1.10