TUN: set flag IFF_NO_PI

This commit is contained in:
Théophile Bastian 2020-06-05 16:13:40 +02:00
parent 0332766f0d
commit a497dade2e
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ TunDevice::TunDevice(const std::string& dev)
*
* IFF_NO_PI - Do not provide packet information
*/
ifr.ifr_flags = IFF_TUN;
ifr.ifr_flags = IFF_TUN | IFF_NO_PI;
if(!dev.empty()) {
if(dev.size() >= IFNAMSIZ - 2)
throw TunDevice::InitializationError("Device name is too long.");