]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
35network-legacy: discard pointless RTNETLINK message
authorDavid Tardon <dtardon@redhat.com>
Tue, 9 Feb 2021 15:46:07 +0000 (16:46 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Tue, 9 Feb 2021 20:04:23 +0000 (21:04 +0100)
This command prints

    RTNETLINK answers: Network is unreachable

to stderr if IP is not assigned yet, but that's the thing we are
checking for, so there's no point in showing the message.

modules.d/35network-legacy/ifup.sh

index e5690dbec2496e7d6a85c98baeb31e868afd6a8d..3509d7a95e3c0f7868389bd26cb338712febb4da 100755 (executable)
@@ -135,7 +135,7 @@ do_static() {
         return 1
     fi
 
-    ip route get "$ip" | {
+    ip route get "$ip" 2>/dev/null | {
         read a rest
         if [ "$a" = "local" ]; then
             warn "Not assigning $ip to interface $netif, cause it is already assigned!"