please test (HEADER.ad)

Wendy Palm wendyp at cray.com
Wed Sep 10 09:16:57 EST 2003


no, i'm sorry, it didn't work.  a couple of problems-

1.  you forgot the "<" and ">" for the include file

so, i changed configure.ac to

--- 1916,1925 ----
                                         # Needed by our getrrsetbyname()
                                         AC_SEARCH_LIBS(res_query, resolv)
                                         AC_SEARCH_LIBS(dn_expand, resolv)
+                                       AC_CHECK_FUNCS(_getshort _getlong)
+                                       AC_CHECK_MEMBER(struct HEADER.ad,
+                                       [AC_DEFINE(HAVE_HEADER_AD)],,
+                                       [#include <arpa/nameser.h>])
                                 ])
                 fi


which generates a configure with a conftest.c looking like -
#include <arpa/nameser.h>

int
main ()
{
static struct HEADER ac_aggr;
if (sizeof ac_aggr.ad)
return 0;
   ;
   return 0;
}

2. which has the error-
   The indicated type is incomplete.

   static struct HEADER ac_aggr;
                        ^

HEADER is defined as a bit field, so sizeof doesn't really work.

typedef struct {
         unsigned        id :16;         /* query identification number */
#if BYTE_ORDER == BIG_ENDIAN
                         /* fields in third byte */
         unsigned        qr: 1;          /* response flag */
         unsigned        opcode: 4;      /* purpose of message */
         unsigned        aa: 1;          /* authoritive answer */
         unsigned        tc: 1;          /* truncated message */
         unsigned        rd: 1;          /* recursion desired */
                         /* fields in fourth byte */
         unsigned        ra: 1;          /* recursion available */
         unsigned        unused :1;      /* unused bits (MBZ as of 4.9.3a3) */
         unsigned        ad: 1;          /* authentic data from named */
         unsigned        cd: 1;          /* checking disabled by resolver */
         unsigned        rcode :4;       /* response code */
#endif
#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
                         /* fields in third byte */
         unsigned        rd :1;          /* recursion desired */
         unsigned        tc :1;          /* truncated message */
         unsigned        aa :1;          /* authoritive answer */
         unsigned        opcode :4;      /* purpose of message */
         unsigned        qr :1;          /* response flag */
                         /* fields in fourth byte */
         unsigned        rcode :4;       /* response code */
         unsigned        cd: 1;          /* checking disabled by resolver */
         unsigned        ad: 1;          /* authentic data from named */
         unsigned        unused :1;      /* unused bits (MBZ as of 4.9.3a3) */
         unsigned        ra :1;          /* recursion available */
#endif
                         /* remaining bytes */
         unsigned        qdcount :16;    /* number of question entries */
         unsigned        ancount :16;    /* number of answer entries */
         unsigned        nscount :16;    /* number of authority entries */
         unsigned        arcount :16;    /* number of resource entries */
} HEADER;

this works, kind of (leaves WARNING message about using variable before
it's defined).   i don't know anything about autoconf, so i'm not sure how to
create it in configure.ac.

#include <arpa/nameser.h>
int
main ()
{
HEADER ac_aggr;
if (ac_aggr.ad)
return 0;
   ;
   return 0;
}

i'm happy to test anything changes.
wendy


Tim Rice wrote:

> Sorry, forgot to mention you must use the --with-dns option to configure.
> 
> On Mon, 8 Sep 2003, Tim Rice wrote:
> 
> 
>>Could someone with HEADER.ad in arpa/nameser.h please test the
>>attached patch (against current) to see it it's detected.
>>
>>None of my platforms have the ad member.
>>
>>config.h will end up with "#define HAVE_HEADER_AD".
>>
>>
>>
> 
> 
> ------------------------------------------------------------------------
> 
> --- openssh/configure.ac.old	2003-09-08 06:33:33.000000000 -0700
> +++ openssh/configure.ac	2003-09-08 10:07:44.849040019 -0700
> @@ -1913,6 +1913,9 @@
>  					AC_SEARCH_LIBS(res_query, resolv)
>  					AC_SEARCH_LIBS(dn_expand, resolv)
>  					AC_CHECK_FUNCS(_getshort _getlong)
> +					AC_CHECK_MEMBER(struct HEADER.ad,
> +						[AC_DEFINE(HAVE_HEADER_AD)],,
> +						[#include arpa/nameser.h])
>  				])
>  		fi
>  	]
> --- openssh/acconfig.h.old	2003-09-07 11:01:43.989760001 -0700
> +++ openssh/acconfig.h	2003-09-08 09:58:18.714080015 -0700
> @@ -418,6 +418,9 @@
>  /* Define if getrrsetbyname() exists */
>  #undef HAVE_GETRRSETBYNAME
>  
> +/* Define if HEADER.ad exists in arpa/nameser.h */
> +#undef HAVE_HEADER_AD
> +
>  @BOTTOM@
>  
>  /* ******************* Shouldn't need to edit below this line ************** */
> --- openssh/openbsd-compat/getrrsetbyname.c.old	2003-09-08 06:29:05.644640000 -0700
> +++ openssh/openbsd-compat/getrrsetbyname.c	2003-09-08 10:08:28.004080003 -0700
> @@ -243,9 +243,11 @@
>  	rrset->rri_ttl = response->answer->ttl;
>  	rrset->rri_nrdatas = response->header.ancount;
>  
> +#ifdef HAVE_HEADER_AD
>  	/* check for authenticated data */
>  	if (response->header.ad == 1)
>  		rrset->rri_flags |= RRSET_VALIDATED;
> +#endif
>  
>  	/* copy name from answer section */
>  	length = strlen(response->answer->name);
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev at mindrot.org
> http://www.mindrot.org/mailman/listinfo/openssh-unix-dev
> 


-- 
wendy palm
Cray Open Software Development, Cray Inc.
wendyp at cray.com, 651-605-9154




More information about the openssh-unix-dev mailing list