commit 082e28c58b505e4e2673e91d39d1ddce13852041 Author: Ivan Zakharyaschev Date: Wed Dec 31 21:16:55 2008 +0300 Report unnaming as an admissable event (but with a special sign). commit 2be5e3bdb3052700a530cdbd0bd7fd6f24048c97 Author: Ivan Zakharyaschev Date: Wed Dec 31 07:57:54 2008 +0300 Improve the code: remove the name from a device if it's a wrong name. This should help in using profiled iftabs for selecting device names and a corresponding configuration. (cherry picked from commit 0967a67e02c045ea7f47ce3211051efd071184bb) diff --git a/scripts/ifup b/scripts/ifup index d17c7da..a68ffda 100755 --- a/scripts/ifup +++ b/scripts/ifup @@ -93,6 +93,14 @@ fi # 5. adjust name and configure iface IFTAB_FILE=`profiled_filename $IFTAB` if [ -s "$IFTAB_FILE" ]; then + # First let's check: perhaps the name belongs to a wrong device now! + # Then remove the name from that device: + if $IFRENAME -c "$IFTAB_FILE" -i "$NAME"; then + print_progress '%' # A special sign for the admissable event of expropriating the name from an old device. + else + print_progress + fi + # Now, let's find the right device for this name: if $IFRENAME -c "$IFTAB_FILE" -n "$NAME"; then print_progress else