Commit e6347dcd authored by Juan Luis Manas's avatar Juan Luis Manas Committed by Alessandro Rubini

RTU/rtu_fd: removed unnecessary check. mac_to_str added to mac.c

parent d6552db6
...@@ -40,3 +40,14 @@ char *mac_to_string(uint8_t mac[ETH_ALEN]) ...@@ -40,3 +40,14 @@ char *mac_to_string(uint8_t mac[ETH_ALEN])
return strdup(str); //FIXME: can't be static but this takes memory return strdup(str); //FIXME: can't be static but this takes memory
} }
/**
* \brief Helper function to convert mac address into a string
*/
char *mac_to_str(uint8_t mac[ETH_ALEN], char str[ETH_ALEN * 3])
{
snprintf(str,
ETH_ALEN * 3,
"%02x:%02x:%02x:%02x:%02x:%02x",
mac[0],mac[1],mac[2],mac[3],mac[4],mac[5]);
return str;
}
...@@ -941,9 +941,6 @@ int rtu_fdb_delete_static_entry(uint8_t mac[ETH_ALEN], uint16_t vid) ...@@ -941,9 +941,6 @@ int rtu_fdb_delete_static_entry(uint8_t mac[ETH_ALEN], uint16_t vid)
"delete static entry: vid=%d mac=%s", vid, mac_to_string(mac)); "delete static entry: vid=%d mac=%s", vid, mac_to_string(mac));
lock(); lock();
// Check that VLAN is registered (except for wildcard vid)
if ((vid != WILDCARD_VID) && !rtu_sw_find_vlan_entry(vid))
return unlock(-EINVAL);
// Check that entry is registered // Check that entry is registered
sfe = sfe_find(mac, vid); sfe = sfe_find(mac, vid);
if (!sfe) if (!sfe)
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <hw/trace.h>
#include "rtu_fd_srv.h" #include "rtu_fd_srv.h"
#include "rtu_fd_export.h" #include "rtu_fd_export.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment