Skip to content

Commit

Permalink
ctapdev: create tap devices with carrier off
Browse files Browse the repository at this point in the history
Since linux 6.0 it is possible to create tap devices with the carrier
off instead of needing to set it off after creation [1].

This prevents a race between bring up and setting the carrier off.

[1] torvalds/linux@195624d

Signed-off-by: Jonas Gorski <[email protected]>
  • Loading branch information
KanjiMonster committed Feb 14, 2024
1 parent ad9ca1a commit 8d50e8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/netlink/ctapdev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void ctapdev::tap_open() {
}

memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
ifr.ifr_flags = IFF_TAP | IFF_NO_PI | IFF_NO_CARRIER;
strncpy(ifr.ifr_name, devname.c_str(), IFNAMSIZ - 1);
hwaddr.pack(reinterpret_cast<uint8_t *>(ifr.ifr_hwaddr.sa_data), ETH_ALEN);

Expand Down

0 comments on commit 8d50e8c

Please sign in to comment.