summary refs log tree commit diff
path: root/gnu/services/networking.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-07-12 22:56:40 +0200
committerLudovic Courtès <ludo@gnu.org>2014-07-12 23:17:54 +0200
commit8897603ad02042f916911c406eb47f0b36d1f831 (patch)
tree8ba6b8f205eb09971576a453fdbff344ccf50c36 /gnu/services/networking.scm
parent89a0d00a38b48699c1edd9a13050a92ad6737286 (diff)
downloadguix-8897603ad02042f916911c406eb47f0b36d1f831.tar.gz
services: networking: Set interfaces up; delete default route only when needed.
* gnu/services/networking.scm (static-networking-service): Use -i, -A,
  and --up with Inetutils' ifconfig.  Do 'route del -net default' only
  when GATEWAY is true.
Diffstat (limited to 'gnu/services/networking.scm')
-rw-r--r--gnu/services/networking.scm10
1 files changed, 7 insertions, 3 deletions
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index f03161fe58..7abcd9ed15 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -55,7 +55,8 @@ gateway."
                  ;; Return #t if successfully started.
                  (and (zero? (system* (string-append #$inetutils
                                                      "/bin/ifconfig")
-                                      #$interface #$ip "up"))
+                                      "-i" #$interface "-A" #$ip
+                                      "-i" #$interface "--up"))
                       #$(if gateway
                             #~(zero? (system* (string-append #$net-tools
                                                              "/sbin/route")
@@ -77,8 +78,11 @@ gateway."
                 ;; Return #f is successfully stopped.
                 (not (and (system* (string-append #$inetutils "/bin/ifconfig")
                                    #$interface "down")
-                          (system* (string-append #$net-tools "/sbin/route")
-                                   "del" "-net" "default")))))
+                          #$(if gateway
+                                #~(system* (string-append #$net-tools
+                                                          "/sbin/route")
+                                           "del" "-net" "default")
+                                #t)))))
       (respawn? #f)))))
 
 ;;; networking.scm ends here