X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdpif-netdev.c;h=035ceaedd414b0a7dce3dbc0f834b6288b8a576c;hb=cb034511802ff7516ca2a94da1e161965fb80ad0;hp=417ed6e677c71509b233a7aa66e50e21a39fe324;hpb=7aec165dbc4690c8c2c703d142e2f017bb851d31;p=openvswitch diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 417ed6e6..035ceaed 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -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; } @@ -1216,10 +1216,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 +1315,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; }