X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdpif-netdev.c;h=93dd1cde99a89d1e36865524dde42d9aced45ec2;hb=2d8916e58fe0592c2c0f3161f4287ce962269b7f;hp=417ed6e677c71509b233a7aa66e50e21a39fe324;hpb=7aec165dbc4690c8c2c703d142e2f017bb851d31;p=openvswitch diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 417ed6e6..93dd1cde 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);