mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-23 21:17:11 -05:00
services: dhcp-client: Ignore interfaces that cannot be activated.
Fixes <https://bugs.gnu.org/38524>. * gnu/services/networking.scm (dhcp-client-service-type): Filter interfaces that cannot be activated. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
7a241c6350
commit
747b7246a6
1 changed files with 6 additions and 5 deletions
|
@ -234,14 +234,15 @@ (define pid-file
|
|||
(define valid?
|
||||
(lambda (interface)
|
||||
(and (arp-network-interface? interface)
|
||||
(not (loopback-network-interface? interface)))))
|
||||
(not (loopback-network-interface? interface))
|
||||
;; XXX: Make sure the interfaces are up so that
|
||||
;; 'dhclient' can actually send/receive over them.
|
||||
;; Ignore those that cannot be activated.
|
||||
(false-if-exception
|
||||
(set-network-interface-up interface)))))
|
||||
(define ifaces
|
||||
(filter valid? (all-network-interface-names)))
|
||||
|
||||
;; XXX: Make sure the interfaces are up so that 'dhclient' can
|
||||
;; actually send/receive over them.
|
||||
(for-each set-network-interface-up ifaces)
|
||||
|
||||
(false-if-exception (delete-file #$pid-file))
|
||||
(let ((pid (fork+exec-command
|
||||
(cons* #$dhclient "-nw"
|
||||
|
|
Loading…
Reference in a new issue