From fe7832186ac403d2cf71c6429973a698d5fc0bf5 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Sat, 13 Oct 2007 18:30:31 +0000 Subject: 2007-10-13 Marco Gerards * iioctl-ops.c (S_iioctl_siocgifhwaddr): New function. --- pfinet/ChangeLog | 4 ++++ pfinet/iioctl-ops.c | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'pfinet') 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 + + * iioctl-ops.c (S_iioctl_siocgifhwaddr): New function. + 2007-10-13 Stefan Siegl * 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, -- cgit v1.2.3