summaryrefslogtreecommitdiff
path: root/src/network/networkd-tuntap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-tuntap.c')
-rw-r--r--src/network/networkd-tuntap.c10
1 files changed, 4 insertions, 6 deletions
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)