mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-19 22:16:32 +01:00
syscalls: <interface> printer correctly handles lack of sockaddr.
Reported by Danny Milosavljevic <dannym@scratchpost.org> in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22612#16>. * guix/build/syscalls.scm (write-interface): Check whether ADDRESS is true.
This commit is contained in:
parent
a2da8c173a
commit
001dae0d74
1 changed files with 8 additions and 4 deletions
|
@ -767,10 +767,14 @@ (define (write-interface interface port)
|
|||
(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)
|
||||
|
|
Loading…
Reference in a new issue