/[vps]/baselayout-vserver/branches/baselayout-1_12/net-scripts/net/ifconfig.sh
Gentoo

Diff of /baselayout-vserver/branches/baselayout-1_12/net-scripts/net/ifconfig.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 435 Revision 436
327# Returns 0 (true) when successful on the primary interface, non-zero 327# Returns 0 (true) when successful on the primary interface, non-zero
328# (false) when the primary interface fails. Aliases are allowed to 328# (false) when the primary interface fails. Aliases are allowed to
329# fail, the routine should still return success to indicate that 329# fail, the routine should still return success to indicate that
330# net.eth0 was successful 330# net.eth0 was successful
331ifconfig_post_start() { 331ifconfig_post_start() {
332 local iface="$1" ifvar=$(bash_variable "$1") x= metric= mtu= cidr= 332 local iface="$1" ifvar=$(bash_variable "$1") x= y= metric= mtu=
333 local -a routes=() 333 local -a routes=()
334 metric="metric_${ifvar}" 334 metric="metric_${ifvar}"
335 335
336 ifconfig_exists "${iface}" || return 0 336 ifconfig_exists "${iface}" || return 0
337 337
355 355
356 # Support iproute2 style routes 356 # Support iproute2 style routes
357 x="${x//via/gw} " 357 x="${x//via/gw} "
358 x="${x//scope * / }" 358 x="${x//scope * / }"
359 359
360 # Assume we're a net device unless told otherwise 360 # Work out if we're a host or a net if not told
361 [[ " ${x} " != *" -net "* && " ${x} " != *" -host "* ]] && x="-net ${x}" 361 if [[ " ${x} " != *" -net "* && " ${x} " != *" -host "* ]] ; then
362 y="${x%% *}"
363 if [[ ${y} == *.*.*.* && ${y} != *.*.*.0 && ${y} != *.*.*.0/* ]] ; then
364 x="-host ${x}"
365 else
366 x="-net ${x}"
367 fi
368 fi
362 369
363 # Support adding IPv6 addresses easily 370 # Support adding IPv6 addresses easily
364 if [[ ${x} == *:* ]]; then 371 if [[ ${x} == *:* ]]; then
365 [[ ${x} != *"-A inet6"* ]] && x="-A inet6 ${x}" 372 [[ ${x} != *"-A inet6"* ]] && x="-A inet6 ${x}"
366 x="${x// -net / }" 373 x="${x// -net / }"

Legend:
Removed from v.435  
changed lines
  Added in v.436

  ViewVC Help
Powered by ViewVC 1.1.20