BIND 8.2.3-T4B ns_forw.c patch for qsort call

Valerie Miller miller at process.com
Thu Apr 27 16:08:30 UTC 2000


Hi,

In ns_forw.c, there is a call to qsort() to sort NS RR's, which I think needs
parentheses on the (char *)qp->q_addr+naddr parameter because the (char *)
cast takes precedence in standard C over the "+naddr". It caused problems
for us on VMS.

Patch below.

Valerie Miller
Software Engineer
Process Software Corporation


*** ns_forw.c~	Fri Apr 21 02:54:06 2000
--- ns_forw.c	Thu Apr 27 11:47:26 2000
***************
*** 701,707 ****
  	 * be ahead of us (naddr > 0)
  	 */
  	if (n > naddr) {
! 		qsort((char *)qp->q_addr+naddr, n-naddr, sizeof(struct qserv),
  		      (int (*)(const void *, const void *))qcomp);
  	}
  	return (n - naddr);
--- 701,707 ----
  	 * be ahead of us (naddr > 0)
  	 */
  	if (n > naddr) {
! 		qsort((char *)(qp->q_addr+naddr), n-naddr, sizeof(struct qserv),
  		      (int (*)(const void *, const void *))qcomp);
  	}
  	return (n - naddr);




More information about the bind-workers mailing list