summaryrefslogtreecommitdiff
path: root/lib/netdev-linux.c
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2009-08-03 16:11:43 -0700
committerJesse Gross <jesse@nicira.com>2009-09-30 12:43:05 -0700
commit1a487cec005de9f77cb9d1a2492681af293f73fb (patch)
tree700ce9a38848e1840292002cbdda61a3354778d4 /lib/netdev-linux.c
parenteffb3acf60ddf247236f46f69897ccb9582dacd2 (diff)
downloadopenvswitch-1a487cec005de9f77cb9d1a2492681af293f73fb.tar.gz
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.
Diffstat (limited to 'lib/netdev-linux.c')
-rw-r--r--lib/netdev-linux.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 5abf6e16b..50a0d2da7 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -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;
}