diff options
author | Harald Welte <laforge@gnumonks.org> | 2009-02-18 03:43:01 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2009-02-18 03:43:01 +0000 |
commit | 0b8348d397162f001f07d6d44f05a8c96ab299b1 (patch) | |
tree | fe5a1ee89b65b1de9dc69d70ffe4808c25df00f2 /src/abis_nm.c | |
parent | b110cee0a0c9fbd9cf498c24bc50987f81ce2cb2 (diff) |
fix the parsing of the 'normal' availability status
Diffstat (limited to 'src/abis_nm.c')
-rw-r--r-- | src/abis_nm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/abis_nm.c b/src/abis_nm.c index a446f29bf..33fc0bfbc 100644 --- a/src/abis_nm.c +++ b/src/abis_nm.c @@ -336,6 +336,8 @@ const char *avail_names[] = { static const char *avail_name(u_int8_t avail) { + if (avail == 0xff) + return "OK"; if (avail >= ARRAY_SIZE(avail_names)) return "UNKNOWN"; return avail_names[avail]; @@ -466,7 +468,10 @@ static int abis_nm_rx_statechg_rep(struct msgb *mb) DEBUGPC(DNM, "OP_STATE=%s ", opstate_name(new_state.operational)); } if (TLVP_PRESENT(&tp, NM_ATT_AVAIL_STATUS)) { - new_state.availability = *TLVP_VAL(&tp, NM_ATT_AVAIL_STATUS); + if (TLVP_LEN(&tp, NM_ATT_AVAIL_STATUS) == 0) + new_state.availability = 0xff; + else + new_state.availability = *TLVP_VAL(&tp, NM_ATT_AVAIL_STATUS); DEBUGPC(DNM, "AVAIL=%s(%02x) ", avail_name(new_state.availability), new_state.availability); } |