summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-07-03 11:37:05 +0200
committerTom Gundersen <teg@jklm.no>2014-07-03 11:37:54 +0200
commit63dadd9075abd913ba6bf87e5933beb8eb8eeefb (patch)
treef4841eea7379de5face82a0f416f82b6e974d75f /src
parent6ef892fc05791a6609489df7b5d1b081819c5de9 (diff)
networkd: tuntap - enable PacketInfo by default
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-netdev.c1
-rw-r--r--src/network/networkd-tuntap.c10
2 files changed, 5 insertions, 6 deletions
diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
index a8c1ea3b44..5ee9da6de0 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 19dc2ad252..ae2d5c1e33 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)