gethostbyht.c (145723) | gethostbyht.c (145728) |
---|---|
1/*- 2 * Copyright (c) 1985, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 41 unchanged lines hidden (view full) --- 50 * - 51 * --Copyright-- 52 */ 53 54#if defined(LIBC_SCCS) && !defined(lint) 55static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; 56#endif /* LIBC_SCCS and not lint */ 57#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1985, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 41 unchanged lines hidden (view full) --- 50 * - 51 * --Copyright-- 52 */ 53 54#if defined(LIBC_SCCS) && !defined(lint) 55static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; 56#endif /* LIBC_SCCS and not lint */ 57#include <sys/cdefs.h> |
58__FBSDID("$FreeBSD: head/lib/libc/net/gethostbyht.c 145723 2005-04-30 18:46:27Z ume $"); | 58__FBSDID("$FreeBSD: head/lib/libc/net/gethostbyht.c 145728 2005-04-30 20:07:01Z ume $"); |
59 60#include <sys/param.h> 61#include <sys/socket.h> 62#include <netinet/in.h> 63#include <arpa/inet.h> 64#include <netdb.h> 65#include <stdio.h> 66#include <ctype.h> --- 174 unchanged lines hidden (view full) --- 241 addr = va_arg(ap, const char *); 242 len = va_arg(ap, int); 243 af = va_arg(ap, int); 244 he = va_arg(ap, struct hostent *); 245 hed = va_arg(ap, struct hostent_data *); 246 247 sethostent_r(0, hed); 248 while ((error = gethostent_p(he, hed, 0)) == 0) | 59 60#include <sys/param.h> 61#include <sys/socket.h> 62#include <netinet/in.h> 63#include <arpa/inet.h> 64#include <netdb.h> 65#include <stdio.h> 66#include <ctype.h> --- 174 unchanged lines hidden (view full) --- 241 addr = va_arg(ap, const char *); 242 len = va_arg(ap, int); 243 af = va_arg(ap, int); 244 he = va_arg(ap, struct hostent *); 245 hed = va_arg(ap, struct hostent_data *); 246 247 sethostent_r(0, hed); 248 while ((error = gethostent_p(he, hed, 0)) == 0) |
249 if (he->h_addrtype == af && !bcmp(he->h_addr, addr, len)) | 249 if (he->h_addrtype == af && !bcmp(he->h_addr, addr, len)) { 250 if (he->h_addrtype == AF_INET && 251 _res.options & RES_USE_INET6) { 252 _map_v4v6_address(he->h_addr, he->h_addr); 253 he->h_length = IN6ADDRSZ; 254 he->h_addrtype = AF_INET6; 255 } |
250 break; | 256 break; |
257 } |
|
251 endhostent_r(hed); 252 253 return (error == 0) ? NS_SUCCESS : NS_NOTFOUND; 254} | 258 endhostent_r(hed); 259 260 return (error == 0) ? NS_SUCCESS : NS_NOTFOUND; 261} |