diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-04-09 08:49:06 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-04-09 08:52:31 +0200 |
commit | 3c8f2ae958f96f16ffcbb74e0b022bd9999ecb03 (patch) | |
tree | 1a2d344e27ffed4086ee44543e9ecb4c991308e7 | |
parent | 22c76fd82288fee2cb0bb744c2e28d1be42204de (diff) | |
download | guile-3c8f2ae958f96f16ffcbb74e0b022bd9999ecb03.tar.gz |
tests: Skip IPv6 socket tests when OS support is missing.
Reported by Samuel Thibault <samuel.thibault@gnu.org>
and Peter Simons <simons@cryp.to>.
* test-suite/tests/00-socket.test ("AF_INET6/SOCK_STREAM"): Throw
`unresolved' when `bind' throws EADDRNOTAVAIL.
-rw-r--r-- | test-suite/tests/00-socket.test | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test-suite/tests/00-socket.test b/test-suite/tests/00-socket.test index 8079cf548..5093575c0 100644 --- a/test-suite/tests/00-socket.test +++ b/test-suite/tests/00-socket.test @@ -1,7 +1,7 @@ ;;;; socket.test --- test socket functions -*- scheme -*- ;;;; ;;;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, -;;;; 2011 Free Software Foundation, Inc. +;;;; 2011, 2013 Free Software Foundation, Inc. ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public @@ -442,6 +442,14 @@ (lambda args (let ((errno (system-error-errno args))) (cond ((= errno EADDRINUSE) (throw 'unresolved)) + + ;; On Linux-based systems, when `ipv6' support is + ;; missing (for instance, `ipv6' is loaded and + ;; /proc/sys/net/ipv6/conf/all/disable_ipv6 is set + ;; to 1), the socket call above succeeds but + ;; bind(2) fails like this. + ((= errno EADDRNOTAVAIL) (throw 'unresolved)) + (else (apply throw args))))))) (pass-if "bind/sockaddr" @@ -456,6 +464,7 @@ (lambda args (let ((errno (system-error-errno args))) (cond ((= errno EADDRINUSE) (throw 'unresolved)) + ((= errno EADDRNOTAVAIL) (throw 'unresolved)) (else (apply throw args)))))))) (pass-if "listen" |