From 37bfae70c4da7f726418473d60668a64ac3016cc Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 2 Jun 2014 15:59:19 -0400 Subject: [PATCH] Fix IPv4 operations where v6only behavior is default Some configurations disable dual stack sockets. For example if net.ipv6.bindv6only is 1 in linux, pyghmi was failing. Address by explicitly requesting the converse behavior on the socket since we explicitly do want to not care whether a particular socket is engaged in ipv4 or ipv6 activity. Change-Id: I17a16f0ebe4752ca743f115af39a367670691507 --- pyghmi/ipmi/private/session.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index 793d4f39..e9368f87 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -287,6 +287,7 @@ class Session(object): tmpsocket = _io_apply(socket.socket, (socket.AF_INET6, socket.SOCK_DGRAM)) # INET6 # can do IPv4 if you are nice to it + tmpsocket.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0) self.socketpool[tmpsocket] = 1 iosockets.append(tmpsocket) return tmpsocket