- vnet_sw_interface_t *si = vnet_get_sw_interface (vnm, sw_if_index);
- vnet_hw_interface_t *hi = vnet_get_sw_hw_interface (vnm, sw_if_index);
-
- if (mtu < hi->min_packet_bytes)
- return VNET_API_ERROR_INVALID_VALUE;
- if (mtu > hi->max_packet_bytes)
- return VNET_API_ERROR_INVALID_VALUE;
-
- /* If done on a parent interface */
- if (si->sw_if_index == si->sup_sw_if_index)
- {
- if (hi->hw_class_index == ethernet_hw_interface_class.index)
- {
- ethernet_set_flags (vnm, hi->hw_if_index,
- ETHERNET_INTERFACE_FLAG_MTU);
- }