diff mbox

vnc: fix bug: vnc server can't start when 'to' is specified

Message ID 1445926252-14830-1-git-send-email-hongyang.yang@easystack.cn
State New
Headers show

Commit Message

Yang Hongyang Oct. 27, 2015, 6:10 a.m. UTC
commit e0d03b8ceb52 converted VNC startup to use SocketAddress,
the interface socket_listen don't have a port_offset param, so
we need to add the port offset (5900) to both 'port' and 'to' opts.
currently only 'port' is added by offset.
This patch add the port offset to 'to' opts.

Signed-off-by: Yang Hongyang <hongyang.yang@easystack.cn>
Cc: Daniel P. Berrange <berrange@redhat.com>
Cc: Eric Blake <eblake@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/vnc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gerd Hoffmann Oct. 28, 2015, 2:43 p.m. UTC | #1
On Di, 2015-10-27 at 14:10 +0800, Yang Hongyang wrote:
> commit e0d03b8ceb52 converted VNC startup to use SocketAddress,
> the interface socket_listen don't have a port_offset param, so
> we need to add the port offset (5900) to both 'port' and 'to' opts.
> currently only 'port' is added by offset.
> This patch add the port offset to 'to' opts.

added to vnc patch queue.

thanks,
  Gerd
diff mbox

Patch

diff --git a/ui/vnc.c b/ui/vnc.c
index faff054..db24545 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3545,7 +3545,7 @@  void vnc_display_open(const char *id, Error **errp)
 
             if (to) {
                 saddr->inet->has_to = true;
-                saddr->inet->to = to;
+                saddr->inet->to = to + 5900;
             }
             saddr->inet->ipv4 = saddr->inet->has_ipv4 = has_ipv4;
             saddr->inet->ipv6 = saddr->inet->has_ipv6 = has_ipv6;