Skip to content

Commit 45449e0

Browse files
cpaasch-oaithom311
authored andcommitted
Add EHOSTUNREACH to nl_syserr2nlerr
For improved error-output. Signed-off-by: Christoph Paasch <cpaasch@openai.com> #433
1 parent 0a611be commit 45449e0

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

include/netlink/errno.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ extern "C" {
4545
#define NLE_IMMUTABLE 32
4646
#define NLE_DUMP_INTR 33
4747
#define NLE_ATTRSIZE 34
48+
#define NLE_HOSTUNREACH 35
4849

49-
#define NLE_MAX NLE_ATTRSIZE
50+
#define NLE_MAX NLE_HOSTUNREACH
5051

5152
extern const char * nl_geterror(int);
5253
extern void nl_perror(int, const char *);

lib/error.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static const char *errmsg[NLE_MAX+1] = {
4343
[NLE_IMMUTABLE] = "Immutable attribute",
4444
[NLE_DUMP_INTR] = "Dump inconsistency detected, interrupted",
4545
[NLE_ATTRSIZE] = "Attribute max length exceeded",
46+
[NLE_HOSTUNREACH] = "Host is unreachable",
4647
};
4748

4849
/**
@@ -104,9 +105,9 @@ int nl_syserr2nlerr(int error)
104105
case EBUSY: return NLE_BUSY;
105106
case ERANGE: return NLE_RANGE;
106107
case ENODEV: return NLE_NODEV;
108+
case EHOSTUNREACH: return NLE_HOSTUNREACH;
107109
default: return NLE_FAILURE;
108110
}
109111
}
110112

111113
/** @} */
112-

0 commit comments

Comments
 (0)