Changeset 2725 in MondoRescue for branches/2.2.9/mindi-busybox/libbb/inet_common.c
- Timestamp:
- Feb 25, 2011, 9:26:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mindi-busybox/libbb/inet_common.c
r1765 r2725 6 6 * Heavily modified by Manuel Novoa III Mar 12, 2001 7 7 * 8 * 8 * Licensed under GPLv2, see file LICENSE in this source tree. 9 9 */ 10 10 … … 12 12 #include "inet_common.h" 13 13 14 int INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst)14 int FAST_FUNC INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst) 15 15 { 16 16 struct hostent *hp; … … 24 24 25 25 /* Default is special, meaning 0.0.0.0. */ 26 if ( !strcmp(name, bb_str_default)) {26 if (strcmp(name, "default") == 0) { 27 27 s_in->sin_addr.s_addr = INADDR_ANY; 28 28 return 1; … … 64 64 res_init(); 65 65 _res.options |= RES_DEBUG; 66 #endif67 68 #ifdef DEBUG69 66 bb_error_msg("gethostbyname(%s)", name); 70 67 #endif … … 82 79 * & 0x0fff: don't resolve 83 80 */ 84 char *INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask)81 char* FAST_FUNC INET_rresolve(struct sockaddr_in *s_in, int numeric, uint32_t netmask) 85 82 { 86 83 /* addr-to-name cache */ … … 98 95 int host = 0; 99 96 100 /* Grmpf. -FvK */101 97 if (s_in->sin_family != AF_INET) { 102 98 #ifdef DEBUG … … 114 110 if ((numeric & 0x0FFF) == 0) { 115 111 if (numeric & 0x8000) 116 return xstrdup( bb_str_default);112 return xstrdup("default"); 117 113 return xstrdup("*"); 118 114 } … … 167 163 #if ENABLE_FEATURE_IPV6 168 164 169 int INET6_resolve(const char *name, struct sockaddr_in6 *sin6)165 int FAST_FUNC INET6_resolve(const char *name, struct sockaddr_in6 *sin6) 170 166 { 171 167 struct addrinfo req, *ai; … … 191 187 192 188 193 char *INET6_rresolve(struct sockaddr_in6 *sin6, int numeric)189 char* FAST_FUNC INET6_rresolve(struct sockaddr_in6 *sin6, int numeric) 194 190 { 195 191 char name[128]; 196 192 int s; 197 193 198 /* Grmpf. -FvK */199 194 if (sin6->sin6_family != AF_INET6) { 200 195 #ifdef DEBUG 201 bb_error_msg("rresolve: unsupport address family %d!",196 bb_error_msg("rresolve: unsupported address family %d!", 202 197 sin6->sin6_family); 203 198 #endif … … 211 206 if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { 212 207 if (numeric & 0x8000) 213 return xstrdup( bb_str_default);208 return xstrdup("default"); 214 209 return xstrdup("*"); 215 210 } … … 224 219 } 225 220 226 #endif 221 #endif /* CONFIG_FEATURE_IPV6 */
Note:
See TracChangeset
for help on using the changeset viewer.