Skip to content

Commit

Permalink
mdns: option to ignore invalid packets on the lan
Browse files Browse the repository at this point in the history
  • Loading branch information
9001 committed Dec 1, 2024
1 parent 42fd666 commit 395af05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions copyparty/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,7 @@ def add_zc_mdns(ap):
ap2.add_argument("--zm6", action="store_true", help="IPv6 only")
ap2.add_argument("--zmv", action="store_true", help="verbose mdns")
ap2.add_argument("--zmvv", action="store_true", help="verboser mdns")
ap2.add_argument("--zm-no-pe", action="store_true", help="mute parser errors (invalid incoming MDNS packets)")
ap2.add_argument("--zms", metavar="dhf", type=u, default="", help="list of services to announce -- d=webdav h=http f=ftp s=smb -- lowercase=plaintext uppercase=TLS -- default: all enabled services except http/https (\033[32mDdfs\033[0m if \033[33m--ftp\033[0m and \033[33m--smb\033[0m is set, \033[32mDd\033[0m otherwise)")
ap2.add_argument("--zm-ld", metavar="PATH", type=u, default="", help="link a specific folder for webdav shares")
ap2.add_argument("--zm-lh", metavar="PATH", type=u, default="", help="link a specific folder for http shares")
Expand Down
3 changes: 3 additions & 0 deletions copyparty/mdns.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ def run2(self) -> None:
self.log("stopped", 2)
return

if self.args.zm_no_pe:
continue

t = "{} {} \033[33m|{}| {}\n{}".format(
self.srv[sck].name, addr, len(buf), repr(buf)[2:-1], min_ex()
)
Expand Down

0 comments on commit 395af05

Please sign in to comment.