- For security reasons by default listen on localhost address,
not on wildcard. [1] - Move the default port assignment from pci_fbuf.c to rfb.c, to avoid polluting pci_fbuf.c with network things. Suggested by: grehan
This commit is contained in:
parent
3909a600a5
commit
bc5d44ec53
@ -365,8 +365,6 @@ pci_fbuf_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts)
|
||||
|
||||
sc->fsc_pi = pi;
|
||||
|
||||
sc->rfb_port = 5900;
|
||||
|
||||
error = pci_fbuf_parse_opts(sc, opts);
|
||||
if (error != 0)
|
||||
goto done;
|
||||
|
@ -897,11 +897,11 @@ rfb_init(char *hostname, int port, int wait)
|
||||
|
||||
sin.sin_len = sizeof(sin);
|
||||
sin.sin_family = AF_INET;
|
||||
sin.sin_port = htons(port);
|
||||
sin.sin_port = port ? htons(port) : htons(5900);
|
||||
if (hostname && strlen(hostname) > 0)
|
||||
inet_pton(AF_INET, hostname, &(sin.sin_addr));
|
||||
else
|
||||
sin.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||
|
||||
if (bind(rc->sfd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
|
||||
perror("bind");
|
||||
|
Loading…
Reference in New Issue
Block a user