Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 157418 - sys-apps/baselayout-1.12.6 bad logic in /lib/rcscripts/net/ifconfig.sh
Summary: sys-apps/baselayout-1.12.6 bad logic in /lib/rcscripts/net/ifconfig.sh
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-07 04:41 UTC by Alexander Zubkov
Modified: 2006-12-12 03:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Zubkov 2006-12-07 04:41:23 UTC
ifconfig.sh execs this code when in routes there is no "-net" or "-host" to determine what it is:
#######################
if [[ ${y} == *.*.*.* && ${y} != *.*.*.0 && ${y} != *.*.*.0/* ]] ; then
    x="-host ${x}"
else
    x="-net ${x}"
fi
#######################

I thik this code contains bad logic:
1) ${y} != *.*.*.0
There is hosts, that ends in .0 it is error to make this net. If someone want such advanced logic, then it must use ip classes. Because for A class 10.2.2.0 is the host ip. It should be matched as *.0.0.0 to be correct. There will be error:

# route add -net 10.2.2.0 gw GW_IP
SIOCADDRT: Invalid argument

2) ${y} != *.*.*.0/*
a) There is nets not ending in .0 and so 10.2.2.128/25 will end in error.
b) 192.168.14.0/32 - is host, and not net.
# route add -net 192.168.14.0/32 gw GW_IP
SIOCADDRT: Invalid argument
Comment 1 Roy Marples (RETIRED) gentoo-dev 2006-12-12 03:18:08 UTC
Fixed in 1.12.7 and 1.13.0_alpha9

Basically we now assume a host unless a netmask or a cidr is provided (/32 is now a host)