Userland: Rename loop0 to loop

Now that the kernel picks a different name for the loopback adapter
we should update userland to account for this.
This commit is contained in:
Gunnar Beutner 2021-05-22 12:41:29 +02:00 committed by Linus Groh
parent e5e00bec8f
commit e087a65775
2 changed files with 3 additions and 3 deletions

View file

@ -126,7 +126,7 @@ private:
auto ifname = if_object.get("name").to_string();
if (!include_loopback)
if (ifname == "loop0")
if (ifname == "loop")
return;
if (ip_address != "null")
connected_adapters++;

View file

@ -60,7 +60,7 @@ void test_valid(int fd)
// bind to an interface that exists
char buf[IFNAMSIZ];
socklen_t buflen = IFNAMSIZ;
memcpy(buf, "loop0", 6);
memcpy(buf, "loop", 5);
if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, buf, buflen) < 0) {
perror("setsockopt(SO_BINDTODEVICE) :: valid");
@ -75,7 +75,7 @@ void test_no_route(int fd)
// bind to an interface that cannot deliver
char buf[IFNAMSIZ];
socklen_t buflen = IFNAMSIZ;
memcpy(buf, "loop0", 6);
memcpy(buf, "loop", 5);
if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, buf, buflen) < 0) {
perror("setsockopt(SO_BINDTODEVICE) :: no_route");