diff options
| -rw-r--r-- | gnu/services/networking.scm | 2 | ||||
| -rw-r--r-- | guix/build/syscalls.scm | 14 | ||||
| -rw-r--r-- | tests/syscalls.scm | 10 |
3 files changed, 13 insertions, 13 deletions
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm index 102202c8533..c2b404503e7 100644 --- a/gnu/services/networking.scm +++ b/gnu/services/networking.scm | |||
| @@ -173,7 +173,7 @@ Protocol (DHCP) client, on all the non-loopback network interfaces." | |||
| 173 | (define valid? | 173 | (define valid? |
| 174 | (negate loopback-network-interface?)) | 174 | (negate loopback-network-interface?)) |
| 175 | (define ifaces | 175 | (define ifaces |
| 176 | (filter valid? (all-network-interfaces))) | 176 | (filter valid? (all-network-interface-names))) |
| 177 | 177 | ||
| 178 | ;; XXX: Make sure the interfaces are up so that | 178 | ;; XXX: Make sure the interfaces are up so that |
| 179 | ;; 'dhclient' can actually send/receive over them. | 179 | ;; 'dhclient' can actually send/receive over them. |
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index b7c0f7e7453..ae5b2ed112d 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm | |||
| @@ -60,8 +60,8 @@ | |||
| 60 | IFF_UP | 60 | IFF_UP |
| 61 | IFF_BROADCAST | 61 | IFF_BROADCAST |
| 62 | IFF_LOOPBACK | 62 | IFF_LOOPBACK |
| 63 | all-network-interfaces | 63 | all-network-interface-names |
| 64 | network-interfaces | 64 | network-interface-names |
| 65 | network-interface-flags | 65 | network-interface-flags |
| 66 | loopback-network-interface? | 66 | loopback-network-interface? |
| 67 | network-interface-address | 67 | network-interface-address |
| @@ -533,8 +533,8 @@ most LEN bytes from BV." | |||
| 533 | (take-while (negate zero?) bytes))) | 533 | (take-while (negate zero?) bytes))) |
| 534 | result)))))) | 534 | result)))))) |
| 535 | 535 | ||
| 536 | (define* (network-interfaces #:optional sock) | 536 | (define* (network-interface-names #:optional sock) |
| 537 | "Return the list of existing network interfaces. This is typically limited | 537 | "Return the names of existing network interfaces. This is typically limited |
| 538 | to interfaces that are currently up." | 538 | to interfaces that are currently up." |
| 539 | (let* ((close? (not sock)) | 539 | (let* ((close? (not sock)) |
| 540 | (sock (or sock (socket SOCK_STREAM AF_INET 0))) | 540 | (sock (or sock (socket SOCK_STREAM AF_INET 0))) |
| @@ -559,9 +559,9 @@ to interfaces that are currently up." | |||
| 559 | ;; Regexp matching an interface line in Linux's /proc/net/dev. | 559 | ;; Regexp matching an interface line in Linux's /proc/net/dev. |
| 560 | (make-regexp "^[[:blank:]]*([[:alnum:]]+):.*$")) | 560 | (make-regexp "^[[:blank:]]*([[:alnum:]]+):.*$")) |
| 561 | 561 | ||
| 562 | (define (all-network-interfaces) | 562 | (define (all-network-interface-names) |
| 563 | "Return all the registered network interfaces, including those that are not | 563 | "Return all the names of the registered network interfaces, including those |
| 564 | up." | 564 | that are not up." |
| 565 | (call-with-input-file "/proc/net/dev" ;XXX: Linux-specific | 565 | (call-with-input-file "/proc/net/dev" ;XXX: Linux-specific |
| 566 | (lambda (port) | 566 | (lambda (port) |
| 567 | (let loop ((interfaces '())) | 567 | (let loop ((interfaces '())) |
diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 6b614a52117..3b71cd7b1c0 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm | |||
| @@ -152,15 +152,15 @@ | |||
| 152 | (status:exit-val status)))) | 152 | (status:exit-val status)))) |
| 153 | (eq? #t result)))))))) | 153 | (eq? #t result)))))))) |
| 154 | 154 | ||
| 155 | (test-assert "all-network-interfaces" | 155 | (test-assert "all-network-interface-names" |
| 156 | (match (all-network-interfaces) | 156 | (match (all-network-interface-names) |
| 157 | (((? string? names) ..1) | 157 | (((? string? names) ..1) |
| 158 | (member "lo" names)))) | 158 | (member "lo" names)))) |
| 159 | 159 | ||
| 160 | (test-assert "network-interfaces" | 160 | (test-assert "network-interface-names" |
| 161 | (match (network-interfaces) | 161 | (match (network-interface-names) |
| 162 | (((? string? names) ..1) | 162 | (((? string? names) ..1) |
| 163 | (lset<= string=? names (all-network-interfaces))))) | 163 | (lset<= string=? names (all-network-interface-names))))) |
| 164 | 164 | ||
| 165 | (test-assert "network-interface-flags" | 165 | (test-assert "network-interface-flags" |
| 166 | (let* ((sock (socket AF_INET SOCK_STREAM 0)) | 166 | (let* ((sock (socket AF_INET SOCK_STREAM 0)) |
