Allow whitespace in routing commands, Gentoo bug #200458.
This commit is contained in:
parent
f6033cfb26
commit
8a328b7408
16
sh/net.sh
16
sh/net.sh
@ -33,7 +33,7 @@ _config_vars="config routes"
|
|||||||
description="Configures network interfaces."
|
description="Configures network interfaces."
|
||||||
|
|
||||||
# Handy var so we don't have to embed new lines everywhere for array splitting
|
# Handy var so we don't have to embed new lines everywhere for array splitting
|
||||||
__IFS="
|
__IFS="
|
||||||
"
|
"
|
||||||
_shell_var() {
|
_shell_var() {
|
||||||
local rem=$1 c= r=
|
local rem=$1 c= r=
|
||||||
@ -561,16 +561,12 @@ ${routes}"
|
|||||||
eindent
|
eindent
|
||||||
ebegin ${cmd}
|
ebegin ${cmd}
|
||||||
# Work out if we're a host or a net if not told
|
# Work out if we're a host or a net if not told
|
||||||
case "${cmd}" in
|
case ${cmd} in
|
||||||
*" -net "*|*" -host "*) ;;
|
*" -net "*|*" -host "*) ;;
|
||||||
*" netmask "*) cmd="-net ${cmd}" ;;
|
*" netmask "*) cmd="-net ${cmd}" ;;
|
||||||
*)
|
*.*.*.*/32) cmd="-host ${cmd}" ;;
|
||||||
case "${cmd%% *}" in
|
*.*.*.*/*|0.0.0.0|default) cmd="-net ${cmd}" ;;
|
||||||
*.*.*.*/32) cmd="-host ${cmd}" ;;
|
*) cmd="-host ${cmd}" ;;
|
||||||
*.*.*.*/*|0.0.0.0|default) cmd="-net ${cmd}" ;;
|
|
||||||
*) cmd="-host ${cmd}" ;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
if ${hidefirstroute} ; then
|
if ${hidefirstroute} ; then
|
||||||
_add_route ${cmd} >/dev/null 2>/dev/null
|
_add_route ${cmd} >/dev/null 2>/dev/null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user