jsonrpc: Fix potential memory leak.
[openvswitch] / datapath / datapath.c
index 76569f504072d039dd0f36cc7871e61c5490930b..6365f9474564dbac9c7be08d6c697a416bda155b 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/rculist.h>
 #include <linux/workqueue.h>
 #include <linux/dmi.h>
+#include <net/inet_ecn.h>
 #include <net/llc.h>
 
 #include "openvswitch/datapath-protocol.h"
@@ -358,6 +359,7 @@ static int new_nbp(struct datapath *dp, struct net_device *dev, int port_no)
                 * in dp_frame_hook().  In turn dp_frame_hook() can reject them
                 * back to network stack, but that's a waste of time. */
        }
+       dev_disable_lro(dev);
        rcu_assign_pointer(dp->ports[port_no], p);
        list_add_rcu(&p->node, &dp->port_list);
        dp->n_ports++;
@@ -505,6 +507,11 @@ out:
 static void
 do_port_input(struct net_bridge_port *p, struct sk_buff *skb) 
 {
+       /* LRO isn't suitable for bridging.  We turn it off but make sure
+        * that it wasn't reactivated. */
+       if (skb_warn_if_lro(skb))
+               return;
+
        /* Make our own copy of the packet.  Otherwise we will mangle the
         * packet for anyone who came before us (e.g. tcpdump via AF_PACKET).
         * (No one comes after us, since we tell handle_bridge() that we took
@@ -924,6 +931,11 @@ static int validate_actions(const struct sw_flow_actions *actions)
                                return -EINVAL;
                        break;
 
+               case ODPAT_SET_NW_TOS:
+                       if (a->nw_tos.nw_tos & INET_ECN_MASK)
+                               return -EINVAL;
+                       break;
+
                default:
                        if (a->type >= ODPAT_N_ACTIONS)
                                return -EOPNOTSUPP;