> + int features = 0; > + if (ioctl(tap_fd, TUNGETFEATURES, &features) < 0) { > + PMD_LOG(ERR, "ioctl(TUNGETFEATURES) %s", strerror(errno)); > + goto error; > + } > + > + int flags = IFF_TAP | IFF_MULTI_QUEUE | IFF_NO_PI; > + if ((features & flags) == 0) {
Comparison will only fail if all three flags are missing. Should be: if ((features & flags) != flags) { > + PMD_LOG(ERR, "TUN features %#x missing support for %#x", > + features, features & flags); Should be: features, (features & flags) ^ flags); > + goto error; > + }