]> git.ipfire.org Git - network.git/blobdiff - src/libnetwork/phy.c
libnetwork: Actually store index
[network.git] / src / libnetwork / phy.c
index 3b443af52f29d6e4c8b73c429e4f085220656d37..b11ce9b9c0dd1a6ac316a0ec699bcc7264a2a04b 100644 (file)
@@ -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;
 }