2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

netdev-linux: Fix tap device using wrong FD.

Tap devices were doing ioctls on the AF_INET socket, instead of the
FD opened on the tap device.
This commit is contained in:
Jesse Gross
2009-08-03 16:11:43 -07:00
parent effb3acf60
commit 1a487cec00

View File

@@ -239,9 +239,11 @@ netdev_linux_open(const char *name, char *suffix, int ethertype,
/* Create tap device. */
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
error = netdev_linux_do_ioctl(&netdev->netdev, &ifr,
TUNSETIFF, "TUNSETIFF");
if (error) {
strncpy(ifr.ifr_name, suffix, sizeof ifr.ifr_name);
if (ioctl(netdev->tap_fd, TUNSETIFF, &ifr) == -1) {
VLOG_WARN("%s: creating tap device failed: %s", suffix,
strerror(errno));
error = errno;
goto error;
}