diff options
Diffstat (limited to 'mktuntap.c')
-rw-r--r-- | mktuntap.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mktuntap.c b/mktuntap.c index 8cbc335..76b02c7 100644 --- a/mktuntap.c +++ b/mktuntap.c @@ -61,10 +61,12 @@ void ex_usage() int main(int argc, char **argv) { char *ifr_name_in = NULL; - bool name_env = true, tap = false, tun = false, vnet_hdr = false; + bool name_env = true; + bool tap = false, tun = false; + bool vnet_hdr = false, no_pi = true; int c; - while ((c = getopt(argc, argv, "+npvEi:")) != -1) { + while ((c = getopt(argc, argv, "+npvPEi:")) != -1) { switch (c) { case 'n': tun = true; @@ -75,6 +77,9 @@ int main(int argc, char **argv) case 'v': vnet_hdr = true; break; + case 'P': + no_pi = false; + break; case 'E': name_env = false; break; @@ -117,6 +122,8 @@ int main(int argc, char **argv) int target_fd = (int)target_fd_l; short flags = tap ? IFF_TAP : IFF_TUN; + if (no_pi) + flags |= IFF_NO_PI; if (vnet_hdr) flags |= IFF_VNET_HDR; int tuntap_fd = tuntap_alloc(ifr_name_, flags); |