BIND 8.2.3-T4B ns_forw.c patch for qsort call

Mark Andrews Mark.Andrews at nominum.com
Thu Apr 27 16:32:26 UTC 2000


	Looks reasonable.

	Mark
> 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);
> 
> 
> 
--
Mark Andrews, Nominum Inc. / Internet Software Consortium
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: Mark.Andrews at nominum.com



More information about the bind-workers mailing list