getaddrinfo.c (157081) | getaddrinfo.c (157093) |
---|---|
1/* $KAME: getaddrinfo.c,v 1.15 2000/07/09 04:37:24 itojun Exp $ */ 2 3/* 4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 49 unchanged lines hidden (view full) --- 58 * presented above. 59 * 60 * OS specific notes for freebsd4: 61 * - FreeBSD supported $GAI. The code does not. 62 * - FreeBSD allowed classful IPv4 numeric (127.1), the code does not. 63 */ 64 65#include <sys/cdefs.h> | 1/* $KAME: getaddrinfo.c,v 1.15 2000/07/09 04:37:24 itojun Exp $ */ 2 3/* 4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 49 unchanged lines hidden (view full) --- 58 * presented above. 59 * 60 * OS specific notes for freebsd4: 61 * - FreeBSD supported $GAI. The code does not. 62 * - FreeBSD allowed classful IPv4 numeric (127.1), the code does not. 63 */ 64 65#include <sys/cdefs.h> |
66__FBSDID("$FreeBSD: head/lib/libc/net/getaddrinfo.c 157081 2006-03-24 04:49:30Z ume $"); | 66__FBSDID("$FreeBSD: head/lib/libc/net/getaddrinfo.c 157093 2006-03-24 13:30:10Z ume $"); |
67 68#include "namespace.h" 69#include <sys/types.h> 70#include <sys/param.h> 71#include <sys/socket.h> 72#include <net/if.h> 73#include <netinet/in.h> 74#include <sys/queue.h> --- 2375 unchanged lines hidden (view full) --- 2450 if (errno == ECONNREFUSED) { 2451 RES_SET_H_ERRNO(res, TRY_AGAIN); 2452 return (-1); 2453 } 2454 switch (res->res_h_errno) { 2455 case NO_DATA: 2456 case HOST_NOT_FOUND: 2457 break; | 67 68#include "namespace.h" 69#include <sys/types.h> 70#include <sys/param.h> 71#include <sys/socket.h> 72#include <net/if.h> 73#include <netinet/in.h> 74#include <sys/queue.h> --- 2375 unchanged lines hidden (view full) --- 2450 if (errno == ECONNREFUSED) { 2451 RES_SET_H_ERRNO(res, TRY_AGAIN); 2452 return (-1); 2453 } 2454 switch (res->res_h_errno) { 2455 case NO_DATA: 2456 case HOST_NOT_FOUND: 2457 break; |
2458 case TRY_AGAIN: 2459 if (hp->rcode == SERVFAIL) 2460 break; 2461 /* FALLTHROUGH */ |
|
2458 default: 2459 return (-1); 2460 } 2461 saved_herrno = res->res_h_errno; 2462 tried_as_is++; 2463 } 2464 2465 /* --- 43 unchanged lines hidden (view full) --- 2509 switch (res->res_h_errno) { 2510 case NO_DATA: 2511 got_nodata++; 2512 /* FALLTHROUGH */ 2513 case HOST_NOT_FOUND: 2514 /* keep trying */ 2515 break; 2516 case TRY_AGAIN: | 2462 default: 2463 return (-1); 2464 } 2465 saved_herrno = res->res_h_errno; 2466 tried_as_is++; 2467 } 2468 2469 /* --- 43 unchanged lines hidden (view full) --- 2513 switch (res->res_h_errno) { 2514 case NO_DATA: 2515 got_nodata++; 2516 /* FALLTHROUGH */ 2517 case HOST_NOT_FOUND: 2518 /* keep trying */ 2519 break; 2520 case TRY_AGAIN: |
2521 got_servfail++; |
|
2517 if (hp->rcode == SERVFAIL) { 2518 /* try next search element, if any */ | 2522 if (hp->rcode == SERVFAIL) { 2523 /* try next search element, if any */ |
2519 got_servfail++; | |
2520 break; 2521 } 2522 /* FALLTHROUGH */ 2523 default: 2524 /* anything else implies that we're done */ 2525 done++; 2526 } 2527 /* --- 4 unchanged lines hidden (view full) --- 2532 done++; 2533 } 2534 } 2535 2536 switch (res->res_h_errno) { 2537 case NO_DATA: 2538 case HOST_NOT_FOUND: 2539 break; | 2524 break; 2525 } 2526 /* FALLTHROUGH */ 2527 default: 2528 /* anything else implies that we're done */ 2529 done++; 2530 } 2531 /* --- 4 unchanged lines hidden (view full) --- 2536 done++; 2537 } 2538 } 2539 2540 switch (res->res_h_errno) { 2541 case NO_DATA: 2542 case HOST_NOT_FOUND: 2543 break; |
2544 case TRY_AGAIN: 2545 if (hp->rcode == SERVFAIL) 2546 break; 2547 /* FALLTHROUGH */ |
|
2540 default: 2541 goto giveup; 2542 } 2543 2544 /* 2545 * If the query has not already been tried as is then try it 2546 * unless RES_NOTLDQUERY is set and there were no dots. 2547 */ --- 70 unchanged lines hidden --- | 2548 default: 2549 goto giveup; 2550 } 2551 2552 /* 2553 * If the query has not already been tried as is then try it 2554 * unless RES_NOTLDQUERY is set and there were no dots. 2555 */ --- 70 unchanged lines hidden --- |