diff options
-rw-r--r-- | pfinet/ChangeLog | 4 | ||||
-rw-r--r-- | pfinet/iioctl-ops.c | 25 |
2 files changed, 29 insertions, 0 deletions
diff --git a/pfinet/ChangeLog b/pfinet/ChangeLog index f4506c5e..aaa63a85 100644 --- a/pfinet/ChangeLog +++ b/pfinet/ChangeLog @@ -1,3 +1,7 @@ +2007-10-13 Marco Gerards <metgerards@student.han.nl> + + * iioctl-ops.c (S_iioctl_siocgifhwaddr): New function. + 2007-10-13 Stefan Siegl <stesie@brokenpipe.de> * linux-src/net/ipv6/af_inet6.c (inet6_getname): Initialize diff --git a/pfinet/iioctl-ops.c b/pfinet/iioctl-ops.c index a6a0cbc8..637e9f5b 100644 --- a/pfinet/iioctl-ops.c +++ b/pfinet/iioctl-ops.c @@ -271,6 +271,31 @@ SIOCGIF (brdaddr, BRDADDR); /* 37 SIOCGIFNETMASK -- Get netmask of a network interface. */ SIOCGIF (netmask, NETMASK); +/* 39 SIOCGIFHWADDR -- Get the hardware address of a network interface. */ +error_t +S_iioctl_siocgifhwaddr (io_t port, + ifname_t ifname, + sockaddr_t *addr) +{ + error_t err = 0; + struct device *dev; + + if (!port) + return EOPNOTSUPP; + + dev = get_dev (ifname); + if (!dev) + err = ENODEV; + else + { + memcpy (addr->sa_data, dev->dev_addr, dev->addr_len); + addr->sa_family = dev->type; + } + + __mutex_unlock (&global_lock); + return err; +} + /* 51 SIOCGIFMTU -- Get mtu of a network interface. */ error_t S_iioctl_siocgifmtu (io_t port, |