summary refs log tree commit diff
path: root/resolv/res_send.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2016-09-21 16:30:27 +0200
committerFlorian Weimer <fweimer@redhat.com>2016-09-21 16:30:27 +0200
commit6815a33d53164e7f1a3b87cec905c17c7a14a007 (patch)
tree36746b90972604ea29e28a698e8bd1dbc6dedea4 /resolv/res_send.c
parentcbb47fa1c6476af73f393a81cd62fc926e1b8f6e (diff)
downloadglibc-6815a33d53164e7f1a3b87cec905c17c7a14a007.tar.gz
glibc-6815a33d53164e7f1a3b87cec905c17c7a14a007.tar.xz
glibc-6815a33d53164e7f1a3b87cec905c17c7a14a007.zip
resolv: Remove unsupported hook functions from the API [BZ #20016]
Diffstat (limited to 'resolv/res_send.c')
-rw-r--r--resolv/res_send.c85
1 files changed, 0 insertions, 85 deletions
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 869294fb95..6d46bb2c15 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -364,22 +364,6 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
 		return (-1);
 	}
 
-#ifdef USE_HOOKS
-	if (__glibc_unlikely (statp->qhook || statp->rhook))       {
-		if (anssiz < MAXPACKET && ansp) {
-			/* Always allocate MAXPACKET, callers expect
-			   this specific size.  */
-			u_char *buf = malloc (MAXPACKET);
-			if (buf == NULL)
-				return (-1);
-			memcpy (buf, ans, HFIXEDSZ);
-			*ansp = buf;
-			ans = buf;
-			anssiz = MAXPACKET;
-		}
-	}
-#endif
-
 	DprintQ((statp->options & RES_DEBUG) || (statp->pfcode & RES_PRF_QUERY),
 		(stdout, ";; res_send()\n"), buf, buflen);
 	v_circuit = ((statp->options & RES_USEVC)
@@ -468,47 +452,10 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
 	    {
 #ifdef DEBUG
 		char tmpbuf[40];
-#endif
-#if defined USE_HOOKS || defined DEBUG
 		struct sockaddr *nsap = get_nsaddr (statp, ns);
 #endif
 
 	    same_ns:
-#ifdef USE_HOOKS
-		if (__glibc_unlikely (statp->qhook != NULL))       {
-			int done = 0, loops = 0;
-
-			do {
-				res_sendhookact act;
-
-				struct sockaddr_in *nsap4;
-				nsap4 = (struct sockaddr_in *) nsap;
-				act = (*statp->qhook)(&nsap4, &buf, &buflen,
-						      ans, anssiz, &resplen);
-				nsap = (struct sockaddr_in6 *) nsap4;
-				switch (act) {
-				case res_goahead:
-					done = 1;
-					break;
-				case res_nextns:
-					__res_iclose(statp, false);
-					goto next_ns;
-				case res_done:
-					return (resplen);
-				case res_modified:
-					/* give the hook another try */
-					if (++loops < 42) /*doug adams*/
-						break;
-					/*FALLTHROUGH*/
-				case res_error:
-					/*FALLTHROUGH*/
-				default:
-					return (-1);
-				}
-			} while (!done);
-		}
-#endif
-
 		Dprint(statp->options & RES_DEBUG,
 		       (stdout, ";; Querying server (# %d) address = %s\n",
 			ns + 1, inet_ntop(nsap->sa_family,
@@ -571,38 +518,6 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
 		    (statp->options & RES_STAYOPEN) == 0) {
 			__res_iclose(statp, false);
 		}
-#ifdef USE_HOOKS
-		if (__glibc_unlikely (statp->rhook))       {
-			int done = 0, loops = 0;
-
-			do {
-				res_sendhookact act;
-
-				act = (*statp->rhook)((struct sockaddr_in *)
-						      nsap, buf, buflen,
-						      ans, anssiz, &resplen);
-				switch (act) {
-				case res_goahead:
-				case res_done:
-					done = 1;
-					break;
-				case res_nextns:
-					__res_iclose(statp, false);
-					goto next_ns;
-				case res_modified:
-					/* give the hook another try */
-					if (++loops < 42) /*doug adams*/
-						break;
-					/*FALLTHROUGH*/
-				case res_error:
-					/*FALLTHROUGH*/
-				default:
-					return (-1);
-				}
-			} while (!done);
-
-		}
-#endif
 		return (resplen);
  next_ns: ;
 	   } /*foreach ns*/