summaryrefslogtreecommitdiff
path: root/pfinet/linux-src/net/ipv4/devinet.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2000-02-04 08:40:53 +0000
committerRoland McGrath <roland@gnu.org>2000-02-04 08:40:53 +0000
commit6e23f891135756f3aef5dc928f4830ff79630f2a (patch)
tree066bda3da45c7a16c104e4c0393bcaba2a043df9 /pfinet/linux-src/net/ipv4/devinet.c
parent85a447dfc9b8790d42c4bdea1309d1f5b9429ffc (diff)
2000-02-04 Roland McGrath <roland@baalperazim.frob.com>
* linux-src/net/ipv4/devinet.c [_HURD_] (inquire_device): New function. * options.c: Declare it. (trivfs_append_args): Use inquire_device for --address and --netmask. (ADD_ADDR_OPT): #undef it after uses.
Diffstat (limited to 'pfinet/linux-src/net/ipv4/devinet.c')
-rw-r--r--pfinet/linux-src/net/ipv4/devinet.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/pfinet/linux-src/net/ipv4/devinet.c b/pfinet/linux-src/net/ipv4/devinet.c
index ccae0c58..d980631b 100644
--- a/pfinet/linux-src/net/ipv4/devinet.c
+++ b/pfinet/linux-src/net/ipv4/devinet.c
@@ -435,6 +435,22 @@ configure_device (struct device *dev,
return - inet_set_ifa (dev, ifa);
}
+void
+inquire_device (struct device *dev,
+ uint32_t *addr, uint32_t *netmask)
+{
+ struct in_device *in_dev = dev->ip_ptr;
+ struct in_ifaddr *ifa = in_dev ? in_dev->ifa_list : 0;
+
+ if (ifa)
+ {
+ *addr = ifa->ifa_local;
+ *netmask = ifa->ifa_mask;
+ }
+ else
+ *addr = *netmask = INADDR_NONE;
+}
+
#else
int devinet_ioctl(unsigned int cmd, void *arg)