From owner-freebsd-hackers Thu Jun 3 16:21: 8 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mercury.inktomi.com (mercury.inktomi.com [209.1.32.126]) by hub.freebsd.org (Postfix) with ESMTP id 117B515A6D for ; Thu, 3 Jun 1999 16:21:05 -0700 (PDT) (envelope-from jplevyak@inktomi.com) Received: from tsdev (tsdev.inktomi.com [209.1.32.119]) by mercury.inktomi.com (8.9.1a/8.9.1) with ESMTP id QAA13795; Thu, 3 Jun 1999 16:21:11 -0700 (PDT) Received: (from jplevyak@localhost) by tsdev (SMI-8.6/) id QAA19724; Thu, 3 Jun 1999 16:21:04 -0700 Message-ID: <19990603162104.C8565@tsdev.inktomi.com> Date: Thu, 3 Jun 1999 16:21:04 -0700 From: John Plevyak To: lab@gta.com, freebsd-hackers@FreeBSD.ORG Subject: Re: Possible conflict in nameser.h References: <375707D7.CBE3586B@gta.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i In-Reply-To: <375707D7.CBE3586B@gta.com>; from Larry Baird on Thu, Jun 03, 1999 at 06:55:19PM -0400 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Jun 03, 1999 at 06:55:19PM -0400, Larry Baird wrote: > I have found a small problem in nameser.h in the ns_rr structure. > This structure has a member named class that causes a compilation > problem if you include nameser.h into C++. I suspect that I may be > the only person to ever hit up against this (:. Any comments before > I summit a bug report? > > -- > ------------------------------------------------------------------------ > Larry Baird > Global Technology Associates, Inc. | Orlando, FL > Email: lab@gta.com | TEL 407-380-0220, FAX 407-380-6080 > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message I have hit this 'bug'. I have a patch: Index: include/arpa/nameser.h =================================================================== RCS file: /usr/cvsroot/src/include/arpa/nameser.h,v retrieving revision 1.12 diff -c -r1.12 nameser.h *** nameser.h 1998/06/11 08:55:15 1.12 --- nameser.h 1999/03/03 18:53:23 *************** *** 140,146 **** typedef struct __ns_rr { char name[NS_MAXDNAME]; /* XXX need to malloc */ u_int16_t type; ! u_int16_t class; u_int32_t ttl; u_int16_t rdlength; const u_char *rdata; --- 140,146 ---- typedef struct __ns_rr { char name[NS_MAXDNAME]; /* XXX need to malloc */ u_int16_t type; ! u_int16_t _class; u_int32_t ttl; u_int16_t rdlength; const u_char *rdata; *************** *** 149,155 **** /* Accessor macros - this is part of the public interface. */ #define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".") #define ns_rr_type(rr) ((rr).type + 0) ! #define ns_rr_class(rr) ((rr).class + 0) #define ns_rr_ttl(rr) ((rr).ttl + 0) #define ns_rr_rdlen(rr) ((rr).rdlength + 0) #define ns_rr_rdata(rr) ((rr).rdata + 0) --- 149,155 ---- /* Accessor macros - this is part of the public interface. */ #define ns_rr_name(rr) (((rr).name[0] != '\0') ? (rr).name : ".") #define ns_rr_type(rr) ((rr).type + 0) ! #define ns_rr_class(rr) ((rr)._class + 0) #define ns_rr_ttl(rr) ((rr).ttl + 0) #define ns_rr_rdlen(rr) ((rr).rdlength + 0) #define ns_rr_rdata(rr) ((rr).rdata + 0) Index: lib/libc/net/ns_parse.c =================================================================== RCS file: /usr/cvsroot/src/lib/libc/net/ns_parse.c,v retrieving revision 1.1 diff -c -r1.1 ns_parse.c *** ns_parse.c 1998/06/11 09:02:40 1.1 --- ns_parse.c 1999/03/04 19:00:06 *************** *** 160,166 **** NS_GET16(rr->type, handle->_ptr); if (handle->_ptr + NS_INT16SZ > handle->_eom) goto emsgsize; ! NS_GET16(rr->class, handle->_ptr); if (section == ns_s_qd) { rr->ttl = 0; rr->rdlength = 0; --- 160,166 ---- NS_GET16(rr->type, handle->_ptr); if (handle->_ptr + NS_INT16SZ > handle->_eom) goto emsgsize; ! NS_GET16(rr->_class, handle->_ptr); if (section == ns_s_qd) { rr->ttl = 0; rr->rdlength = 0; I would be appreciative if someone could check this in/fix it in some other way. john -- John Bradley Plevyak, PhD, jplevyak@inktomi.com, PGP KeyID: 051130BD Inktomi Corporation, 1900 S. Norfolk Street, Suite 310, San Mateo, CA 94403 W:(650)653-2830 F:(650)653-2889 P:(888)491-1332/5103192436.4911332@pagenet.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message