diff options
| author | Mao Zhongyi <maozy.fnst@cn.fujitsu.com> | 2017-09-04 22:35:37 +0800 |
|---|---|---|
| committer | Jason Wang <jasowang@redhat.com> | 2017-09-08 08:17:37 +0800 |
| commit | e1b24b649a8dbd941488402b719a81618980a3c0 (patch) | |
| tree | 5045a2ef5f3714efe8d0218b03afe070cfe69b61 /net/net.c | |
| parent | b38576cd020c3192d06aeabb6090d9f0d2b6d664 (diff) | |
| download | focaccia-qemu-e1b24b649a8dbd941488402b719a81618980a3c0.tar.gz focaccia-qemu-e1b24b649a8dbd941488402b719a81618980a3c0.zip | |
net/socket: Don't treat odd socket type as SOCK_STREAM
In net_socket_fd_init(), the 'default' case is odd: it warns, then continues as if the socket type was SOCK_STREAM. The comment explains "this could be a eg. a pty", but that makes no sense. If @fd really was a pty, getsockopt() would fail with ENOTSOCK. If @fd was a socket, but neither SOCK_DGRAM nor SOCK_STREAM. It should not be treated as if it was SOCK_STREAM. Turn this case into an Error. If there is a genuine reason to support something like SOCK_RAW, it should be explicitly handled. Cc: jasowang@redhat.com Cc: armbru@redhat.com Cc: berrange@redhat.com Cc: armbru@redhat.com Cc: eblake@redhat.com Suggested-by: Markus Armbruster <armbru@redhat.com> Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Mao Zhongyi <maozy.fnst@cn.fujitsu.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/net.c')
0 files changed, 0 insertions, 0 deletions