From 1ffc46799d89fc0b6e79cd79a0e03a9c22c6a6a4 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 19 Sep 2018 15:56:33 +0100 Subject: [PATCH] libnetwork: Actually store index Index was always zero and therefore only the first PHY could be queried only. Signed-off-by: Michael Tremer --- src/libnetwork/phy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libnetwork/phy.c b/src/libnetwork/phy.c index 3b443af5..b11ce9b9 100644 --- a/src/libnetwork/phy.c +++ b/src/libnetwork/phy.c @@ -314,6 +314,7 @@ NETWORK_EXPORT int network_phy_new(struct network_ctx* ctx, struct network_phy** p->refcount = 1; p->name = strdup(name); + p->index = index; // Load information from kernel int r = phy_get_info(p); @@ -324,7 +325,7 @@ NETWORK_EXPORT int network_phy_new(struct network_ctx* ctx, struct network_phy** return r; } - DEBUG(p->ctx, "Allocated phy at %p\n", p); + DEBUG(p->ctx, "Allocated phy at %p (index = %d)\n", p, p->index); *phy = p; return 0; } -- 2.39.2