[PATCH] When XDMCP -from is specified, only register the requested address

Alan Coopersmith alan.coopersmith at oracle.com
Sun Mar 6 10:34:06 PST 2011


On 03/ 5/11 10:32 AM, Jon TURNEY wrote:
> When XDMCP -from is specified, only register the requested address,
> rather than the requested address, and any others we have of different
> address families to the requested address.
> 
> e.g. if we have 4 interfaces with both IPv4 and IPv6 addresses (which
> are not IPv6 mapped IPV4 addresses), using -from with one of those IPv4
> addresses currently means only that IPv4 address, and all IPv6 addresses
> are used in the connection data in XDMCP REQUEST packet.
> 
> (See http://cygwin.com/ml/cygwin-xfree/2011-02/msg00000.html)
> 
> Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
> ---
>  os/xdmcp.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/os/xdmcp.c b/os/xdmcp.c
> index 877b11c..f5331e1 100644
> --- a/os/xdmcp.c
> +++ b/os/xdmcp.c
> @@ -486,7 +486,7 @@ XdmcpRegisterConnection (
>  	    }
>  	}
>  #endif
> -	if (fromAddr && memcmp(regAddr, fromAddr, regAddrlen) != 0) {
> +	if (!fromAddr || memcmp(regAddr, fromAddr, regAddrlen) != 0) {
>  	    return;
>  	}
>      }

Makes sense, because fromAddr will be left pointing to NULL if the address
size doesn't match the addrlen passed in (as it wouldn't when comparing
IPv4 & IPv6), and we're already inside the if block to see if a -from was
passed at all.

Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list