devices: add support for l3 af_packet interface
[vpp.git] / src / vnet / devices / af_packet / device.c
index 0542b16..8e4bc2b 100644 (file)
@@ -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",