diff Modules/socketmodule.c @ 30062:7aea1b5cdebb 2.3

Patch #781722: Reject AF_INET6 if IPv6 is disabled.
author Martin v. Löwis <martin@v.loewis.de>
date Tue, 05 Aug 2003 06:26:46 +0000
parents 08d2636b8e58
children 7f5489184d94
line wrap: on
line diff
--- a/Modules/socketmodule.c	Tue Aug 05 06:20:23 2003 +0000
+++ b/Modules/socketmodule.c	Tue Aug 05 06:26:46 2003 +0000
@@ -2962,6 +2962,14 @@
 		return NULL;
 	}
 
+#ifndef ENABLE_IPV6
+	if(af == AF_INET6) {
+		PyErr_SetString(socket_error,
+				"can't use AF_INET6, IPv6 is disabled");
+		return NULL;
+	}
+#endif 
+
 	retval = inet_pton(af, ip, packed);
 	if (retval < 0) {
 		PyErr_SetFromErrno(socket_error);