]> git.proxmox.com Git - mirror_qemu.git/commit - ui/vnc.c
vnc: track & limit connections
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 2 Oct 2014 10:09:34 +0000 (12:09 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 22 Jan 2015 10:18:47 +0000 (11:18 +0100)
commite5f34cdd2da54f28d90889a3afd15fad2d6105ff
treeb4bb4eafa06d5c95b7d8413f49e1d18bd4ab4185
parent86fdcf23f4a9d8473844734907555b3a93ed686c
vnc: track & limit connections

Also track the number of connections in "connecting" and "shared" state
(in addition to the "exclusive" state).  Apply a configurable limit to
these connections.

The logic to apply the limit to connections in "shared" state is pretty
simple:  When the limit is reached no new connections are allowed.

The logic to apply the limit to connections in "connecting" state (this
is the state you are in *before* successful authentication) is
slightly different:  A new connect kicks out the oldest client which is
still in "connecting" state.  This avoids a easy DoS by unauthenticated
users by simply opening connections until the limit is reached.

Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/vnc.c
ui/vnc.h