]> Pileus Git - ~andy/linux/blobdiff - drivers/net/vxlan.c
vxlan: remove net arg from vxlan[6]_xmit_skb()
[~andy/linux] / drivers / net / vxlan.c
index 3ffb22d684a991b4b4f2ff50692dd5b86216628a..a334bfb91c5a1cac97f92fa454d56c83e842bb0a 100644 (file)
@@ -44,6 +44,7 @@
 #include <net/ipv6.h>
 #include <net/addrconf.h>
 #include <net/ip6_tunnel.h>
+#include <net/ip6_checksum.h>
 #endif
 
 #define VXLAN_VERSION  "0.1"
@@ -477,7 +478,7 @@ static struct vxlan_fdb *__vxlan_find_mac(struct vxlan_dev *vxlan,
        struct vxlan_fdb *f;
 
        hlist_for_each_entry_rcu(f, head, hlist) {
-               if (compare_ether_addr(mac, f->eth_addr) == 0)
+               if (ether_addr_equal(mac, f->eth_addr))
                        return f;
        }
 
@@ -1048,8 +1049,7 @@ static void vxlan_rcv(struct vxlan_sock *vs,
        skb->protocol = eth_type_trans(skb, vxlan->dev);
 
        /* Ignore packet loops (and multicast echo) */
-       if (compare_ether_addr(eth_hdr(skb)->h_source,
-                              vxlan->dev->dev_addr) == 0)
+       if (ether_addr_equal(eth_hdr(skb)->h_source, vxlan->dev->dev_addr))
                goto drop;
 
        /* Re-examine inner Ethernet packet */
@@ -1319,7 +1319,7 @@ static bool route_shortcircuit(struct net_device *dev, struct sk_buff *skb)
        if (n) {
                bool diff;
 
-               diff = compare_ether_addr(eth_hdr(skb)->h_dest, n->ha) != 0;
+               diff = !ether_addr_equal(eth_hdr(skb)->h_dest, n->ha);
                if (diff) {
                        memcpy(eth_hdr(skb)->h_source, eth_hdr(skb)->h_dest,
                                dev->addr_len);
@@ -1380,7 +1380,7 @@ static int handle_offloads(struct sk_buff *skb)
 }
 
 #if IS_ENABLED(CONFIG_IPV6)
-static int vxlan6_xmit_skb(struct net *net, struct vxlan_sock *vs,
+static int vxlan6_xmit_skb(struct vxlan_sock *vs,
                           struct dst_entry *dst, struct sk_buff *skb,
                           struct net_device *dev, struct in6_addr *saddr,
                           struct in6_addr *daddr, __u8 prio, __u8 ttl,
@@ -1475,7 +1475,7 @@ static int vxlan6_xmit_skb(struct net *net, struct vxlan_sock *vs,
 }
 #endif
 
-int vxlan_xmit_skb(struct net *net, struct vxlan_sock *vs,
+int vxlan_xmit_skb(struct vxlan_sock *vs,
                   struct rtable *rt, struct sk_buff *skb,
                   __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df,
                   __be16 src_port, __be16 dst_port, __be32 vni)
@@ -1528,8 +1528,7 @@ int vxlan_xmit_skb(struct net *net, struct vxlan_sock *vs,
        if (err)
                return err;
 
-       return iptunnel_xmit(net, rt, skb, src, dst,
-                       IPPROTO_UDP, tos, ttl, df);
+       return iptunnel_xmit(rt, skb, src, dst, IPPROTO_UDP, tos, ttl, df);
 }
 EXPORT_SYMBOL_GPL(vxlan_xmit_skb);
 
@@ -1652,7 +1651,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
                tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
                ttl = ttl ? : ip4_dst_hoplimit(&rt->dst);
 
-               err = vxlan_xmit_skb(dev_net(dev), vxlan->vn_sock, rt, skb,
+               err = vxlan_xmit_skb(vxlan->vn_sock, rt, skb,
                                     fl4.saddr, dst->sin.sin_addr.s_addr,
                                     tos, ttl, df, src_port, dst_port,
                                     htonl(vni << 8));
@@ -1671,7 +1670,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
                fl6.flowi6_oif = rdst->remote_ifindex;
                fl6.daddr = dst->sin6.sin6_addr;
                fl6.saddr = vxlan->saddr.sin6.sin6_addr;
-               fl6.flowi6_proto = skb->protocol;
+               fl6.flowi6_proto = IPPROTO_UDP;
 
                if (ipv6_stub->ipv6_dst_lookup(sk, &ndst, &fl6)) {
                        netdev_dbg(dev, "no route to %pI6\n",
@@ -1704,7 +1703,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
 
                ttl = ttl ? : ip6_dst_hoplimit(ndst);
 
-               err = vxlan6_xmit_skb(dev_net(dev), vxlan->vn_sock, ndst, skb,
+               err = vxlan6_xmit_skb(vxlan->vn_sock, ndst, skb,
                                      dev, &fl6.saddr, &fl6.daddr, 0, ttl,
                                      src_port, dst_port, htonl(vni << 8));
 #endif