dect
/
libnl
Archived
13
0
Fork 0

correctly handle the object not found case

Removing non existent route (both ipv4 and ipv6) using
rtnl_route_delete return NLE_FAILURE generic error code. After
investigation, it seems the linux kernel return -ESRCH in that case
(see http://lxr.linux.no/linux+v2.6.38/net/ipv6/route.c#L1367). Same
behaviour apply for removing non existent address. The function
nl_syserr2nlerr (lib/error.c) which is responsible for translating
from kernel error to libnl error doesn't handle ESRCH.
This commit is contained in:
Nicolas Sitbon 2011-03-25 15:07:23 +01:00 committed by Thomas Graf
parent e4b507e290
commit 7e9d5f69e5
1 changed files with 1 additions and 0 deletions

View File

@ -88,6 +88,7 @@ int nl_syserr2nlerr(int error)
case EADDRINUSE: return NLE_EXIST;
case EEXIST: return NLE_EXIST;
case EADDRNOTAVAIL: return NLE_NOADDR;
case ESRCH: /* fall through */
case ENOENT: return NLE_OBJ_NOTFOUND;
case EINTR: return NLE_INTR;
case EAGAIN: return NLE_AGAIN;