diff options
-rw-r--r-- | pfinet/linux-src/net/ipv4/devinet.c | 5 | ||||
-rw-r--r-- | pfinet/main.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/pfinet/linux-src/net/ipv4/devinet.c b/pfinet/linux-src/net/ipv4/devinet.c index ed3d17c2..64525bb3 100644 --- a/pfinet/linux-src/net/ipv4/devinet.c +++ b/pfinet/linux-src/net/ipv4/devinet.c @@ -417,7 +417,7 @@ configure_device (struct device *dev, ifa = inet_alloc_ifa (); if (!ifa) return ENOBUFS; - memcpy(ifa->ifa_label, dev->name, IFNAMSIZ); + memcpy (ifa->ifa_label, dev->name, IFNAMSIZ); } if (addr != INADDR_NONE) @@ -432,7 +432,8 @@ configure_device (struct device *dev, ifa->ifa_broadcast = 0; } - return - inet_set_ifa (dev, ifa); + return - (inet_set_ifa (dev, ifa) + ?: dev_change_flags (dev, dev->flags | IFF_UP)); } void diff --git a/pfinet/main.c b/pfinet/main.c index 01dc24be..3e4db13e 100644 --- a/pfinet/main.c +++ b/pfinet/main.c @@ -206,6 +206,10 @@ main (int argc, After this, we can use `register_netdevice' for new interfaces. */ net_dev_init (); + /* ifconfig lo up 127.0.0.1 netmask 0xff000000 */ + configure_device (&loopback_dev, + htonl (INADDR_LOOPBACK), htonl (IN_CLASSA_NET)); + __mutex_unlock (&global_lock); /* Parse options. When successful, this configures the interfaces |