datapath: Kill VPORT_F_TUN_ID vport flag.
[sliver-openvswitch.git] / datapath / vport-lisp.c
index d45a4cc..ca2b441 100644 (file)
@@ -219,7 +219,6 @@ static int lisp_rcv(struct sock *sk, struct sk_buff *skb)
        /* Save outer tunnel values */
        iph = ip_hdr(skb);
        tnl_tun_key_init(&tun_key, iph, key, OVS_TNL_F_KEY);
-       OVS_CB(skb)->tun_key = &tun_key;
 
        /* Drop non-IP inner packets */
        inner_iph = (struct iphdr *)(lisph + 1);
@@ -241,7 +240,7 @@ static int lisp_rcv(struct sock *sk, struct sk_buff *skb)
        ethh->h_source[0] = 0x02;
        ethh->h_proto = protocol;
 
-       ovs_tnl_rcv(vport_from_priv(lisp_port), skb);
+       ovs_tnl_rcv(vport_from_priv(lisp_port), skb, &tun_key);
        goto out;
 
 error:
@@ -365,10 +364,8 @@ static int lisp_tnl_send(struct vport *vport, struct sk_buff *skb)
        int tnl_len;
        int network_offset = skb_network_offset(skb);
 
-       if (unlikely(!OVS_CB(skb)->tun_key)) {
-               ovs_vport_record_error(vport, VPORT_E_TX_ERROR);
-               goto free;
-       }
+       if (unlikely(!OVS_CB(skb)->tun_key))
+               return -EINVAL;
 
        /* We only encapsulate IPv4 and IPv6 packets */
        switch (skb->protocol) {
@@ -380,13 +377,8 @@ static int lisp_tnl_send(struct vport *vport, struct sk_buff *skb)
                                LISP_HLEN, lisp_build_header);
                return tnl_len > 0 ? tnl_len + network_offset : tnl_len;
        default:
-               ovs_vport_record_error(vport, VPORT_E_TX_DROPPED);
-               goto free;
+               return 0;
        }
-
-free:
-       kfree_skb(skb);
-       return 0;
 }
 
 static const char *lisp_get_name(const struct vport *vport)
@@ -397,7 +389,6 @@ static const char *lisp_get_name(const struct vport *vport)
 
 const struct vport_ops ovs_lisp_vport_ops = {
        .type           = OVS_VPORT_TYPE_LISP,
-       .flags          = VPORT_F_TUN_ID,
        .create         = lisp_tnl_create,
        .destroy        = lisp_tnl_destroy,
        .get_name       = lisp_get_name,