aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet/device.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2021-10-08 15:10:49 +0000
committerBeno�t Ganne <bganne@cisco.com>2021-10-22 12:37:36 +0000
commitcae84fa96856406c93c37e0a38f67d4c6ee7f48a (patch)
tree617e05be28146aff824d47ed71a28ab72bcf8cde /src/vnet/devices/af_packet/device.c
parent0ad060851b4989a1cd300ad711e8498435f65f9a (diff)
devices: add support for l3 af_packet interface
Type: improvement Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ia6b9d4ac55be2216887bfdb99be4021f6a96f166
Diffstat (limited to 'src/vnet/devices/af_packet/device.c')
-rw-r--r--src/vnet/devices/af_packet/device.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/vnet/devices/af_packet/device.c b/src/vnet/devices/af_packet/device.c
index 0542b165a3a..8e4bc2b6b7f 100644
--- a/src/vnet/devices/af_packet/device.c
+++ b/src/vnet/devices/af_packet/device.c
@@ -339,6 +339,14 @@ static clib_error_t *af_packet_set_mac_address_function
int rv, fd = socket (AF_UNIX, SOCK_DGRAM, 0);
struct ifreq ifr;
+ if (apif->mode == AF_PACKET_IF_MODE_IP)
+ {
+ vlib_log_warn (apm->log_class, "af_packet_%s interface is in IP mode",
+ apif->host_if_name);
+ return clib_error_return (0,
+ " MAC update failed, interface is in IP mode");
+ }
+
if (0 > fd)
{
vlib_log_warn (apm->log_class, "af_packet_%s could not open socket",