Lines 2657-2664
Link Here
|
2657 |
if ips: |
2657 |
if ips: |
2658 |
del ips[0] |
2658 |
del ips[0] |
2659 |
if ips==[]: |
2659 |
if ips==[]: |
|
|
2660 |
if settings.has_key("RSYNC_IPV"): |
2661 |
if settings["RSYNC_IPV"] == "4": |
2662 |
rsync_afi = socket.AF_INET |
2663 |
elif settings["RSYNC_IPV"] == "6": |
2664 |
rsync_afi = socket.AF_INET6 |
2665 |
else: |
2666 |
print "!!! RSYNC_IPV specified, but it is not 4 or 6." |
2667 |
rsync_afi = socket.AF_UNSPEC |
2668 |
else: |
2669 |
rsync_afi = socket.AF_UNSPEC |
2670 |
|
2660 |
try: |
2671 |
try: |
2661 |
ips=socket.gethostbyname_ex(hostname)[2] |
2672 |
for addrinfo in socket.getaddrinfo(hostname, None, rsync_afi, socket.SOCK_STREAM): |
|
|
2673 |
if addrinfo[0] == socket.AF_INET6: # IPv6 addresses need to be added with brackets |
2674 |
ips.append('[' + addrinfo[4][0] + ']') |
2675 |
else: |
2676 |
ips.append(addrinfo[4][0]) |
2677 |
|
2662 |
except SystemExit, e: |
2678 |
except SystemExit, e: |
2663 |
raise # Needed else can't exit |
2679 |
raise # Needed else can't exit |
2664 |
except Exception, e: |
2680 |
except Exception, e: |