Commit 417c4130 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[3554] Fix in Pkt::MACSourceFromText()

parent 4119b60c
...@@ -233,7 +233,7 @@ Pkt::getMACFromIPv6(const isc::asiolink::IOAddress& addr) { ...@@ -233,7 +233,7 @@ Pkt::getMACFromIPv6(const isc::asiolink::IOAddress& addr) {
return (HWAddrPtr(new HWAddr(bin, hwtype))); return (HWAddrPtr(new HWAddr(bin, hwtype)));
} }
uint16_t Pkt::MACSourceFromText(const std::string& name) { uint32_t Pkt::MACSourceFromText(const std::string& name) {
struct { struct {
const char * name; const char * name;
...@@ -253,7 +253,7 @@ uint16_t Pkt::MACSourceFromText(const std::string& name) { ...@@ -253,7 +253,7 @@ uint16_t Pkt::MACSourceFromText(const std::string& name) {
}; };
for (int i=0; i < sizeof(sources)/sizeof(sources[0]); ++i) { for (int i=0; i < sizeof(sources)/sizeof(sources[0]); ++i) {
if (name.compare(sources[i].name)) { if (name.compare(sources[i].name) == 0) {
return (sources[i].type); return (sources[i].type);
} }
} }
......
...@@ -99,7 +99,7 @@ public: ...@@ -99,7 +99,7 @@ public:
/// ///
/// @throw BadValue if specified string is unknown /// @throw BadValue if specified string is unknown
/// @return bitmask version of a given method /// @return bitmask version of a given method
static uint16_t MACSourceFromText(const std::string& name); static uint32_t MACSourceFromText(const std::string& name);
protected: protected:
......
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