diff options
author | ume <ume@FreeBSD.org> | 2009-11-12 11:54:12 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2009-11-12 11:54:12 +0000 |
commit | 803189ee1c7285f4c03317edb25bdff8329b9757 (patch) | |
tree | da375fc31710e235402625338e1440c57d44d002 /lib/libc | |
parent | d5357bbaaad9736e588902f470c32f2320bff3b0 (diff) | |
download | FreeBSD-src-803189ee1c7285f4c03317edb25bdff8329b9757.zip FreeBSD-src-803189ee1c7285f4c03317edb25bdff8329b9757.tar.gz |
Add missing IEEE1394 support dropped during merge from NetBSD.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/net/getnameinfo.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c index 0b59586..ffd34a1 100644 --- a/lib/libc/net/getnameinfo.c +++ b/lib/libc/net/getnameinfo.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include <net/if.h> #include <net/if_dl.h> #include <net/if_types.h> +#include <net/firewire.h> #include <netinet/in.h> #include <arpa/inet.h> #include <arpa/nameser.h> @@ -385,6 +386,7 @@ getnameinfo_link(const struct sockaddr *sa, socklen_t salen, { const struct sockaddr_dl *sdl = (const struct sockaddr_dl *)(const void *)sa; + const struct fw_hwaddr *iha; int n; if (serv != NULL && servlen > 0) @@ -400,6 +402,15 @@ getnameinfo_link(const struct sockaddr *sa, socklen_t salen, } switch (sdl->sdl_type) { + case IFT_IEEE1394: + if (sdl->sdl_alen < sizeof(iha->sender_unique_ID_hi) + + sizeof(iha->sender_unique_ID_lo)) + return EAI_FAMILY; + iha = (const struct fw_hwaddr *)(const void *)LLADDR(sdl); + return hexname((const u_int8_t *)&iha->sender_unique_ID_hi, + sizeof(iha->sender_unique_ID_hi) + + sizeof(iha->sender_unique_ID_lo), + host, hostlen); /* * The following have zero-length addresses. * IFT_ATM (net/if_atmsubr.c) |