From owner-freebsd-current Sun Mar 5 17:35:17 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id RAA15043 for current-outgoing; Sun, 5 Mar 1995 17:35:17 -0800 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id RAA15030 for ; Sun, 5 Mar 1995 17:35:13 -0800 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id LAA09193; Mon, 6 Mar 1995 11:30:58 +1000 Date: Mon, 6 Mar 1995 11:30:58 +1000 From: Bruce Evans Message-Id: <199503060130.LAA09193@godzilla.zeta.org.au> To: gibbs@estienne.CS.Berkeley.EDU, nate@sneezy.sri.com Subject: Re: Kernel build fails? Cc: current@FreeBSD.org Sender: current-owner@FreeBSD.org Precedence: bulk >I fixed these two by doing something like this: >#ifdef TCPOUTFLAGS >/* > * Flags used when sending segments in tcp_output. > * Basic flags (TH_RST,TH_ACK,TH_SYN,TH_FIN) are totally > * determined by state, with the proviso that TH_FIN is sent only > * if all data queued for output is included in the segment. > */ >u_char tcp_outflags[TCP_NSTATES] = { > TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK, > TH_ACK, TH_ACK, > TH_FIN|TH_ACK, TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK, >}; >#else <=== Added this section. >extern u_char tcp_outflags[]; >#endif >And then removing TCPOUTFLAGS from tcp_subr.c. If this is the correct >approach, there are other places (for example in tcp_fsm.h) that need >this treatment. An initializer in a header file is usually an incorrect approach. I like the approach of #defining the initializer _list_ in a header file: #define TCP_OUTFLAGS TH_RST|TH_ACK, 0, TH_SYN, TH_SYN|TH_ACK, \ TH_ACK, TH_ACK, \ TH_FIN|TH_ACK, TH_ACK, TH_FIN|TH_ACK, TH_ACK, TH_ACK, and using it exactly once, except I don't like extern data being accessed from many modules (that's why I just made the data static to handle the problem with ttydefchars in 1.1.5). Bruce