]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/net/geneve.c
Merge branch 'parisc-5.3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
[linux.git] / drivers / net / geneve.c
index 5583d993480d2c11ed17afa189385627dcbad17b..cb2ea8facd8d901aea7a494b9181cce428bd8851 100644 (file)
@@ -1,11 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * GENEVE: Generic Network Virtualization Encapsulation
  *
  * Copyright (c) 2015 Red Hat, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -14,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/etherdevice.h>
 #include <linux/hash.h>
+#include <net/ipv6_stubs.h>
 #include <net/dst_metadata.h>
 #include <net/gro_cells.h>
 #include <net/rtnetlink.h>
@@ -22,8 +20,6 @@
 
 #define GENEVE_NETDEV_VER      "0.6"
 
-#define GENEVE_UDP_PORT                6081
-
 #define GENEVE_N_VID           (1u << 24)
 #define GENEVE_VID_MASK                (GENEVE_N_VID - 1)
 
@@ -396,7 +392,7 @@ static int geneve_udp_encap_err_lookup(struct sock *sk, struct sk_buff *skb)
        u8 zero_vni[3] = { 0 };
        u8 *vni = zero_vni;
 
-       if (skb->len < GENEVE_BASE_HLEN)
+       if (!pskb_may_pull(skb, skb_transport_offset(skb) + GENEVE_BASE_HLEN))
                return -EINVAL;
 
        geneveh = geneve_hdr(skb);