Revert "drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets" [Linux 3.16.72]

This Linux kernel change "Revert “drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets”" is included in the Linux 3.16.72 release. This change is authored by Vlad Yasevich <vyasevich [at] gmail.com> on Tue Feb 3 16:36:16 2015 -0500. The commit for this change in Linux stable tree is 13e380c (patch) which is from upstream commit 72f6510. The same Linux upstream change may have been applied to various maintained Linux releases and you can find all Linux releases containing changes from upstream 72f6510.

Revert "drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets"

commit 72f6510745592c87f612f62ae4f16bb002934df4 upstream.

This reverts commit 5188cd44c55db3e92cd9e77a40b5baa7ed4340f7.

Now that GSO layer can track if fragment id has been selected
and can allocate one if necessary, we don't need to do this in
tap and macvtap.  This reverts most of the code and only keeps
the new ipv6 fragment id generation function that is still needed.

Fixes: 3d0ad09412ff (drivers/net: Disable UFO through virtio)
Signed-off-by: Vladislav Yasevich <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Ben Hutchings <[email protected]>

There are 9 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/net/macvtap.c | 3 ---
 drivers/net/tun.c     | 6 +-----
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 47eba38..75cc676 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -16,7 +16,6 @@
 #include <linux/idr.h>
 #include <linux/fs.h>

-#include <net/ipv6.h>
 #include <net/net_namespace.h>
 #include <net/rtnetlink.h>
 #include <net/sock.h>
@@ -571,8 +570,6 @@ static int macvtap_skb_from_vnet_hdr(struct sk_buff *skb,
            break;
        case VIRTIO_NET_HDR_GSO_UDP:
            gso_type = SKB_GSO_UDP;
-           if (skb->protocol == htons(ETH_P_IPV6))
-               ipv6_proxy_select_ident(skb);
            break;
        default:
            return -EINVAL;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 48ac45f..1bbcb27 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -65,7 +65,6 @@
 #include <linux/nsproxy.h>
 #include <linux/virtio_net.h>
 #include <linux/rcupdate.h>
-#include <net/ipv6.h>
 #include <net/net_namespace.h>
 #include <net/netns/generic.h>
 #include <net/rtnetlink.h>
@@ -1143,8 +1142,6 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
        break;
    }

-   skb_reset_network_header(skb);
-
    if (gso.gso_type != VIRTIO_NET_HDR_GSO_NONE) {
        pr_debug("GSO!\n");
        switch (gso.gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
@@ -1156,8 +1153,6 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
            break;
        case VIRTIO_NET_HDR_GSO_UDP:
            skb_shinfo(skb)->gso_type = SKB_GSO_UDP;
-           if (skb->protocol == htons(ETH_P_IPV6))
-               ipv6_proxy_select_ident(skb);
            break;
        default:
            tun->dev->stats.rx_frame_errors++;
@@ -1187,6 +1182,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
        skb_shinfo(skb)->tx_flags |= SKBTX_SHARED_FRAG;
    }

+   skb_reset_network_header(skb);
    skb_probe_transport_header(skb, 0);

    rxhash = skb_get_hash(skb);

Leave a Reply

Your email address will not be published. Required fields are marked *