Skip to content

Commit

Permalink
net: fix vnet_hdr handling in solaris tap code
Browse files Browse the repository at this point in the history
Print an error if the user specifies vnet_hdr=1 on the cmdline.

Signed-off-by: Mark McLoughlin <[email protected]>
Signed-off-by: Anthony Liguori <[email protected]>
  • Loading branch information
markmc authored and Anthony Liguori committed Dec 3, 2009
1 parent df6c2a0 commit f5c5e38
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions net/tap-solaris.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,17 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required
return -1;
}
pstrcpy(ifname, ifname_size, dev);
if (*vnet_hdr) {
/* Solaris doesn't have IFF_VNET_HDR */
*vnet_hdr = 0;

if (vnet_hdr_required && !*vnet_hdr) {
qemu_error("vnet_hdr=1 requested, but no kernel "
"support for IFF_VNET_HDR available");
close(fd);
return -1;
}
}
fcntl(fd, F_SETFL, O_NONBLOCK);
return fd;
}
Expand Down

0 comments on commit f5c5e38

Please sign in to comment.