summaryrefslogtreecommitdiff
path: root/src/core/load-fragment.c
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@gmail.com>2015-11-16 12:15:47 +0530
committerSusant Sahani <ssahani@gmail.com>2015-11-18 09:34:18 +0530
commit74bb646ee5a812e91949c03fa461bc4bd7d2d7b8 (patch)
tree77005e44f0d3679e44a2be084aef627ddd92471c /src/core/load-fragment.c
parent92939fc4c0261dccd4b755186aba84a9b1412bed (diff)
socket: Add support for socket protcol
Now we don't support the socket protocol like sctp and udplite . This patch add a new config param SocketProtocol: udplite/sctp With this now we can configure the protocol as udplite = IPPROTO_UDPLITE sctp = IPPROTO_SCTP Tested with nspawn:
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r--src/core/load-fragment.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index dda79267f7..d5cf476fda 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -421,6 +421,37 @@ int config_parse_socket_listen(const char *unit,
return 0;
}
+int config_parse_socket_protocol(const char *unit,
+ const char *filename,
+ unsigned line,
+ const char *section,
+ unsigned section_line,
+ const char *lvalue,
+ int ltype,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+ Socket *s;
+
+ assert(filename);
+ assert(lvalue);
+ assert(rvalue);
+ assert(data);
+
+ s = SOCKET(data);
+
+ if (streq(rvalue, "udplite"))
+ s->socket_protocol = IPPROTO_UDPLITE;
+ else if (streq(rvalue, "sctp"))
+ s->socket_protocol = IPPROTO_SCTP;
+ else {
+ log_syntax(unit, LOG_ERR, filename, line, 0, "Socket protocol not supported, ignoring: %s", rvalue);
+ return 0;
+ }
+
+ return 0;
+}
+
int config_parse_socket_bind(const char *unit,
const char *filename,
unsigned line,