Xwayland ignores -listen tcp
Running Xwayland with -listen tcp does not cause it to listen for TCP connections.
I think this is cause by this code: https://gitlab.freedesktop.org/xorg/xserver/blob/master/hw/xwayland/xwayland.c#L110
Xwayland unconditionally consumes the -listen option and interprets the argument as an fd to be listened. As the argument is "tcp", this causes 0 to be added to the listen_fds list.
I think Xwayland should check if the argument is an integer, and if it is not return 0 so that the regular Xserver code handles it.
This code also accesses argv[i + 1]
without checking if i + 1
is within the bounds of argv
.