int error;
/* XXX reject devices already in some dp_netdev. */
- if (type[0] == '\0' || !strcmp(type, "system")) {
+ if (type[0] == '\0' || !strcmp(type, "system") || !strcmp(type, "dummy")) {
internal = false;
} else if (!strcmp(type, "internal")) {
internal = true;
port->netdev = netdev;
port->internal = internal;
- netdev_get_mtu(netdev, &mtu);
- if (mtu != INT_MAX && mtu > max_mtu) {
+ error = netdev_get_mtu(netdev, &mtu);
+ if (!error) {
max_mtu = mtu;
}
return EINVAL;
}
+ if (flow->in_port < OFPP_MAX
+ ? flow->in_port >= MAX_PORTS
+ : flow->in_port != OFPP_LOCAL && flow->in_port != OFPP_NONE) {
+ return EINVAL;
+ }
+
return 0;
}
case OVS_ACTION_ATTR_USERSPACE:
break;
- case OVS_ACTION_ATTR_SET_DL_TCI:
+ case OVS_ACTION_ATTR_PUSH_VLAN:
*mutates = true;
if (nl_attr_get_be16(a) & htons(VLAN_CFI)) {
return EINVAL;
}
break;
- case OVS_ACTION_ATTR_STRIP_VLAN:
+ case OVS_ACTION_ATTR_POP_VLAN:
case OVS_ACTION_ATTR_SET_DL_SRC:
case OVS_ACTION_ATTR_SET_DL_DST:
case OVS_ACTION_ATTR_SET_NW_SRC:
}
flow_extract(©, 0, -1, &key);
- dpif_netdev_flow_from_nlattrs(key_attrs, key_len, &key);
-
- error = dp_netdev_execute_actions(dp, ©, &key, actions, actions_len);
+ error = dpif_netdev_flow_from_nlattrs(key_attrs, key_len, &key);
+ if (!error) {
+ error = dp_netdev_execute_actions(dp, ©, &key,
+ actions, actions_len);
+ }
if (mutates) {
ofpbuf_uninit(©);
}
}
static void
-dp_netdev_strip_vlan(struct ofpbuf *packet)
+dp_netdev_pop_vlan(struct ofpbuf *packet)
{
struct vlan_eth_header *veh = packet->l2;
if (packet->size >= sizeof *veh
key, nl_attr_get_u64(a));
break;
- case OVS_ACTION_ATTR_SET_DL_TCI:
- eth_set_vlan_tci(packet, nl_attr_get_be16(a));
+ case OVS_ACTION_ATTR_PUSH_VLAN:
+ eth_push_vlan(packet, nl_attr_get_be16(a));
break;
- case OVS_ACTION_ATTR_STRIP_VLAN:
- dp_netdev_strip_vlan(packet);
+ case OVS_ACTION_ATTR_POP_VLAN:
+ dp_netdev_pop_vlan(packet);
break;
case OVS_ACTION_ATTR_SET_DL_SRC:
dpif_netdev_execute,
dpif_netdev_recv_get_mask,
dpif_netdev_recv_set_mask,
- NULL, /* get_sflow_probability */
- NULL, /* set_sflow_probability */
NULL, /* queue_to_priority */
dpif_netdev_recv,
dpif_netdev_recv_wait,