Fixes getMac on view interfaces

This commit is contained in:
Simone Mainardi 2017-09-26 11:18:05 +02:00
parent aaf84a6261
commit 7abdbcd56a
4 changed files with 32 additions and 11 deletions

View file

@ -4657,20 +4657,12 @@ void NetworkInterface::runHousekeepingTasks() {
/* **************************************************** */
Mac* NetworkInterface::getMac(u_int8_t _mac[6], u_int16_t vlanId,
bool createIfNotPresent) {
Mac* NetworkInterface::getMac(u_int8_t _mac[6], u_int16_t vlanId, bool createIfNotPresent) {
Mac *ret = NULL;
if(_mac == NULL) return(NULL);
if(!isView())
ret = macs_hash->get(vlanId, _mac);
else {
for(u_int8_t s = 0; s<numSubInterfaces; s++) {
if((ret = subInterfaces[s]->get_macs_hash()->get(vlanId, _mac)) != NULL)
break;
}
}
ret = macs_hash->get(vlanId, _mac);
if((ret == NULL) && createIfNotPresent) {
try {