2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-29 13:28:14 +00:00

Use signed for return value of res_nsend*. Update res_nmkupdate call.

This commit is contained in:
Ted Lemon 2000-04-06 23:02:59 +00:00
parent a1abfd34d2
commit 45e52bde13

View File

@ -1,5 +1,5 @@
#if !defined(lint) && !defined(SABER) #if !defined(lint) && !defined(SABER)
static const char rcsid[] = "$Id: res_update.c,v 1.4 2000/03/18 02:15:49 mellon Exp $"; static const char rcsid[] = "$Id: res_update.c,v 1.5 2000/04/06 23:02:59 mellon Exp $";
#endif /* not lint */ #endif /* not lint */
/* /*
@ -85,6 +85,7 @@ res_nupdate(res_state statp, ns_updrec *rrecp_in) {
struct zonegrp *zptr, tgrp; struct zonegrp *zptr, tgrp;
int nzones = 0, nscount = 0; int nzones = 0, nscount = 0;
unsigned n; unsigned n;
int rval;
struct sockaddr_in nsaddrs[MAXNS]; struct sockaddr_in nsaddrs[MAXNS];
ns_rcode rcode; ns_rcode rcode;
ns_tsig_key *key; ns_tsig_key *key;
@ -135,9 +136,8 @@ res_nupdate(res_state statp, ns_updrec *rrecp_in) {
zptr->z_flags |= ZG_F_ZONESECTADDED; zptr->z_flags |= ZG_F_ZONESECTADDED;
/* Marshall the update message. */ /* Marshall the update message. */
n = res_nmkupdate(statp, ISC_LIST_HEAD(zptr->z_rrlist), n = sizeof packet;
packet, sizeof packet); if (res_nmkupdate(statp, ISC_LIST_HEAD(zptr->z_rrlist), packet, &n)) {
if (n < 0) {
rcode = -1; rcode = -1;
goto done; goto done;
} }
@ -150,13 +150,13 @@ res_nupdate(res_state statp, ns_updrec *rrecp_in) {
/* Send the update and remember the result. */ /* Send the update and remember the result. */
key = (ns_tsig_key *)0; key = (ns_tsig_key *)0;
if (!find_tsig_key (&key, zptr->z_origin)) { if (!find_tsig_key (&key, zptr->z_origin)) {
n = res_nsendsigned(statp, packet, n, key, rval = res_nsendsigned(statp, packet, n, key,
answer, sizeof answer); answer, sizeof answer);
tkey_free (&key); tkey_free (&key);
} else { } else {
n = res_nsend(statp, packet, n, answer, sizeof answer); rval = res_nsend(statp, packet, n, answer, sizeof answer);
} }
if (n < 0) { if (rval < 0) {
rcode = -1; rcode = -1;
goto undone; goto undone;
} }