]> git.pond.sub.org Git - empserver/commit - src/lib/player/player.c
player: Drop long-disabled code to resolve IP addresses
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 27 Jan 2014 19:28:39 +0000 (20:28 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 1 Feb 2015 15:52:59 +0000 (16:52 +0100)
commit9ef4f1bf5018e82cd5944034c97e19b466fda974
treeb2566c9d2eca9658212374634d0bbb0dd96aa664
parent199388b084eea83efb8ba81fec29435d64052acc
player: Drop long-disabled code to resolve IP addresses

Disabled since commit 32fac04 (v4.2.13) because it could at the time
use more stack space than we provided.  Additional issues: code still
uses obsolete gethostbyaddr() rather than getnameinfo(), and we
provide only 512 bytes for host names instead of the customary
NI_MAXHOST (1025) bytes.

All three issues would be easy enough to fix.  What's not so easy is
to avoid blocking on the synchronous DNS lookup.  Without that,
connecting repeatedly from a range of addresses with slow reverse
lookup could conceivably be employed as a denial of service attack.

We've been living without reverse lookup for close to ten years.  Bury
the corpse, and move on.

Bonus: sizeof(struct natstr) is cut in half.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/misc.h
include/nat.h
include/player.h
src/lib/player/accept.c
src/lib/player/player.c