mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
improve avahi-379 workaround
This commit is contained in:
parent
6c1cf68bca
commit
94d1924fa9
|
@ -21,12 +21,10 @@ def set_avahi_379():
|
||||||
|
|
||||||
def log_avahi_379(args):
|
def log_avahi_379(args):
|
||||||
global avahi_379
|
global avahi_379
|
||||||
n = avahi_379
|
if avahi_379 == 2:
|
||||||
if n == 2:
|
|
||||||
return
|
return
|
||||||
if n == 1:
|
avahi_379 = 2
|
||||||
avahi_379 = 2
|
t = "Invalid pointer in DNSLabel [offset=%d,pointer=%d,length=%d];\n\033[35m NOTE: this is probably avahi-bug #379, packet corruption in Avahi's mDNS-reflection feature. Copyparty has a workaround and is OK, but other devices need either --zm4 or --zm6"
|
||||||
t = "Invalid pointer in DNSLabel [offset=%d,pointer=%d,length=%d]; this is probably avahi-bug #379, packet corruption in Avahi's mDNS reflection feature. Copyparty has a workaround and is OK, but other devices need either --zm4 or --zm6"
|
|
||||||
raise BufferError(t % args)
|
raise BufferError(t % args)
|
||||||
|
|
||||||
|
|
||||||
|
@ -117,6 +115,8 @@ class DNSBuffer(Buffer):
|
||||||
self.offset = pointer
|
self.offset = pointer
|
||||||
elif avahi_379:
|
elif avahi_379:
|
||||||
log_avahi_379((self.offset, pointer, len(self.data)))
|
log_avahi_379((self.offset, pointer, len(self.data)))
|
||||||
|
label.extend(b"a")
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
raise BufferError(
|
raise BufferError(
|
||||||
"Invalid pointer in DNSLabel [offset=%d,pointer=%d,length=%d]"
|
"Invalid pointer in DNSLabel [offset=%d,pointer=%d,length=%d]"
|
||||||
|
|
Loading…
Reference in a new issue