summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2021-06-29 19:51:06 +0200
committerSander Vrijders <[email protected]>2021-06-30 09:19:52 +0200
commit55e182b5b323c049ea49c79c2d68c8547940c62b (patch)
treebb18ae20229d072b0c74d5a404c088846306e0af
parentbeb54470b9641c50cc5d2f1e70b572f72428d8c9 (diff)
downloadouroboros-55e182b5b323c049ea49c79c2d68c8547940c62b.tar.gz
ouroboros-55e182b5b323c049ea49c79c2d68c8547940c62b.zip
ipcpd: Fix layer info RIB
Layer info was not converted to parse the full path with the latest RIB change. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
-rw-r--r--src/ipcpd/ipcp.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c
index 65a28d61..59fbdba6 100644
--- a/src/ipcpd/ipcp.c
+++ b/src/ipcpd/ipcp.c
@@ -103,10 +103,15 @@ static int ipcp_rib_read(const char * path,
char * buf,
size_t len)
{
+ char * entry;
+
if (len < LAYER_NAME_SIZE + 2) /* trailing \n */
return 0;
- if (strcmp(path, info[0]) == 0) { /* _state */
+ entry = strstr(path, RIB_SEPARATOR) + 1;
+ assert(entry);
+
+ if (strcmp(entry, info[0]) == 0) { /* _state */
enum ipcp_state state = ipcp_get_state();
if (state == IPCP_NULL)
strcpy(buf, "null\n");
@@ -120,7 +125,7 @@ static int ipcp_rib_read(const char * path,
strcpy(buf, "bug\n");
}
- if (strcmp(path, info[1]) == 0) { /* _type */
+ if (strcmp(entry, info[1]) == 0) { /* _type */
if (ipcpi.type == IPCP_LOCAL)
strcpy(buf, "local\n");
else if (ipcpi.type == IPCP_UNICAST)
@@ -137,7 +142,7 @@ static int ipcp_rib_read(const char * path,
strcpy(buf, "bug\n");
}
- if (strcmp(path, info[2]) == 0) { /* _layer */
+ if (strcmp(entry, info[2]) == 0) { /* _layer */
memset(buf, 0, LAYER_NAME_SIZE + 1);
if (ipcp_get_state() < IPCP_OPERATIONAL)
strcpy(buf, "(null)");