diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2007-10-13 18:30:31 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2007-10-13 18:30:31 +0000 |
commit | fe7832186ac403d2cf71c6429973a698d5fc0bf5 (patch) | |
tree | 4cdb195f57a5ae966f2a7685978be8055818485d /pfinet | |
parent | 5fc6a5ece060255277783c10875040cdc6a9571e (diff) |
2007-10-13 Marco Gerards <metgerards@student.han.nl>
* iioctl-ops.c (S_iioctl_siocgifhwaddr): New function.
Diffstat (limited to 'pfinet')
-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, |