* kernel, by Linus Torvalds and others.
*/
+#include <linux/hardirq.h>
#include <linux/if_vlan.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
/* Called with rcu_read_lock and bottom-halves disabled. */
static int internal_dev_xmit(struct sk_buff *skb, struct net_device *netdev)
{
- compute_ip_summed(skb, true);
+ if (unlikely(compute_ip_summed(skb, true))) {
+ kfree_skb(skb);
+ return 0;
+ }
+
vlan_copy_skb_tci(skb);
OVS_CB(skb)->flow = NULL;
return ERR_PTR(err);
}
-static int internal_dev_destroy(struct vport *vport)
+static void internal_dev_destroy(struct vport *vport)
{
struct netdev_vport *netdev_vport = netdev_vport_priv(vport);
/* unregister_netdevice() waits for an RCU grace period. */
unregister_netdevice(netdev_vport->dev);
-
- return 0;
}
static int internal_dev_recv(struct vport *vport, struct sk_buff *skb)
skb->dev = netdev;
skb->pkt_type = PACKET_HOST;
skb->protocol = eth_type_trans(skb, netdev);
+ forward_ip_summed(skb, false);
if (in_interrupt())
netif_rx(skb);
}
const struct vport_ops internal_vport_ops = {
- .type = ODP_VPORT_TYPE_INTERNAL,
+ .type = OVS_VPORT_TYPE_INTERNAL,
.flags = VPORT_F_REQUIRED | VPORT_F_GEN_STATS | VPORT_F_FLOW,
.create = internal_dev_create,
.destroy = internal_dev_destroy,
.is_running = netdev_is_running,
.get_operstate = netdev_get_operstate,
.get_ifindex = netdev_get_ifindex,
- .get_iflink = netdev_get_iflink,
.get_mtu = netdev_get_mtu,
.send = internal_dev_recv,
};