diff options
Diffstat (limited to 'drivers/net/macvtap.c')
-rw-r--r-- | drivers/net/macvtap.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 65e2892342bd..6f226de655a4 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/idr.h> | 16 | #include <linux/idr.h> |
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | 18 | ||
19 | #include <net/ipv6.h> | ||
19 | #include <net/net_namespace.h> | 20 | #include <net/net_namespace.h> |
20 | #include <net/rtnetlink.h> | 21 | #include <net/rtnetlink.h> |
21 | #include <net/sock.h> | 22 | #include <net/sock.h> |
@@ -65,7 +66,7 @@ static struct cdev macvtap_cdev; | |||
65 | static const struct proto_ops macvtap_socket_ops; | 66 | static const struct proto_ops macvtap_socket_ops; |
66 | 67 | ||
67 | #define TUN_OFFLOADS (NETIF_F_HW_CSUM | NETIF_F_TSO_ECN | NETIF_F_TSO | \ | 68 | #define TUN_OFFLOADS (NETIF_F_HW_CSUM | NETIF_F_TSO_ECN | NETIF_F_TSO | \ |
68 | NETIF_F_TSO6 | NETIF_F_UFO) | 69 | NETIF_F_TSO6) |
69 | #define RX_OFFLOADS (NETIF_F_GRO | NETIF_F_LRO) | 70 | #define RX_OFFLOADS (NETIF_F_GRO | NETIF_F_LRO) |
70 | #define TAP_FEATURES (NETIF_F_GSO | NETIF_F_SG) | 71 | #define TAP_FEATURES (NETIF_F_GSO | NETIF_F_SG) |
71 | 72 | ||
@@ -569,7 +570,11 @@ static int macvtap_skb_from_vnet_hdr(struct sk_buff *skb, | |||
569 | gso_type = SKB_GSO_TCPV6; | 570 | gso_type = SKB_GSO_TCPV6; |
570 | break; | 571 | break; |
571 | case VIRTIO_NET_HDR_GSO_UDP: | 572 | case VIRTIO_NET_HDR_GSO_UDP: |
573 | pr_warn_once("macvtap: %s: using disabled UFO feature; please fix this program\n", | ||
574 | current->comm); | ||
572 | gso_type = SKB_GSO_UDP; | 575 | gso_type = SKB_GSO_UDP; |
576 | if (skb->protocol == htons(ETH_P_IPV6)) | ||
577 | ipv6_proxy_select_ident(skb); | ||
573 | break; | 578 | break; |
574 | default: | 579 | default: |
575 | return -EINVAL; | 580 | return -EINVAL; |
@@ -614,8 +619,6 @@ static void macvtap_skb_to_vnet_hdr(const struct sk_buff *skb, | |||
614 | vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4; | 619 | vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4; |
615 | else if (sinfo->gso_type & SKB_GSO_TCPV6) | 620 | else if (sinfo->gso_type & SKB_GSO_TCPV6) |
616 | vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV6; | 621 | vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV6; |
617 | else if (sinfo->gso_type & SKB_GSO_UDP) | ||
618 | vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_UDP; | ||
619 | else | 622 | else |
620 | BUG(); | 623 | BUG(); |
621 | if (sinfo->gso_type & SKB_GSO_TCP_ECN) | 624 | if (sinfo->gso_type & SKB_GSO_TCP_ECN) |
@@ -950,9 +953,6 @@ static int set_offload(struct macvtap_queue *q, unsigned long arg) | |||
950 | if (arg & TUN_F_TSO6) | 953 | if (arg & TUN_F_TSO6) |
951 | feature_mask |= NETIF_F_TSO6; | 954 | feature_mask |= NETIF_F_TSO6; |
952 | } | 955 | } |
953 | |||
954 | if (arg & TUN_F_UFO) | ||
955 | feature_mask |= NETIF_F_UFO; | ||
956 | } | 956 | } |
957 | 957 | ||
958 | /* tun/tap driver inverts the usage for TSO offloads, where | 958 | /* tun/tap driver inverts the usage for TSO offloads, where |
@@ -963,7 +963,7 @@ static int set_offload(struct macvtap_queue *q, unsigned long arg) | |||
963 | * When user space turns off TSO, we turn off GSO/LRO so that | 963 | * When user space turns off TSO, we turn off GSO/LRO so that |
964 | * user-space will not receive TSO frames. | 964 | * user-space will not receive TSO frames. |
965 | */ | 965 | */ |
966 | if (feature_mask & (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_UFO)) | 966 | if (feature_mask & (NETIF_F_TSO | NETIF_F_TSO6)) |
967 | features |= RX_OFFLOADS; | 967 | features |= RX_OFFLOADS; |
968 | else | 968 | else |
969 | features &= ~RX_OFFLOADS; | 969 | features &= ~RX_OFFLOADS; |
@@ -1064,7 +1064,7 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd, | |||
1064 | case TUNSETOFFLOAD: | 1064 | case TUNSETOFFLOAD: |
1065 | /* let the user check for future flags */ | 1065 | /* let the user check for future flags */ |
1066 | if (arg & ~(TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 | | 1066 | if (arg & ~(TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 | |
1067 | TUN_F_TSO_ECN | TUN_F_UFO)) | 1067 | TUN_F_TSO_ECN)) |
1068 | return -EINVAL; | 1068 | return -EINVAL; |
1069 | 1069 | ||
1070 | rtnl_lock(); | 1070 | rtnl_lock(); |