ipvsadm: catch the original errno from netlink answer

nl_recvmsgs_default() returns NLE_* error codes and not
errno values. As result, attempt to delete virtual service
returns NLE_OBJ_NOTFOUND (12) which matches the ENOMEM value.

Problem as reported by Emanuele Rocca:

ipvsadm -D -t example.org:80
Memory allocation problem

Fix it by providing generic error handler to catch the errno
value as returned in netlink answer. By this way all netlink
commands will get proper error string. The problem is present
only when ipvsadm is compiled with libnl.

ipvsadm -D -t example.org:80
No such service

Reported-by: Emanuele Rocca <ema@wikimedia.org>
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
1 file changed