ALT Linux Bugzilla
– Attachment 2732 Details for
Bug 16461
FR: when ALLOW_UNKNOWN=yes skip unknown interfaces which are up
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
patch
etcnet-0.9.2-skip_unknown.patch (text/plain), 1.75 KB, created by
Nick S. Grechukh
on 2008-07-30 01:04:23 MSD
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Nick S. Grechukh
Created:
2008-07-30 01:04:23 MSD
Size:
1.75 KB
patch
obsolete
>diff --git a/functions b/functions >index 97167b4..f472389 100644 >--- a/functions >+++ b/functions >@@ -196,6 +196,12 @@ iface_is_up() > $IP -o link show dev $NAME 2>/dev/null | cut -d' ' -f3 | grep -qs '[<,]UP[,>]' > } > >+iface_have_ipaddr() >+{ >+ local NAME=${1:?missing 1st argument to $FUNCNAME} >+ $IP -o addr show dev $NAME 2>/dev/null | egrep -qs " $NAME +inet ([0-9]{1,3}\.){3}[0-9]{1,3}/[0-9]{1,2} " >+} >+ > # Invoke program which understands the "-o NAME" option - > # insmod for modutils, modprobe for module-init-tools. > modprobe_with_rename() >@@ -494,7 +500,7 @@ eval_string() > > declare -frx is_yes is_no SourceIfNotEmpty ExecIfExecutable supported_type name2type > declare -frx pickup_options print_error print_message print_progress print_nack >-declare -frx iface_is_up try_rmmod get_mapped_ifname profiled_filename init_netprofile >+declare -frx iface_is_up iface_have_ipaddr try_rmmod get_mapped_ifname profiled_filename init_netprofile > declare -frx init_nethost foreach_child ifdown_children ifup_children ifup_parents > declare -frx ifdown_parents iface_exists seen_iface add_seen_iface xargise_file > declare -frx have_ifplugd pickup_defaults trim need_detection stop_dhcp_client >diff --git a/ifup-removable b/ifup-removable >index 0bcb556..e788ae3 100755 >--- a/ifup-removable >+++ b/ifup-removable >@@ -52,6 +52,10 @@ export IFACEDIR MYIFACEDIR SCRIPTDIR NAME NETPROFILE SEEN_IFACES > init_netprofile > if [ ! -d "$MYIFACEDIR" ]; then > if is_yes "$ALLOW_UNKNOWN"; then >+ if iface_is_up $NAME && iface_have_ip $NAME; then >+ print_message -n "unknown interface '$NAME' already configured - skipping (lookup ALLOW_UNKNOWN_RESET option or create a usable configuration)" >+ exit 1 >+ fi > if [ -d $IFACEDIR/unknown@$NETHOST ]; then > MYIFACEDIR=$IFACEDIR/unknown@$NETHOST > else
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 16461
:
2732
|
2733