From: Mark Wooding Date: Mon, 12 Jan 2009 17:53:35 +0000 (+0000) Subject: noip (decode_inet_addr): Be more careful when converting addresses. X-Git-Tag: 1.0.4~1 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/preload-hacks/commitdiff_plain/00a98a8ab227c8a3fc658ddb6e1bdc9d3cc71466?hp=00a98a8ab227c8a3fc658ddb6e1bdc9d3cc71466 noip (decode_inet_addr): Be more careful when converting addresses. The old version of decode_inet_addr would convert empty Unix-domain addresses to wildcard Internet addresses, which is erroneous in a number of situations. In particular, this causes problems in some servers which maintain parallel Unix-domain and Internet listening sockets, and use the address family reported by accept(2) to decide what to do: if the incoming connection is from an unbound (but real) Unix-domain socket, it gets misinterpreted. This fixes decode_inet_addr to be more selective about its decoding of empty addresses. It must do the decoding when swapping in a genuine IP socket, but when called via return_fake_name it's wrong to do this: a remote socket which ought to be decoded will have been bound either explicitly by the peer or implicitly by do_implicit_bind. (Actually, getsockname might now be wrong when called on an unbound socket, but that's probably a small price to pay -- and there's no way of returning the right answer in this case anyway.) ---