summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authoritojun <>2000-04-27 05:30:23 +0000
committeritojun <>2000-04-27 05:30:23 +0000
commitf00cb24142de5227d17ca962c3e3087b9a741e07 (patch)
treee48395bfb52a72d2b73c60807c005385363ca3d3 /src/lib
parentd47d69094415cb5dac0309bc93f57573e10acd24 (diff)
downloadopenbsd-f00cb24142de5227d17ca962c3e3087b9a741e07.tar.gz
openbsd-f00cb24142de5227d17ca962c3e3087b9a741e07.tar.bz2
openbsd-f00cb24142de5227d17ca962c3e3087b9a741e07.zip
remove unused struct def. more sanity check for NULL.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/net/getaddrinfo.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/libc/net/getaddrinfo.c b/src/lib/libc/net/getaddrinfo.c
index f33ef91a04..5ab29a97cc 100644
--- a/src/lib/libc/net/getaddrinfo.c
+++ b/src/lib/libc/net/getaddrinfo.c
@@ -1,10 +1,10 @@
1/* $OpenBSD: getaddrinfo.c,v 1.21 2000/04/26 16:05:20 itojun Exp $ */ 1/* $OpenBSD: getaddrinfo.c,v 1.22 2000/04/27 05:30:23 itojun Exp $ */
2/* $KAME: getaddrinfo.c,v 1.14 2000/04/26 15:41:49 itojun Exp $ */ 2/* $KAME: getaddrinfo.c,v 1.16 2000/04/27 03:37:43 itojun Exp $ */
3 3
4/* 4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
@@ -16,7 +16,7 @@
16 * 3. Neither the name of the project nor the names of its contributors 16 * 3. Neither the name of the project nor the names of its contributors
17 * may be used to endorse or promote products derived from this software 17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission. 18 * without specific prior written permission.
19 * 19 *
20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 20 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -116,18 +116,11 @@ static const char in_addrany[] = { 0, 0, 0, 0 };
116static const char in6_addrany[] = { 116static const char in6_addrany[] = {
117 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 117 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
118}; 118};
119static const char in_loopback[] = { 127, 0, 0, 1 }; 119static const char in_loopback[] = { 127, 0, 0, 1 };
120static const char in6_loopback[] = { 120static const char in6_loopback[] = {
121 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 121 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
122}; 122};
123 123
124struct sockinet {
125 u_char si_len;
126 u_char si_family;
127 u_short si_port;
128 u_int32_t si_scope_id;
129};
130
131static const struct afd { 124static const struct afd {
132 int a_af; 125 int a_af;
133 int a_addrlen; 126 int a_addrlen;
@@ -226,7 +219,7 @@ static int addrconfig __P((const struct addrinfo *));
226#endif 219#endif
227#ifdef INET6 220#ifdef INET6
228static int ip6_str2scopeid __P((char *, struct sockaddr_in6 *)); 221static int ip6_str2scopeid __P((char *, struct sockaddr_in6 *));
229#endif 222#endif
230 223
231static void _sethtent __P((void)); 224static void _sethtent __P((void));
232static void _endhtent __P((void)); 225static void _endhtent __P((void));
@@ -612,6 +605,8 @@ explore_null(pai, servname, res)
612 return 0; 605 return 0;
613 606
614 afd = find_afd(pai->ai_family); 607 afd = find_afd(pai->ai_family);
608 if (afd == NULL)
609 return 0;
615 610
616 if (pai->ai_flags & AI_PASSIVE) { 611 if (pai->ai_flags & AI_PASSIVE) {
617 GET_AI(cur->ai_next, afd, afd->a_addrany); 612 GET_AI(cur->ai_next, afd, afd->a_addrany);
@@ -664,6 +659,8 @@ explore_numeric(pai, hostname, servname, res)
664 return 0; 659 return 0;
665 660
666 afd = find_afd(pai->ai_family); 661 afd = find_afd(pai->ai_family);
662 if (afd == NULL)
663 return 0;
667 664
668 switch (afd->a_af) { 665 switch (afd->a_af) {
669#if 0 /*X/Open spec*/ 666#if 0 /*X/Open spec*/
@@ -675,7 +672,7 @@ explore_numeric(pai, hostname, servname, res)
675 GET_PORT(cur->ai_next, servname); 672 GET_PORT(cur->ai_next, servname);
676 while (cur && cur->ai_next) 673 while (cur && cur->ai_next)
677 cur = cur->ai_next; 674 cur = cur->ai_next;
678 } else 675 } else
679 ERR(EAI_FAMILY); /*xxx*/ 676 ERR(EAI_FAMILY); /*xxx*/
680 } 677 }
681 break; 678 break;
@@ -688,7 +685,7 @@ explore_numeric(pai, hostname, servname, res)
688 GET_PORT(cur->ai_next, servname); 685 GET_PORT(cur->ai_next, servname);
689 while (cur && cur->ai_next) 686 while (cur && cur->ai_next)
690 cur = cur->ai_next; 687 cur = cur->ai_next;
691 } else 688 } else
692 ERR(EAI_FAMILY); /*xxx*/ 689 ERR(EAI_FAMILY); /*xxx*/
693 } 690 }
694 break; 691 break;
@@ -730,6 +727,9 @@ explore_numeric_scope(pai, hostname, servname, res)
730 return 0; 727 return 0;
731 728
732 afd = find_afd(pai->ai_family); 729 afd = find_afd(pai->ai_family);
730 if (afd == NULL)
731 return 0;
732
733 if (!afd->a_scoped) 733 if (!afd->a_scoped)
734 return explore_numeric(pai, hostname, servname, res); 734 return explore_numeric(pai, hostname, servname, res);
735 735
@@ -976,7 +976,7 @@ ip6_str2scopeid(scope, sin6)
976 else 976 else
977 return -1; 977 return -1;
978} 978}
979#endif 979#endif
980 980
981/* code duplicate with gethnamaddr.c */ 981/* code duplicate with gethnamaddr.c */
982 982