settign veto also configures mac, sending veto data for 10gb only if veto and numinterfaces==2, changed veto entry offset

This commit is contained in:
2020-05-28 10:35:48 +02:00
parent e727b97d75
commit 0525e374b2
3 changed files with 38 additions and 12 deletions

View File

@ -7455,9 +7455,28 @@ int set_veto(int file_des) {
// only set
if (Server_VerifyLock() == OK) {
setVeto(arg);
int retval = getVeto();
LOG(logDEBUG1, ("veto mode retval: %u\n", retval));
validate(arg, retval, "set veto mode", DEC);
// if numinterfaces is 2 and veto is 1 now, then configuremac
if (arg > 0 && getNumberofUDPInterfaces() == 2 &&
is_configurable() == OK) {
ret = configureMAC();
if (ret != OK) {
sprintf(mess, "Configure Mac failed after enabling veto\n");
strcpy(configureMessage, mess);
LOG(logERROR, (mess));
configured = FAIL;
LOG(logWARNING, ("Configure FAIL, not all parameters "
"configured yet\n"));
} else {
LOG(logINFOGREEN, ("\tConfigure MAC successful\n"));
configured = OK;
}
}
if (ret == OK) {
int retval = getVeto();
LOG(logDEBUG1, ("veto mode retval: %u\n", retval));
validate(arg, retval, "set veto mode", DEC);
}
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);