X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdpif-netdev.c;h=391a2a7ae82ee01f8314d3ea53af0b8791accea5;hb=a46c577af5c5855939ca3192a56396e15bebf0f8;hp=74cd0cac14493aef2e3b15812af3df82865b346b;hpb=cf22f8cba328c0fb47a7e6811563f773fc232904;p=openvswitch diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 74cd0cac..391a2a7a 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010 Nicira Networks. + * Copyright (c) 2009, 2010, 2011 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -950,7 +950,7 @@ dp_netdev_run(void) struct shash_node *node; struct ofpbuf packet; - ofpbuf_init(&packet, DP_NETDEV_HEADROOM + max_mtu); + ofpbuf_init(&packet, DP_NETDEV_HEADROOM + VLAN_ETH_HEADER_LEN + max_mtu); SHASH_FOR_EACH (node, &dp_netdevs) { struct dp_netdev *dp = node->data; struct dp_netdev_port *port; @@ -966,7 +966,7 @@ dp_netdev_run(void) if (!error) { dp_netdev_port_input(dp, port, &packet); } else if (error != EAGAIN && error != EOPNOTSUPP) { - struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); + static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); VLOG_ERR_RL(&rl, "error receiving data from %s: %s", netdev_get_name(port->netdev), strerror(error)); } @@ -1060,7 +1060,7 @@ is_ip(const struct ofpbuf *packet, const struct flow *key) } static void -dp_netdev_set_nw_addr(struct ofpbuf *packet, struct flow *key, +dp_netdev_set_nw_addr(struct ofpbuf *packet, const struct flow *key, const struct nlattr *a) { if (is_ip(packet, key)) { @@ -1088,7 +1088,8 @@ dp_netdev_set_nw_addr(struct ofpbuf *packet, struct flow *key, } static void -dp_netdev_set_nw_tos(struct ofpbuf *packet, struct flow *key, uint8_t nw_tos) +dp_netdev_set_nw_tos(struct ofpbuf *packet, const struct flow *key, + uint8_t nw_tos) { if (is_ip(packet, key)) { struct ip_header *nh = packet->l3; @@ -1104,7 +1105,7 @@ dp_netdev_set_nw_tos(struct ofpbuf *packet, struct flow *key, uint8_t nw_tos) } static void -dp_netdev_set_tp_port(struct ofpbuf *packet, struct flow *key, +dp_netdev_set_tp_port(struct ofpbuf *packet, const struct flow *key, const struct nlattr *a) { if (is_ip(packet, key)) {