2
0
mirror of https://opendev.org/x/pyghmi synced 2026-08-25 08:06:48 +00:00

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
This commit is contained in:
Jarrod Johnson
2014-06-02 15:59:19 -04:00
parent 8c66abb200
commit 37bfae70c4
+1
View File
@@ -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