Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion common/macaddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ bool MacAddress::parseMacString(const string& str_mac, uint8_t* bin_mac)
const char* ptr_mac = str_mac.c_str();

// first check that all mac address separators are equal to each other
if (!allequal(ptr_mac[2], ptr_mac[5], ptr_mac[8], ptr_mac[11], ptr_mac[14]))
// 2, 5, 8, 11, and 14 are MAC address separator positions
if (!(ptr_mac[2] == ptr_mac[5]
&& ptr_mac[5] == ptr_mac[8]
&& ptr_mac[8] == ptr_mac[11]
&& ptr_mac[11] == ptr_mac[14]))
{
return false;
}
Expand Down
10 changes: 0 additions & 10 deletions common/macaddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@

namespace swss {

template <typename T>
bool allequal(const T &t, const T &u) {
return t == u;
}

template <typename T, typename... Others>
bool allequal(const T &t, const T &u, Others const &... args) {
return (t == u) && allequal(u, args...);
}

class MacAddress
{
public:
Expand Down
4 changes: 2 additions & 2 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif

CFLAGS_GTEST = -I $(top_srcdir)/googletest/googletest/include
LDADD_GTEST = $(top_srcdir)/googletest/build/googlemock/gtest/libgtest_main.a \
$(top_srcdir)/googletest/build/googlemock/gtest/libgtest.a
$(top_srcdir)/googletest/build/googlemock/gtest/libgtest.a

tests_SOURCES = redis_ut.cpp \
redis_piped_ut.cpp \
Expand All @@ -24,7 +24,7 @@ tests_SOURCES = redis_ut.cpp \
macaddress_ut.cpp \
converter_ut.cpp \
exec_ut.cpp \
redis_subscriber_state_ut.cpp
redis_subscriber_state_ut.cpp

tests_CFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST)
tests_CPPFLAGS = $(DBGFLAGS) $(AM_CFLAGS) $(CFLAGS_COMMON) $(CFLAGS_GTEST)
Expand Down