summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/res_mkupdate.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2006-03-30 20:15:53 +0000
committerume <ume@FreeBSD.org>2006-03-30 20:15:53 +0000
commit3a893e11a7a11a71f7c387d15943b98cb1d40797 (patch)
tree301a2d20516db1ef585fb63207881444f480edae /lib/libc/net/res_mkupdate.c
parent19c7a1894198c99124d609f45f5c4fb3e5262143 (diff)
downloadFreeBSD-src-3a893e11a7a11a71f7c387d15943b98cb1d40797.zip
FreeBSD-src-3a893e11a7a11a71f7c387d15943b98cb1d40797.tar.gz
Expose res_update and friends again. At least, ports/mail/spamilter
uses them. Now, we have res_nupdate and res_nmkupdate as well, but they are still based on our old resolver for binary backward compatibility. So, they don't provide new features such as TSIG support. Reported by: pointyhat via kris
Diffstat (limited to 'lib/libc/net/res_mkupdate.c')
-rw-r--r--lib/libc/net/res_mkupdate.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/libc/net/res_mkupdate.c b/lib/libc/net/res_mkupdate.c
index 29cb95a..ebcaba2 100644
--- a/lib/libc/net/res_mkupdate.c
+++ b/lib/libc/net/res_mkupdate.c
@@ -33,13 +33,13 @@ __FBSDID("$FreeBSD$");
#include <limits.h>
#include <netdb.h>
#include <resolv.h>
+#include <res_update.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
-#include "res_update.h"
#include "res_config.h"
static int getnum_str(u_char **, u_char *);
@@ -60,7 +60,7 @@ static int getword_str(char *, int, u_char **, u_char *);
* -5 unknown operation or no records
*/
int
-res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
+res_nmkupdate(res_state statp, ns_updrec *rrecp_in, u_char *buf, int buflen) {
ns_updrec *rrecp_start = rrecp_in;
HEADER *hp;
u_char *cp, *sp2, *startp, *endp;
@@ -73,11 +73,6 @@ res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
u_int32_t n1, rttl;
u_char *dnptrs[20], **dpp, **lastdnptr;
- if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- RES_SET_H_ERRNO(&_res, NETDB_INTERNAL);
- return (-1);
- }
-
/*
* Initialize header fields.
*/
@@ -85,7 +80,7 @@ res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
return (-1);
memset(buf, 0, HFIXEDSZ);
hp = (HEADER *) buf;
- hp->id = htons(++_res.id);
+ hp->id = htons(++statp->id);
hp->opcode = ns_o_update;
hp->rcode = NOERROR;
cp = buf + HFIXEDSZ;
@@ -137,7 +132,7 @@ res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
break;
default:
fprintf(stderr,
- "res_mkupdate: incorrect opcode: %d\n",
+ "res_nmkupdate: incorrect opcode: %d\n",
rrecp->r_opcode);
fflush(stderr);
return (-1);
@@ -151,7 +146,7 @@ res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
break;
default:
fprintf(stderr,
- "res_mkupdate: incorrect opcode: %d\n",
+ "res_nmkupdate: incorrect opcode: %d\n",
rrecp->r_opcode);
fflush(stderr);
return (-1);
OpenPOWER on IntegriCloud