Prepare Open vSwitch 1.1.2 release.
[sliver-openvswitch.git] / lib / dpif-netdev.c
index 417ed6e..486ba48 100644 (file)
@@ -375,7 +375,7 @@ do_add_port(struct dp_netdev *dp, const char *devname, const char *type,
     port->internal = internal;
 
     netdev_get_mtu(netdev, &mtu);
-    if (mtu > max_mtu) {
+    if (mtu != INT_MAX && mtu > max_mtu) {
         max_mtu = mtu;
     }
 
@@ -872,7 +872,7 @@ struct dp_netdev_flow_state {
     uint32_t bucket;
     uint32_t offset;
     struct nlattr *actions;
-    uint32_t keybuf[ODPUTIL_FLOW_KEY_U32S];
+    struct odputil_keybuf keybuf;
     struct dpif_flow_stats stats;
 };
 
@@ -909,9 +909,8 @@ dpif_netdev_flow_dump_next(const struct dpif *dpif, void *state_,
     if (key) {
         struct ofpbuf buf;
 
-        ofpbuf_use_stack(&buf, state->keybuf, sizeof state->keybuf);
+        ofpbuf_use_stack(&buf, &state->keybuf, sizeof state->keybuf);
         odp_flow_key_from_flow(&buf, &flow->key);
-        assert(buf.base == state->keybuf);
 
         *key = buf.data;
         *key_len = buf.size;
@@ -1216,10 +1215,10 @@ dp_netdev_set_nw_addr(struct ofpbuf *packet, const struct flow *key,
         uint32_t *field;
 
         field = type == ODP_ACTION_ATTR_SET_NW_SRC ? &nh->ip_src : &nh->ip_dst;
-        if (key->nw_proto == IP_TYPE_TCP && packet->l7) {
+        if (key->nw_proto == IPPROTO_TCP && packet->l7) {
             struct tcp_header *th = packet->l4;
             th->tcp_csum = recalc_csum32(th->tcp_csum, *field, ip);
-        } else if (key->nw_proto == IP_TYPE_UDP && packet->l7) {
+        } else if (key->nw_proto == IPPROTO_UDP && packet->l7) {
             struct udp_header *uh = packet->l4;
             if (uh->udp_csum) {
                 uh->udp_csum = recalc_csum32(uh->udp_csum, *field, ip);
@@ -1315,7 +1314,7 @@ dp_netdev_output_control(struct dp_netdev *dp, const struct ofpbuf *packet,
     upcall->key_len = key_len;
     upcall->userdata = arg;
 
-    q->upcalls[++q->head & QUEUE_MASK] = upcall;
+    q->upcalls[q->head++ & QUEUE_MASK] = upcall;
 
     return 0;
 }