[systemd-commits] 2 commits - man/systemd.netdev.xml src/network

Tom Gundersen tomegun at kemper.freedesktop.org
Thu Jul 3 02:38:09 PDT 2014


 man/systemd.netdev.xml        |   91 +++++++++---------------------------------
 src/network/networkd-netdev.c |    1 
 src/network/networkd-tuntap.c |   10 +---
 3 files changed, 25 insertions(+), 77 deletions(-)

New commits:
commit 72d33d99c5dda1aedf2e18b08236b86ecf5f520b
Author: Tom Gundersen <teg at jklm.no>
Date:   Thu Jul 3 11:25:07 2014 +0200

    networkd: tuntap - manpage fixes

diff --git a/man/systemd.netdev.xml b/man/systemd.netdev.xml
index a57ba7a..6498798 100644
--- a/man/systemd.netdev.xml
+++ b/man/systemd.netdev.xml
@@ -340,51 +340,45 @@
                         </variablelist>
         </refsect1>
         <refsect1>
-                <title>[TUN] Section Options</title>
+                <title>[Tun] Section Options</title>
 
-                        <para>The <literal>[TUN]</literal> section only applies for netdevs of kind
+                        <para>The <literal>[Tun]</literal> section only applies for netdevs of kind
                         <literal>tun</literal>, and accepts the following keys:</para>
 
                         <variablelist class='network-directives'>
                                 <varlistentry>
                                         <term><varname>OneQueue=</varname></term>
                                         <listitem><para>Takes a boolean argument. Configures whether
-                                        to enable disable one queue . it determines whether all packets
-                                        queue at the device (enabled), or a fixed number queue at the device and
-                                        the rest at the "qdisc". Defaults to <literal>no</literal>.</para>
+                                        all packets are queued at the device (enabled), or a fixed number
+                                        of packets are queued at the device and the rest at the
+                                        <literal>qdisc</literal>. Defaults to <literal>no</literal>.</para>
                                         </listitem>
                                 </varlistentry>
                                 <varlistentry>
                                         <term><varname>MultiQueue=</varname></term>
-                                        <listitem><para>Takes a boolean argument. Configures whether the
-                                        to disable or disable . Linux supports multiqueue tuntap which can
-                                        uses multiple file descriptors (queues) to parallelize
-                                        packets sending or receiving. The device allocation is the same as before,
-                                        and if user wants to create multiple queues. Defaults to
-                                        <literal>no</literal>.</para>
+                                        <listitem><para>Takes a boolean argument. Configures whether to
+                                        use multiple file descriptors (queues) to parallelize packets
+                                        sending and receiving. Defaults to <literal>no</literal>.</para>
                                         </listitem>
                                 </varlistentry>
                                 <varlistentry>
                                         <term><varname>PacketInfo=</varname></term>
-                                        <listitem><para>Takes a boolean argument. Configures whether the
-                                        to enable or disable . PacketInfo tells the kernel to not provide packet
-                                        information. The purpose of PacketInfo is to tell the kernel that packets
-                                        will be "pure" IP packets, with no added bytes. Otherwise (if PacketInfo is unset),
-                                        4 extra bytes are added to the beginning of the packet (2 flag bytes and 2 protocol bytes).
-                                        Defaults to <literal>no</literal>.</para>
+                                        <listitem><para>Takes a boolean argument. Configures whether packets
+                                        should be prepened with four extra bytes (two flag bytes and two
+                                        protocol bytes). If disabled it indicates that the packets will be
+                                        pure IP packets. Defaults to <literal>yes</literal>.</para>
                                         </listitem>
                                 </varlistentry>
                                 <varlistentry>
                                         <term><varname>User=</varname></term>
-                                        <listitem><para>User to be allowed to access this device. Give ownership to unprivileged users,
-                                        so that /dev/net/tun device to be usable by this user.
-                                      </para>
+                                        <listitem><para>User to grant access to the <filename>/dev/net/tun</filename>
+                                        device.</para>
                                         </listitem>
                                 </varlistentry>
                                 <varlistentry>
                                         <term><varname>Group=</varname></term>
-                                        <listitem><para>Group to be allowed to access this device. Give ownership to unprivileged group,
-                                        so that /dev/net/tun device to be usable by this group.</para>
+                                        <listitem><para>Group to grant access to the <filename>/dev/net/tun</filename>
+                                        device.</para>
                                         </listitem>
                                 </varlistentry>
 
@@ -393,58 +387,13 @@
         </refsect1>
 
         <refsect1>
-                <title>[TAP] Section Options</title>
+                <title>[Tap] Section Options</title>
 
