Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 8030

Summary: net.eth0 does not work for multiple aliases
Product: Gentoo Linux Reporter: naanyaar2000
Component: [OLD] Core systemAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: 1.2   
Hardware: x86   
OS: Linux   
URL: http://forums.gentoo.org/viewtopic.php?t=15337
Whiteboard:
Package list:
Runtime testing required: ---

Description naanyaar2000 2002-09-17 08:24:04 UTC
In /etc/init.d/net.eth0, lines that say something like:

aliasbcast="$(eval echo \$\{broadcast_${IFACE}\} \| awk
\'\{ print \$${num} \}\')"
...
aliasnmask="$(eval echo \$\{netmask_${IFACE}\} \| awk \'
\{ print \$${num} \}\')"

should actually be:

aliasbcast="$(eval echo \$\{broadcast_${IFACE}\} \| awk
\'\{ print \$${num+1} \}\')"
...
aliasnmask="$(eval echo \$\{netmask_${IFACE}\} \| awk \'
\{ print \$${num+1} \}\')"

That is, 'num' should actually be 'num+1'  since $0 == whole record in awk. 
Note that it works OK for a single alias since $0 == $1 in that case.
Comment 1 SpanKY gentoo-dev 2002-09-17 13:18:13 UTC
post to Bug 7407 ... they are still pondering how to implement it

*** This bug has been marked as a duplicate of 7407 ***
Comment 2 naanyaar2000 2002-09-17 15:29:44 UTC
Oops... typo alert.

It should be $((num+1)) above in the fixed version.