Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/usr.sbin/dhcp pull up difference between 1.1.1.1 and 1....
details: https://anonhg.NetBSD.org/src/rev/7dd4e64e1c62
branches: netbsd-1-5
changeset: 488643:7dd4e64e1c62
user: mellon <mellon%NetBSD.org@localhost>
date: Sat Jul 22 05:03:07 2000 +0000
description:
pull up difference between 1.1.1.1 and 1.1.1.2
diffstat:
usr.sbin/dhcp/includes/minires/resolv.h | 16 ++++++++--------
usr.sbin/dhcp/minires/res_mkquery.c | 10 +++++-----
usr.sbin/dhcp/minires/res_mkupdate.c | 5 +++--
usr.sbin/dhcp/minires/res_query.c | 10 +++++-----
usr.sbin/dhcp/minires/res_send.c | 16 +++++++++-------
usr.sbin/dhcp/minires/res_sendsigned.c | 13 +++++++------
6 files changed, 37 insertions(+), 33 deletions(-)
diffs (260 lines):
diff -r 58bc4e361745 -r 7dd4e64e1c62 usr.sbin/dhcp/includes/minires/resolv.h
--- a/usr.sbin/dhcp/includes/minires/resolv.h Sat Jul 22 05:02:56 2000 +0000
+++ b/usr.sbin/dhcp/includes/minires/resolv.h Sat Jul 22 05:03:07 2000 +0000
@@ -50,7 +50,7 @@
/*
* @(#)resolv.h 8.1 (Berkeley) 6/2/93
- * $Id: resolv.h,v 1.1.1.1.4.1 2000/07/10 19:58:50 mellon Exp $
+ * $Id: resolv.h,v 1.1.1.1.4.2 2000/07/22 05:03:07 mellon Exp $
*/
#ifndef _RESOLV_H_
@@ -93,18 +93,18 @@
res_sendhookact;
typedef res_sendhookact (*res_send_qhook) (struct sockaddr_in * const *ns,
- u_char **query,
+ double **query,
unsigned *querylen,
- u_char *ans,
+ double *ans,
unsigned anssiz,
int *resplen);
typedef res_sendhookact (*res_send_rhook) (const struct sockaddr_in *ns,
- u_char *query,
- unsigned querylen,
- u_char *ans,
- unsigned anssiz,
- int *resplen);
+ double *query,
+ unsigned querylen,
+ double *ans,
+ unsigned anssiz,
+ int *resplen);
struct res_sym {
int number; /* Identifying number, like T_MX */
diff -r 58bc4e361745 -r 7dd4e64e1c62 usr.sbin/dhcp/minires/res_mkquery.c
--- a/usr.sbin/dhcp/minires/res_mkquery.c Sat Jul 22 05:02:56 2000 +0000
+++ b/usr.sbin/dhcp/minires/res_mkquery.c Sat Jul 22 05:03:07 2000 +0000
@@ -70,7 +70,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_mkquery.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_mkquery.c,v 1.1.1.1 2000/04/22 07:11:55 mellon Exp $";
+static const char rcsid[] = "$Id: res_mkquery.c,v 1.1.1.1.4.1 2000/07/22 05:03:19 mellon Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -98,7 +98,7 @@
const u_char *data, /* resource record data */
unsigned datalen, /* length of data */
const u_char *newrr_in, /* new rr for modify or append */
- u_char *buf, /* buffer to put query */
+ double *buf, /* buffer to put query */
unsigned buflen) /* size of buffer */
{
register HEADER *hp;
@@ -117,10 +117,10 @@
hp->opcode = op;
hp->rd = (statp->options & RES_RECURSE) != 0;
hp->rcode = NOERROR;
- cp = buf + HFIXEDSZ;
+ cp = ((u_char *)buf) + HFIXEDSZ;
buflen -= HFIXEDSZ;
dpp = dnptrs;
- *dpp++ = buf;
+ *dpp++ = (u_char *)buf;
*dpp++ = NULL;
lastdnptr = dnptrs + sizeof dnptrs / sizeof dnptrs[0];
/*
@@ -187,5 +187,5 @@
default:
return (-1);
}
- return (cp - buf);
+ return (cp - ((u_char *)buf));
}
diff -r 58bc4e361745 -r 7dd4e64e1c62 usr.sbin/dhcp/minires/res_mkupdate.c
--- a/usr.sbin/dhcp/minires/res_mkupdate.c Sat Jul 22 05:02:56 2000 +0000
+++ b/usr.sbin/dhcp/minires/res_mkupdate.c Sat Jul 22 05:03:07 2000 +0000
@@ -21,7 +21,7 @@
*/
#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_mkupdate.c,v 1.1.1.1 2000/04/22 07:11:55 mellon Exp $";
+static const char rcsid[] = "$Id: res_mkupdate.c,v 1.1.1.1.4.1 2000/07/22 05:03:37 mellon Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -85,7 +85,7 @@
*/
int
res_nmkupdate(res_state statp,
- ns_updrec *rrecp_in, u_char *buf, unsigned *blp) {
+ ns_updrec *rrecp_in, double *bp, unsigned *blp) {
ns_updrec *rrecp_start = rrecp_in;
HEADER *hp;
u_char *cp, *sp1, *sp2, *startp, *endp;
@@ -101,6 +101,7 @@
u_char *dnptrs[20], **dpp, **lastdnptr;
unsigned siglen, keylen, certlen;
unsigned buflen = *blp;
+ u_char *buf = (unsigned char *)bp;
/*
* Initialize header fields.
diff -r 58bc4e361745 -r 7dd4e64e1c62 usr.sbin/dhcp/minires/res_query.c
--- a/usr.sbin/dhcp/minires/res_query.c Sat Jul 22 05:02:56 2000 +0000
+++ b/usr.sbin/dhcp/minires/res_query.c Sat Jul 22 05:03:07 2000 +0000
@@ -70,7 +70,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_query.c,v 1.1.1.1 2000/04/22 07:11:55 mellon Exp $";
+static const char rcsid[] = "$Id: res_query.c,v 1.1.1.1.4.1 2000/07/22 05:03:57 mellon Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -111,10 +111,10 @@
res_nquery(res_state statp,
const char *name, /* domain name */
ns_class class, ns_type type, /* class and type of query */
- u_char *answer, /* buffer to put answer */
+ double *answer, /* buffer to put answer */
unsigned anslen) /* size of answer buffer */
{
- u_char buf[MAXPACKET];
+ double buf[MAXPACKET / sizeof (double)];
HEADER *hp = (HEADER *) answer;
unsigned n;
@@ -183,7 +183,7 @@
res_nsearch(res_state statp,
const char *name, /* domain name */
ns_class class, ns_type type, /* class and type of query */
- u_char *answer, /* buffer to put answer */
+ double *answer, /* buffer to put answer */
unsigned anslen) /* size of answer */
{
const char *cp, * const *domain;
@@ -318,7 +318,7 @@
const char *name,
const char *domain,
ns_class class, ns_type type,
- u_char *answer,
+ double *answer,
unsigned anslen)
{
char nbuf[MAXDNAME];
diff -r 58bc4e361745 -r 7dd4e64e1c62 usr.sbin/dhcp/minires/res_send.c
--- a/usr.sbin/dhcp/minires/res_send.c Sat Jul 22 05:02:56 2000 +0000
+++ b/usr.sbin/dhcp/minires/res_send.c Sat Jul 22 05:03:07 2000 +0000
@@ -70,7 +70,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
-static const char rcsid[] = "$Id: res_send.c,v 1.1.1.1 2000/04/22 07:11:55 mellon Exp $";
+static const char rcsid[] = "$Id: res_send.c,v 1.1.1.1.4.1 2000/07/22 05:04:16 mellon Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -218,7 +218,7 @@
int
res_nsend(res_state statp,
- u_char *buf, unsigned buflen, u_char *ans, unsigned anssiz)
+ double *buf, unsigned buflen, double *ans, unsigned anssiz)
{
HEADER *hp = (HEADER *) buf;
HEADER *anhp = (HEADER *) ans;
@@ -372,7 +372,7 @@
* Receive length & response
*/
read_len:
- cp = ans;
+ cp = (u_char *)ans;
len = INT16SZ;
while ((n = read(statp->_sock,
(char *)cp, (unsigned)len)) > 0) {
@@ -401,7 +401,7 @@
res_nclose(statp);
goto next_ns;
}
- resplen = getUShort (ans);
+ resplen = getUShort ((unsigned char *)ans);
if (resplen > anssiz) {
Dprint(statp->options & RES_DEBUG,
(stdout, ";; response truncated\n")
@@ -421,7 +421,7 @@
res_nclose(statp);
goto next_ns;
}
- cp = ans;
+ cp = (u_char *)ans;
while (len != 0 &&
(n = read(statp->_sock,
(char *)cp, (unsigned)len))
@@ -700,8 +700,10 @@
}
#endif
if (!(statp->options & RES_INSECURE2) &&
- !res_queriesmatch(buf, buf + buflen,
- ans, ans + anssiz)) {
+ !res_queriesmatch((u_char *)buf,
+ ((u_char *)buf) + buflen,
+ (u_char *)ans,
+ ((u_char *)ans) + anssiz)) {
/*
* response contains wrong query? ignore it.
* XXX - potential security hazard could
diff -r 58bc4e361745 -r 7dd4e64e1c62 usr.sbin/dhcp/minires/res_sendsigned.c
--- a/usr.sbin/dhcp/minires/res_sendsigned.c Sat Jul 22 05:02:56 2000 +0000
+++ b/usr.sbin/dhcp/minires/res_sendsigned.c Sat Jul 22 05:03:07 2000 +0000
@@ -19,13 +19,13 @@
/* res_nsendsigned */
int
-res_nsendsigned(res_state statp, u_char *msg, unsigned msglen,
- ns_tsig_key *key, u_char *answer, unsigned anslen)
+res_nsendsigned(res_state statp, double *msg, unsigned msglen,
+ ns_tsig_key *key, double *answer, unsigned anslen)
{
res_state nstatp;
DST_KEY *dstkey;
int usingTCP = 0;
- u_char *newmsg;
+ double *newmsg;
unsigned newmsglen;
unsigned bufsize, siglen;
u_char sig[64];
@@ -43,7 +43,7 @@
memcpy(nstatp, statp, sizeof(*statp));
bufsize = msglen + 1024;
- newmsg = (u_char *) malloc(bufsize);
+ newmsg = (double *) malloc(bufsize);
if (newmsg == NULL) {
errno = ENOMEM;
return (-1);
@@ -67,7 +67,8 @@
nstatp->nscount = 1;
siglen = sizeof(sig);
- ret = ns_sign(newmsg, &newmsglen, bufsize, NOERROR, dstkey, NULL, 0,
+ ret = ns_sign((u_char *)newmsg, &newmsglen, bufsize,
+ NOERROR, dstkey, NULL, 0,
sig, &siglen, 0);
if (ret < 0) {
free (nstatp);
@@ -96,7 +97,7 @@
}
anslen = ret;
- ret = ns_verify(answer, &anslen, dstkey, sig, siglen,
+ ret = ns_verify((u_char *)answer, &anslen, dstkey, sig, siglen,
NULL, NULL, &tsig_time,
(nstatp->options & RES_KEEPTSIG) ? 1 : 0);
if (ret != 0) {
Home |
Main Index |
Thread Index |
Old Index