-                        <para>The <literal>[TAP]</literal> section only applies for netdevs of kind
-                        <literal>tap</literal>, and accepts the following keys:</para>
+                        <para>The <literal>[Tap]</literal> section only applies for netdevs of kind
+                        <literal>tap</literal>, and accepts the same keys as the
+                        <literal>[Tun]</literal> section.</para>
         </refsect1>
 
-                        <variablelist class='network-directives'>
-                                <varlistentry>
-                                        <term><varname>OneQueue=</varname></term>
-                                        <listitem><para>Takes a boolean argument. Configures whether
-                                        to enable disable one queue . it determines whether all packets
-                                        queue at the device (enabled), or a fixed number queue at the device and
-                                        the rest at the "qdisc". Defaults to <literal>no</literal>.</para>
-                                        </listitem>
-                                </varlistentry>
-                                <varlistentry>
-                                        <term><varname>MultiQueue=</varname></term>
-                                        <listitem><para>Takes a boolean argument. Configures whether the
-                                        to disable or disable . From version 3.8, Linux supports multiqueue
-                                        tuntap which can uses multiple file descriptors (queues) to parallelize
-                                        packets sending or receiving. The device allocation is the same as before,
-                                        and if user wants to create multiple queues. Defaults to
-                                        <literal>no</literal>.</para>
-                                        </listitem>
-                                </varlistentry>
-                                <varlistentry>
-                                        <term><varname>PacketInfo=</varname></term>
-                                        <listitem><para>Takes a boolean argument. Configures whether the
-                                        to enable or disable . PacketInfo tells the kernel to not provide packet
-                                        information. The purpose of PacketInfo is to tell the kernel that packets
-                                        will be "pure" IP packets, with no added bytes. Otherwise (if PacketInfo is unset),
-                                        4 extra bytes are added to the beginning of the packet (2 flag bytes and 2 protocol bytes).
-                                        Defaults to <literal>no</literal>.</para>
-                                        </listitem>
-                                </varlistentry>
-                                <varlistentry>
-                                        <term><varname>User=</varname></term>
-                                        <listitem><para>User to be allowed to access this device. Give ownership to unprivileged users,
-                                        so that /dev/net/tun device to be usable by this user.
-                                      </para>
-                                        </listitem>
-                                </varlistentry>
-                                <varlistentry>
-                                        <term><varname>Group=</varname></term>
-                                        <listitem><para>Group to be allowed to access this device. Give ownership to unprivileged group,
-                                        so that /dev/net/tun device to be usable by this group.</para>
-                                        </listitem>
-                                </varlistentry>
-
-                        </variablelist>
-
-
         <refsect1>
                 <title>Example</title>
                 <example>

commit 63dadd9075abd913ba6bf87e5933beb8eb8eeefb
Author: Tom Gundersen <teg at jklm.no>
Date:   Thu Jul 3 11:37:05 2014 +0200

    networkd: tuntap - enable PacketInfo by default

diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
index a8c1ea3..5ee9da6 100644
--- a/src/network/networkd-netdev.c
+++ b/src/network/networkd-netdev.c
@@ -569,6 +569,7 @@ static int netdev_load_one(Manager *manager, const char *filename) {
         netdev->vxlanid = VXLAN_VID_MAX + 1;
         netdev->tunnel_pmtudisc = true;
         netdev->learning = true;
+        netdev->packet_info = true;
 
         r = config_parse(NULL, filename, file,
                          "Match\0NetDev\0VLAN\0MACVLAN\0VXLAN\0Tunnel\0Peer\0Tun\0Tap\0",
diff --git a/src/network/networkd-tuntap.c b/src/network/networkd-tuntap.c
index 19dc2ad..ae2d5c1 100644
--- a/src/network/networkd-tuntap.c
+++ b/src/network/networkd-tuntap.c
@@ -35,14 +35,12 @@ static int netdev_fill_tuntap_message(NetDev *netdev, struct ifreq *ifr) {
 
         memset(ifr, 0, sizeof(*ifr));
 
-        if (netdev->kind != NETDEV_KIND_TAP)
-                ifr->ifr_flags |= IFF_TUN;
-        else
+        if (netdev->kind == NETDEV_KIND_TAP)
                 ifr->ifr_flags |= IFF_TAP;
-
-        if (netdev->packet_info)
-                ifr->ifr_flags &= ~IFF_NO_PI;
         else
+                ifr->ifr_flags |= IFF_TUN;
+
+        if (!netdev->packet_info)
                 ifr->ifr_flags |= IFF_NO_PI;
 
         if (netdev->one_queue)



More information about the systemd-commits mailing list