diff options
author | Thomas Haller <thaller@redhat.com> | 2015-06-26 15:07:26 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-06-26 15:20:43 (GMT) |
commit | 79effc5b35e6d4a9d6acffa545c60f6e1584c140 (patch) | |
tree | deb47dd22e1ac9c9933a7e1a48ab3cdcf652da83 /lib | |
parent | 6a9335f101e22cd5eaba4dfcf0a44e2c3097b4ab (diff) | |
download | libnl-79effc5b35e6d4a9d6acffa545c60f6e1584c140.zip libnl-79effc5b35e6d4a9d6acffa545c60f6e1584c140.tar.gz libnl-79effc5b35e6d4a9d6acffa545c60f6e1584c140.tar.bz2 |
neigh: accept "norarp" in rtnl_neigh_state2str()
Commit 6a9335f101e22cd5eaba4dfcf0a44e2c3097b4ab fixed a typo in the
string-to-flags conversion. At least for rtnl_neigh_str2state()
we want to continue to parse "norarp" for backward compatiblity.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/route/neigh.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/route/neigh.c b/lib/route/neigh.c index 7fe5fae..ca7e693 100644 --- a/lib/route/neigh.c +++ b/lib/route/neigh.c @@ -748,12 +748,17 @@ static const struct trans_tbl neigh_states[] = { __ADD(NUD_FAILED, failed), __ADD(NUD_NOARP, noarp), __ADD(NUD_PERMANENT, permanent), + + /* Accept this value for backward compatibility. Originally + * there was a typo in the string value. This was fixed later, + * but we still want to successfully parse "norarp". */ + __ADD(NUD_NOARP, norarp), }; char * rtnl_neigh_state2str(int state, char *buf, size_t len) { return __flags2str(state, buf, len, neigh_states, - ARRAY_SIZE(neigh_states)); + ARRAY_SIZE(neigh_states) - 1); } int rtnl_neigh_str2state(const char *name) |