summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNahum Shalman <nshalman@elys.com>2012-03-12 12:32:58 +0100
committerHans de Goede <hdegoede@redhat.com>2012-03-12 12:32:58 +0100
commit20c7323c9efb22c1aae37557814f21cf58c2a322 (patch)
treec9f9282ff9f922bdf789f260a8c354df3f5f1fd0
parent9a41e552962cb0cc0694a205988197a84914a2d6 (diff)
downloadspice-20c7323c9efb22c1aae37557814f21cf58c2a322.tar.gz
spice-20c7323c9efb22c1aae37557814f21cf58c2a322.tar.xz
spice-20c7323c9efb22c1aae37557814f21cf58c2a322.zip
server: don't fail on ENOPROTOOPT from setsockopt
If we allow listening on arbitrary sockets like unix sockets, we can get ENOPROTOOPT errors from setsockopt calls that set TCP specific options. This should be allowed to happen.
-rw-r--r--server/inputs_channel.c2
-rw-r--r--server/spicevmc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/server/inputs_channel.c b/server/inputs_channel.c
index 932ead72..42247613 100644
--- a/server/inputs_channel.c
+++ b/server/inputs_channel.c
@@ -470,7 +470,7 @@ static int inputs_channel_config_socket(RedChannelClient *rcc)
if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY,
&delay_val, sizeof(delay_val)) == -1) {
- if (errno != ENOTSUP) {
+ if (errno != ENOTSUP && errno != ENOPROTOOPT) {
red_printf("setsockopt failed, %s", strerror(errno));
return FALSE;
}
diff --git a/server/spicevmc.c b/server/spicevmc.c
index ea9271c7..2f1b8f77 100644
--- a/server/spicevmc.c
+++ b/server/spicevmc.c
@@ -92,7 +92,7 @@ static int spicevmc_red_channel_client_config_socket(RedChannelClient *rcc)
if (rcc->channel->type == SPICE_CHANNEL_USBREDIR) {
if (setsockopt(stream->socket, IPPROTO_TCP, TCP_NODELAY,
&delay_val, sizeof(delay_val)) != 0) {
- if (errno != ENOTSUP) {
+ if (errno != ENOTSUP && errno != ENOPROTOOPT) {
red_printf("setsockopt failed, %s", strerror(errno));
return FALSE;
}