* Changed the _SIZEOF_ADDR_IFREQ() macro such that it can be used how we are

using it - hopefully, that is actually correct (it's adopted from FreeBSD).
* Fixed bug that cut off the sockaddr_dl reported by the system, so that DHCP
  wouldn't work anymore (and ifconfig wouldn't show the actual MAC address
  anymore).
* Changed the listing code to actually pad to ifreq size, and leave the length
  of the sockaddr untouched.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37941 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2010-08-06 12:58:02 +00:00
parent 8b6048a285
commit 1f9c8c4576
4 changed files with 28 additions and 20 deletions
+4 -1
View File
@@ -94,8 +94,11 @@ struct ifconf {
};
};
/* Macro that returns the size of a single address within a SIOCGIFCONF buffer;
it looks like this because of compatibility with other platforms. */
#define _SIZEOF_ADDR_IFREQ(request) \
(sizeof((request).ifr_name) + (request).ifr_addr.sa_len)
(IF_NAMESIZE + (request).ifr_addr.sa_len > (int)sizeof(ifreq) \
? IF_NAMESIZE + (request).ifr_addr.sa_len : sizeof(ifreq))
/* POSIX definitions follow */