GNOME Bugzilla – Bug 494817
xdmcp doesn't work at all on some OS
Last modified: 2010-07-02 19:13:24 UTC
Please describe the problem: xdmcp doesn't work on Solaris. No packets are sent out the network. Steps to reproduce: 1. Start a local or remote chooser. 2. 3. Actual results: The system isn't listed. Expected results: The system should be listed and be selectable. Does this happen every time? Yes Other information: The problem is caused by a difference in the way Solaris API's handle the length of the sockaddr supplied. Solaris requires the exact length as specified by the AF_INET6 or AF_INET whereas Linux based systems only require that the length be greater or equal to the expected length. Also the routine gdm_address_peek_local_list() incorrectly treats the ai_family member of the hints passed to getaddrinfo() as a bitmask.
Created attachment 98752 [details] [review] Suggested Fix This is the fix for this bug.
Fixed in 2.20. I'll leave this bug open, though, since I notice that GDM SVN head has the same issue. Basically all places where sizeof (struct sockaddr_storage) is used should be replaced by the macro in the patch. The issue with hints is probably not an issue for SVN head since it uses a different mechanism for figuring out how to set ai_family.
Some people on FreeBSD have reported that there is the same problem on their platform, so removing Solaris specific wording from Synopsis.
Created attachment 146378 [details] [review] updated patch for GDM 2.28 This issue exists in the new GDM, which will cause XDMCP to fail on some platforms when using IPv6 (Solaris, FreeBSD). This patch is already in GDM 2.20 (it was added after the code forked for the new GDM), and it just adds a macro so that the structure size is set for IPv4 or IPv6 via a macro to the specific structure size.
Re-opening since this bug needs to also be fixed in the new GDM 2.28 version. I provided an updated patch which applies to the latest code.
Fixed in master for 2.29.
After doing further testing, I notice that XDMCP still does not work on Solaris. I am attaching a patch that fixes the remaining issues. This patch fixes: - In gdm-address.c, there was a problem where a failure in gdm_address_get_hostname could cause an infinite loop since it would call gdm_address_debug, which would then call gdm_address_get_hostname again. I fixed this by making gdm_address_debug call a private _gdm_address_debug function and gdm_address_get_hostname calls _gdm_adress_debug rather than gdm_address_debug. - Two calls in gdm-address.c were using "sizeof (struct sockaddr_storage)" and changing this to "(int) gdm_sockaddr_len (address->ss)" works better. This is the same issue as fixed in the previous patch. I just missed these spots before. - In daemon/gdm-xdmcp-display-factory.c in the on_hostname_selected() function it is necessary to set hints.ai_socktype to "SOCK_DGRAM" or else I would get this error: WARNING: Unable get address: service name not available for the specified socket type - In daemon/gdm-xdmcp-display-factory.c in the decode_packet() function and in gui/simple-chooser/gdm-host-chooser-widget.c it is necessary to set ss_len to "gdm_sockaddr_len (&clnt_ss)" instead of "sizeof (clnt_ss)". - In gui/simple-chooser/gdm-host-chooser-widget.c in find_broacast_address it is also necessary to check for "(errno != ENXIO)". - The patch also fixes a number of issues where NULL's being passed into printf() functions were causing issues, and ensures that this never happens. Can this patch go upstream?
Created attachment 151222 [details] [review] patch fixing remaining issues patch fixing remaining issues.
Comment on attachment 151222 [details] [review] patch fixing remaining issues Thanks