A trivial cleanup removing a duplicated code line.

Signed-off-by: Michael S. Tsirkin <[email protected]>
---
 include/linux/virtio_net.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 85ec1039f73a..a9ed42013476 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -570,8 +570,8 @@ virtio_net_hdr_tnl_to_skb(struct sk_buff *skb,
                        return -EINVAL;
        }
 
-       skb_set_inner_protocol(skb, inner_isv6 ? htons(ETH_P_IPV6) :
-                           htons(ETH_P_IP));
+       inner_proto = inner_isv6 ? htons(ETH_P_IPV6) : htons(ETH_P_IP);
+       skb_set_inner_protocol(skb, inner_proto);
        if (hdr->flags & VIRTIO_NET_HDR_F_UDP_TUNNEL_CSUM) {
                if (!tnl_csum_negotiated)
                        return -EINVAL;
@@ -591,7 +591,6 @@ virtio_net_hdr_tnl_to_skb(struct sk_buff *skb,
         * We know VIRTIO_NET_HDR_F_NEEDS_CSUM was set so 
__virtio_net_hdr_to_skb
         * set CHECKSUM_PARTIAL.
         */
-       inner_proto = inner_isv6 ? htons(ETH_P_IPV6) : htons(ETH_P_IP);
        if (virtio_net_csum_partial_ok_at_offset(skb, gso_inner_type, inner_nh,
                                                 inner_proto))
                return 0;
-- 
MST


Reply via email to