aboutsummaryrefslogtreecommitdiff
path: root/net/tap-linux.c
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2009-10-22 17:49:16 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-30 08:39:29 -0500
commit9c282718aafd021661f0fa0431322a7df75705b0 (patch)
tree931d70eb2bd7065f0185452ce2d85ce4e4b2d30e /net/tap-linux.c
parent1faac1f7d48d3f7bfa2d168b1ad5680d3288f585 (diff)
net: move UFO support detection to tap-linux.c
Only supported on Linux Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net/tap-linux.c')
-rw-r--r--net/tap-linux.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/tap-linux.c b/net/tap-linux.c
index b6f1fad5e4..0f621a2315 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -112,6 +112,18 @@ int tap_probe_vnet_hdr(int fd)
return ifr.ifr_flags & IFF_VNET_HDR;
}
+int tap_probe_has_ufo(int fd)
+{
+ unsigned offload;
+
+ offload = TUN_F_CSUM | TUN_F_UFO;
+
+ if (ioctl(fd, TUNSETOFFLOAD, offload) < 0)
+ return 0;
+
+ return 1;
+}
+
void tap_fd_set_offload(int fd, int csum, int tso4,
int tso6, int ecn, int ufo)
{