From: Michael Tremer Date: Wed, 19 Sep 2018 14:56:33 +0000 (+0100) Subject: libnetwork: Actually store index X-Git-Tag: 010~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1ffc46799d89fc0b6e79cd79a0e03a9c22c6a6a4;p=network.git libnetwork: Actually store index Index was always zero and therefore only the first PHY could be queried only. Signed-off-by: Michael Tremer --- 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; }