summaryrefslogtreecommitdiff
path: root/src/core/socket.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-18 11:30:06 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-18 11:30:06 +0100
commitedf1e713816cd514ba2d9c3e1a7661a2d27d38c8 (patch)
treeb7663dc33245e39d0a28d69137df60f3b464c211 /src/core/socket.c
parentdd050decb6ad131ebdeabb71c4f9ecb4733269c0 (diff)
parentfaf1cc9323133384c6097763d7167a779aae2c6e (diff)
Merge pull request #1889 from ssahani/socket-proto
socket: Add support for socket protcol
Diffstat (limited to 'src/core/socket.c')
-rw-r--r--src/core/socket.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index 5b9e32ce9d..687675b24e 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1266,6 +1266,19 @@ static int socket_open_fds(Socket *s) {
know_label = true;
}
+ /* Apply the socket protocol */
+ switch(p->address.type) {
+ case SOCK_STREAM:
+ case SOCK_SEQPACKET:
+ if (p->socket->socket_protocol == IPPROTO_SCTP)
+ p->address.protocol = p->socket->socket_protocol;
+ break;
+ case SOCK_DGRAM:
+ if (p->socket->socket_protocol == IPPROTO_UDPLITE)
+ p->address.protocol = p->socket->socket_protocol;
+ break;
+ }
+
r = socket_address_listen(
&p->address,
SOCK_CLOEXEC|SOCK_NONBLOCK,