lan: Refix 6e2b688e. Fix vlan range checking.

Commit 6e2b688e introduced a bug due to which VLAN id range checking
was negated and resulted in error messages printed for correct VLAN ids.

Resolves ipmitool/ipmitool#55

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
This commit is contained in:
Alexander Amelkin 2019-09-05 15:10:02 +03:00
parent 4dc962b614
commit eed9d5950e
No known key found for this signature in database
GPG Key ID: E893587B5B74178D

View File

@ -1260,7 +1260,7 @@ ipmi_lan_set_vlan_id(struct ipmi_intf *intf, uint8_t chan, char *string)
rc = 0;
goto out;
}
if (IPMI_LANP_IS_VLAN_VALID(id)) {
if (!IPMI_LANP_IS_VLAN_VALID(id)) {
lprintf(LOG_ERR,
"Retrieved VLAN ID %i is out of "
"range <%d..%d>.",
@ -1285,7 +1285,7 @@ ipmi_lan_set_vlan_id(struct ipmi_intf *intf, uint8_t chan, char *string)
goto out;
}
if (IPMI_LANP_IS_VLAN_VALID(id)) {
if (!IPMI_LANP_IS_VLAN_VALID(id)) {
lprintf(LOG_NOTICE,
"VLAN ID must be between %d and %d.",
IPMI_LANP_VLAN_ID_MIN,