diff options
-rw-r--r-- | pysnmp/carrier/asyncore/dgram/base.py | 1 | ||||
-rw-r--r-- | pysnmp/carrier/sockmsg.py | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/pysnmp/carrier/asyncore/dgram/base.py b/pysnmp/carrier/asyncore/dgram/base.py index 573e6f56..378974e6 100644 --- a/pysnmp/carrier/asyncore/dgram/base.py +++ b/pysnmp/carrier/asyncore/dgram/base.py @@ -78,6 +78,7 @@ class DgramSocketTransport(AbstractSocketTransport): if self.socket.family == socket.AF_INET6: self.socket.setsockopt(socket.SOL_IPV6, socket.IPV6_RECVPKTINFO, flag) + self.socket.setsockopt(socket.SOL_IPV6, socket.IPV6_V6ONLY, not flag) except socket.error: raise error.CarrierError('setsockopt() for %s failed: %s' % (self.socket.family == socket.AF_INET6 and "IPV6_RECVPKTINFO" or "IP_PKTINFO", sys.exc_info()[1])) diff --git a/pysnmp/carrier/sockmsg.py b/pysnmp/carrier/sockmsg.py index 0b21233b..97273306 100644 --- a/pysnmp/carrier/sockmsg.py +++ b/pysnmp/carrier/sockmsg.py @@ -92,7 +92,7 @@ else: debug.logger & debug.flagIO and debug.logger( 'recvfrom: received %d octets from %s to %s; ' - 'iov blob %r' % (len(data), _from, _to, ancdata)) + 'iov blob %s' % (len(data), _from, _to, debug.hexdump(ancdata))) return data, addressType(_from).setLocalAddress(_to) @@ -120,7 +120,7 @@ else: ancdata = [(socket.SOL_IPV6, socket.IPV6_PKTINFO, memoryview(_f).tobytes())] debug.logger & debug.flagIO and debug.logger( - 'sendto: sending %d octets to %s; iov blob %r' % (len(data), _to, ancdata)) + 'sendto: sending %d octets to %s; iov blob %s' % (len(data), _to, debug.hexdump(ancdata))) return s.sendmsg([_data], ancdata, 0, _to) |