[systemd-commits] 2 commits - man/systemd.socket.xml src/dbus-execute.h src/dbus-socket.c src/load-fragment.c src/socket.c src/socket.h src/socket-util.c src/socket-util.h
Lennart Poettering
lennart at kemper.freedesktop.org
Thu May 19 04:23:01 PDT 2011
man/systemd.socket.xml | 8 ++++++++
src/dbus-execute.h | 3 +++
src/dbus-socket.c | 2 ++
src/load-fragment.c | 1 +
src/socket-util.c | 7 +++++++
src/socket-util.h | 1 +
src/socket.c | 3 +++
src/socket.h | 1 +
8 files changed, 26 insertions(+)
New commits:
commit beaccad011633e15bd544a3d2d9100178b53dde6
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu May 19 13:22:53 2011 +0200
exec: expose tty reset options in dbus introspection data
diff --git a/src/dbus-execute.h b/src/dbus-execute.h
index bf3160b..42df5aa 100644
--- a/src/dbus-execute.h
+++ b/src/dbus-execute.h
@@ -69,6 +69,9 @@
" <property name=\"StandardOutput\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"StandardError\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"TTYPath\" type=\"s\" access=\"read\"/>\n" \
+ " <property name=\"TTYReset\" type=\"b\" access=\"read\"/>\n" \
+ " <property name=\"TTYVHangup\" type=\"b\" access=\"read\"/>\n" \
+ " <property name=\"TTYVTDisallocate\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"SyslogPriority\" type=\"i\" access=\"read\"/>\n" \
" <property name=\"SyslogIdentifier\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"SyslogLevelPrefix\" type=\"b\" access=\"read\"/>\n" \
commit 6b6d2deecc246cf9780d31e1cd03a52aa5bfd9d2
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu May 19 13:22:31 2011 +0200
socket: expose IP_TRANSPARENT
diff --git a/man/systemd.socket.xml b/man/systemd.socket.xml
index 22567d4..5350266 100644
--- a/man/systemd.socket.xml
+++ b/man/systemd.socket.xml
@@ -507,6 +507,14 @@
</varlistentry>
<varlistentry>
+ <term><varname>Transparent=</varname></term>
+ <listitem><para>Takes a boolean
+ value. Controls the IP_TRANSPARENT
+ option. Defaults to
+ <option>false</option>.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><varname>TCPCongestion=</varname></term>
<listitem><para>Takes a string
value. Controls the TCP congestion
diff --git a/src/dbus-socket.c b/src/dbus-socket.c
index 3ec78a0..f6edc80 100644
--- a/src/dbus-socket.c
+++ b/src/dbus-socket.c
@@ -49,6 +49,7 @@
" <property name=\"IPTTL\" type=\"i\" access=\"read\"/>\n" \
" <property name=\"PipeSize\" type=\"t\" access=\"read\"/>\n" \
" <property name=\"FreeBind\" type=\"b\" access=\"read\"/>\n" \
+ " <property name=\"Transparent\" type=\"b\" access=\"read\"/>\n" \
" <property name=\"Mark\" type=\"i\" access=\"read\"/>\n" \
" <property name=\"MaxConnections\" type=\"u\" access=\"read\"/>\n" \
" <property name=\"NAccepted\" type=\"u\" access=\"read\"/>\n" \
@@ -107,6 +108,7 @@ DBusHandlerResult bus_socket_message_handler(Unit *u, DBusConnection *c, DBusMes
{ "org.freedesktop.systemd1.Socket", "IPTTL", bus_property_append_int, "i", &u->socket.ip_ttl },
{ "org.freedesktop.systemd1.Socket", "PipeSize", bus_property_append_size, "t", &u->socket.pipe_size },
{ "org.freedesktop.systemd1.Socket", "FreeBind", bus_property_append_bool, "b", &u->socket.free_bind },
+ { "org.freedesktop.systemd1.Socket", "Transparent", bus_property_append_bool, "b", &u->socket.transparent },
{ "org.freedesktop.systemd1.Socket", "Mark", bus_property_append_int, "i", &u->socket.mark },
{ "org.freedesktop.systemd1.Socket", "MaxConnections", bus_property_append_unsigned, "u", &u->socket.max_connections },
{ "org.freedesktop.systemd1.Socket", "NConnections", bus_property_append_unsigned, "u", &u->socket.n_connections },
diff --git a/src/load-fragment.c b/src/load-fragment.c
index 321214e..dbb0762 100644
--- a/src/load-fragment.c
+++ b/src/load-fragment.c
@@ -1995,6 +1995,7 @@ static int load_from_path(Unit *u, const char *path) {
{ "Mark", config_parse_int, 0, &u->socket.mark, "Socket" },
{ "PipeSize", config_parse_size, 0, &u->socket.pipe_size, "Socket" },
{ "FreeBind", config_parse_bool, 0, &u->socket.free_bind, "Socket" },
+ { "Transparent", config_parse_bool, 0, &u->socket.transparent, "Socket" },
{ "TCPCongestion", config_parse_string, 0, &u->socket.tcp_congestion, "Socket" },
{ "MessageQueueMaxMessages", config_parse_long, 0, &u->socket.mq_maxmsg, "Socket" },
{ "MessageQueueMessageSize", config_parse_long, 0, &u->socket.mq_msgsize, "Socket" },
diff --git a/src/socket-util.c b/src/socket-util.c
index 779850d..e2e8988 100644
--- a/src/socket-util.c
+++ b/src/socket-util.c
@@ -389,6 +389,7 @@ int socket_address_listen(
SocketAddressBindIPv6Only only,
const char *bind_to_device,
bool free_bind,
+ bool transparent,
mode_t directory_mode,
mode_t socket_mode,
const char *label,
@@ -433,6 +434,12 @@ int socket_address_listen(
if (setsockopt(fd, IPPROTO_IP, IP_FREEBIND, &one, sizeof(one)) < 0)
log_warning("IP_FREEBIND failed: %m");
}
+
+ if (transparent) {
+ one = 1;
+ if (setsockopt(fd, IPPROTO_IP, IP_TRANSPARENT, &one, sizeof(one)) < 0)
+ log_warning("IP_TRANSPARENT failed: %m");
+ }
}
one = 1;
diff --git a/src/socket-util.h b/src/socket-util.h
index 0e891ec..8ccbd37 100644
--- a/src/socket-util.h
+++ b/src/socket-util.h
@@ -78,6 +78,7 @@ int socket_address_listen(
SocketAddressBindIPv6Only only,
const char *bind_to_device,
bool free_bind,
+ bool transparent,
mode_t directory_mode,
mode_t socket_mode,
const char *label,
diff --git a/src/socket.c b/src/socket.c
index 6c935c4..e8b2d96 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -404,6 +404,7 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
"%sDirectoryMode: %04o\n"
"%sKeepAlive: %s\n"
"%sFreeBind: %s\n"
+ "%sTransparent: %s\n"
"%sTCPCongestion: %s\n",
prefix, socket_state_to_string(s->state),
prefix, socket_address_bind_ipv6_only_to_string(s->bind_ipv6_only),
@@ -412,6 +413,7 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
prefix, s->directory_mode,
prefix, yes_no(s->keep_alive),
prefix, yes_no(s->free_bind),
+ prefix, yes_no(s->transparent),
prefix, strna(s->tcp_congestion));
if (s->control_pid > 0)
@@ -897,6 +899,7 @@ static int socket_open_fds(Socket *s) {
s->bind_ipv6_only,
s->bind_to_device,
s->free_bind,
+ s->transparent,
s->directory_mode,
s->socket_mode,
label,
diff --git a/src/socket.h b/src/socket.h
index 01ea48d..92f11d7 100644
--- a/src/socket.h
+++ b/src/socket.h
@@ -116,6 +116,7 @@ struct Socket {
/* Socket options */
bool keep_alive;
bool free_bind;
+ bool transparent;
int priority;
int mark;
size_t receive_buffer;
More information about the systemd-commits
mailing list