#include <fcntl.h>
#include <inttypes.h>
#include <net/if.h>
-#include <linux/rtnetlink.h>
-#include <linux/ethtool.h>
-#include <linux/sockios.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
-#include <sys/sysmacros.h>
#include <unistd.h>
#include "csum.h"
return do_add_port(dp, devname, flags, port_no);
}
}
- return EXFULL;
+ return EFBIG;
}
static int
if (hmap_count(&dp->flow_table) < MAX_FLOWS) {
return add_flow(dpif, &put->flow);
} else {
- return EXFULL;
+ return EFBIG;
}
} else {
return ENOENT;
flow_t flow;
int error;
- if (packet->size < ETH_HLEN || packet->size > UINT16_MAX) {
+ if (packet->size < ETH_HEADER_LEN || packet->size > UINT16_MAX) {
return EINVAL;
}
time_timeval(&flow->used);
flow->packet_count++;
flow->byte_count += packet->size;
- if (key->dl_type == htons(ETH_P_IP)) {
+ if (key->dl_type == htons(ETH_TYPE_IP)) {
struct ip_header *nh = packet->l3;
flow->ip_tos = nh->ip_tos;
dp_netdev_set_tp_port(struct ofpbuf *packet, flow_t *key,
const struct odp_action_tp_port *a)
{
- if (key->dl_type == htons(ETH_P_IP)) {
+ if (key->dl_type == htons(ETH_TYPE_IP)) {
uint16_t *field;
if (key->nw_proto == IPPROTO_TCP) {
struct tcp_header *th = packet->l4;
/* Add to datapath. */
error = dpif_port_add(br->dpif, if_name,
internal ? ODP_PORT_INTERNAL : 0, NULL);
- if (error == EXFULL) {
+ if (error == EFBIG) {
VLOG_ERR("ran out of valid port numbers on %s",
dpif_name(br->dpif));
break;