From 6c7d734ad5356ca0a26e4ac4a48b159367a32613 Mon Sep 17 00:00:00 2001 From: dougb Date: Mon, 1 Jul 2002 01:20:28 +0000 Subject: Resolve conflicts, generally in favor of the vendor version. --- contrib/bind/bin/named-xfer/named-xfer.c | 8 +++++++- contrib/bind/bin/nslookup/commands.l | 28 ++++++++++++++-------------- contrib/bind/bin/nslookup/getinfo.c | 23 +++++++++-------------- contrib/bind/bin/nslookup/main.c | 23 +++++++++++++++++------ 4 files changed, 47 insertions(+), 35 deletions(-) (limited to 'contrib/bind/bin') diff --git a/contrib/bind/bin/named-xfer/named-xfer.c b/contrib/bind/bin/named-xfer/named-xfer.c index 6926e30..ea3ecc8 100644 --- a/contrib/bind/bin/named-xfer/named-xfer.c +++ b/contrib/bind/bin/named-xfer/named-xfer.c @@ -131,7 +131,7 @@ char copyright[] = #if !defined(lint) && !defined(SABER) static const char sccsid[] = "@(#)named-xfer.c 4.18 (Berkeley) 3/7/91"; -static const char rcsid[] = "$Id: named-xfer.c,v 8.120 2002/01/29 06:54:52 marka Exp $"; +static const char rcsid[] = "$Id: named-xfer.c,v 8.121 2002/06/26 03:27:22 marka Exp $"; #endif /* not lint */ #include "port_before.h" @@ -751,6 +751,7 @@ main(int argc, char *argv[]) { default: result = XFER_FAIL; /* fall through */ + case XFER_REFUSED: case XFER_TIMEOUT: case XFER_FAIL: (void) unlink(tmpname); @@ -1068,6 +1069,7 @@ getzone(struct zoneinfo *zp, u_int32_t serial_no, int port) { u_int32_t query_serial = serial_no; int first_soa_printed; struct in_addr z_axfr_src; + int refused = 0; #ifdef DEBUG if (debug) { @@ -1631,6 +1633,7 @@ receive: my_addr_text, inet_ntoa(sin.sin_addr), zp->z_origin); + refused = 1; } else { syslog(LOG_INFO, "[%s] record too short from [%s], zone %s\n", @@ -1913,6 +1916,7 @@ axfr_response: my_addr_text, inet_ntoa(sin.sin_addr), zp->z_origin); + refused = 1; } else { syslog(LOG_INFO, "[%s] record too short from [%s], zone %s\n", @@ -1952,6 +1956,8 @@ axfr_response: } if (!error) return (XFER_TIMEOUT); + if (refused) + return (XFER_REFUSED); return (XFER_FAIL); } diff --git a/contrib/bind/bin/nslookup/commands.l b/contrib/bind/bin/nslookup/commands.l index a23c44b..fd228a4 100644 --- a/contrib/bind/bin/nslookup/commands.l +++ b/contrib/bind/bin/nslookup/commands.l @@ -172,11 +172,11 @@ NAME [:A-Za-z0-9.*=_/-] * 1 == use original server to find * the new one. */ - SetDefaultServer(yytext, 0); + SetDefaultServer((char*)yytext, 0); return(1); } ^{WS}*lserver{WS}+{LET}{NAME}*{WS}*$ { - SetDefaultServer(yytext, 1); + SetDefaultServer((char*)yytext, 1); return(1); } ^{WS}*exit{WS}*$ { @@ -192,11 +192,11 @@ NAME [:A-Za-z0-9.*=_/-] * 0 == output to stdout * 1 == output to file */ - Finger(yytext, 1); + Finger((char*)yytext, 1); return(1); } ^{WS}*finger({WS}+{LET}{NAME}*)?{WS}*$ { - Finger(yytext, 0); + Finger((char*)yytext, 0); return(1); } ^{WS}*ls{WS}+(("-a"|"-d"|"-h"|"-m"|"-s"){WS}+)?{LET}{NAME}*{WS}+>>?{WS}+{NAME}+{WS}*$ { @@ -205,11 +205,11 @@ NAME [:A-Za-z0-9.*=_/-] * 0 == output to stdout * 1 == output to file */ - ListHosts(yytext, 1); + ListHosts((char*)yytext, 1); return(1); } ^{WS}*ls{WS}+(("-a"|"-d"|"-h"|"-m"|"-s"){WS}+)?{LET}{NAME}*{WS}*$ { - ListHosts(yytext, 0); + ListHosts((char*)yytext, 0); return(1); } ^{WS}*ls{WS}+-t{WS}+({LET}{NAME}*{WS}+)?{LET}{NAME}*{WS}+>>?{WS}+{NAME}+{WS}*$ { @@ -218,15 +218,15 @@ NAME [:A-Za-z0-9.*=_/-] * 0 == output to stdout * 1 == output to file */ - ListHostsByType(yytext, 1); + ListHostsByType((char*)yytext, 1); return(1); } ^{WS}*ls{WS}+-t{WS}+({LET}{NAME}*{WS}+)?{LET}{NAME}*{WS}*$ { - ListHostsByType(yytext, 0); + ListHostsByType((char*)yytext, 0); return(1); } ^{WS}*set{WS}+{NAME}+{WS}*$ { - SetOption(yytext); + SetOption((char*)yytext); return(1); } ^{WS}*help{WS}*$ { @@ -244,11 +244,11 @@ NAME [:A-Za-z0-9.*=_/-] * 0 == output to stdout * 1 == output to file */ - LookupHost(yytext, 1); + LookupHost((char*)yytext, 1); return(1); } ^{WS}*{FLET}{NAME}*{WS}*$ { - LookupHost(yytext, 0); + LookupHost((char*)yytext, 0); return(1); } ^{WS}*{FLET}{NAME}*{WS}+{LET}{NAME}*{WS}+>>?{WS}*{NAME}+{WS}*$ { @@ -256,11 +256,11 @@ NAME [:A-Za-z0-9.*=_/-] * 0 == output to stdout * 1 == output to file */ - LookupHostWithServer(yytext, 1); + LookupHostWithServer((char*)yytext, 1); return(1); } ^{WS}*{FLET}{NAME}*{WS}+{LET}{NAME}*{WS}*$ { - LookupHostWithServer(yytext, 0); + LookupHostWithServer((char*)yytext, 0); return(1); } ^{WS}*\n { @@ -268,7 +268,7 @@ NAME [:A-Za-z0-9.*=_/-] } ^.*\n { printf("Unrecognized command: %s", - yytext); + (char*)yytext); return(1); } \n { ; } diff --git a/contrib/bind/bin/nslookup/getinfo.c b/contrib/bind/bin/nslookup/getinfo.c index a1c593c..0c1072e 100644 --- a/contrib/bind/bin/nslookup/getinfo.c +++ b/contrib/bind/bin/nslookup/getinfo.c @@ -54,7 +54,7 @@ #ifndef lint static const char sccsid[] = "@(#)getinfo.c 5.26 (Berkeley) 3/21/91"; -static const char rcsid[] = "$Id: getinfo.c,v 8.23 2002/04/29 01:11:52 marka Exp $"; +static const char rcsid[] = "$Id: getinfo.c,v 8.27 2002/05/22 04:06:57 marka Exp $"; #endif /* not lint */ /* @@ -142,16 +142,9 @@ typedef union { */ static int -GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer, - merge) - union res_sockaddr_union *nsAddrPtr; - char *msg; - int queryType; - int msglen; - Boolean iquery; - register HostInfo *hostPtr; - Boolean isServer; - Boolean merge; +GetAnswer(union res_sockaddr_union *nsAddrPtr, int queryType, + char *msg, int msglen, Boolean iquery, HostInfo *hostPtr, + Boolean isServer, Boolean merge) { register HEADER *headerPtr; register const u_char *cp; @@ -253,7 +246,8 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer, printf("Non-authoritative answer:\n"); } - if (queryType != T_A && !(iquery && queryType == T_PTR)) { + if (queryType != T_A && queryType != T_AAAA && /* A6? */ + !(iquery && queryType == T_PTR)) { while (--ancount >= 0 && cp < eom) { if ((cp = Print_rr(cp, (u_char *)&answer, eom, stdout)) == NULL) { @@ -360,7 +354,8 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer, } } - if ((queryType == T_A || queryType == T_PTR) && haveAnswer) { + if ((queryType == T_A || queryType == T_AAAA || queryType == T_PTR) && + haveAnswer) { /* * Go through the alias and address lists and return them @@ -540,7 +535,7 @@ GetAnswer(nsAddrPtr, queryType, msg, msglen, iquery, hostPtr, isServer, */ cp = res_skip((u_char*)&answer, 3, eom); - if (queryType != T_A) { + if (queryType != T_A && queryType != T_AAAA) { /* * If we don't need to save the record, just print it. */ diff --git a/contrib/bind/bin/nslookup/main.c b/contrib/bind/bin/nslookup/main.c index 384e3cd..5bce811 100644 --- a/contrib/bind/bin/nslookup/main.c +++ b/contrib/bind/bin/nslookup/main.c @@ -78,7 +78,7 @@ char copyright[] = #ifndef lint static const char sccsid[] = "@(#)main.c 5.42 (Berkeley) 3/3/91"; -static const char rcsid[] = "$Id: main.c,v 8.22 2002/04/12 03:03:49 marka Exp $"; +static const char rcsid[] = "$Id: main.c,v 8.24 2002/05/26 03:12:20 marka Exp $"; #endif /* not lint */ /* @@ -341,10 +341,21 @@ main(int argc, char **argv) { } else { result = GetHostInfoByAddr(&u[i], &u[i], defaultPtr); if (result != SUCCESS) { + char t[80]; + switch (u[i].sin.sin_family) { + case AF_INET: + inet_ntop(AF_INET, &u[i].sin.sin_addr, t, sizeof(t)); + break; + case AF_INET6: + inet_ntop(AF_INET6, &u[i].sin6.sin6_addr, t, sizeof(t)); + break; + default: + strcpy(t, ""); + break; + } fprintf(stderr, - "*** Can't find server name for address %s: %s\n", - inet_ntoa(res.nsaddr_list[i].sin_addr), - DecodeError(result)); + "*** Can't find server name for address %s: %s\n", + t, DecodeError(result)); } else { defaultAddr = u[i]; break; @@ -693,7 +704,7 @@ DoLookup(host, servPtr, serverName) * RFC1123 says we "SHOULD check the string syntactically for a * dotted-decimal number before looking it up [...]" (p. 13). */ - if (queryType == T_A && IsAddr(host, &addr)) { + if ((queryType == T_A || queryType == T_AAAA) && IsAddr(host, &addr)) { result = GetHostInfoByAddr(&servAddr, &addr, &curHostInfo); } else { if (queryType == T_PTR) { @@ -711,7 +722,7 @@ DoLookup(host, servPtr, serverName) * There's no need to print anything for other query types * because the info has already been printed. */ - if (queryType == T_A) { + if (queryType == T_A || queryType == T_AAAA) { curHostValid = TRUE; PrintHostInfo(filePtr, "Name:", &curHostInfo); } -- cgit v1.1