aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/build/syscalls.scm12
1 files changed, 8 insertions, 4 deletions
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index ea68b22bb7..69a507def8 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -767,10 +767,14 @@ the same type as that returned by 'make-socket-address'."
(format port "#<interface ~s " name)
(unless (zero? (logand IFF_UP flags))
(display "up " port))
- (if (member (sockaddr:fam address) (list AF_INET AF_INET6))
- (format port "~a " (inet-ntop (sockaddr:fam address)
- (sockaddr:addr address)))
- (format port "family:~a " (sockaddr:fam address)))
+
+ ;; Check whether ADDRESS really is a sockaddr.
+ (when address
+ (if (member (sockaddr:fam address) (list AF_INET AF_INET6))
+ (format port "~a " (inet-ntop (sockaddr:fam address)
+ (sockaddr:addr address)))
+ (format port "family:~a " (sockaddr:fam address))))
+
(format port "~a>" (number->string (object-address interface) 16)))))
(set-record-type-printer! <interface> write-interface)