Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Mar 1995 11:30:58 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        gibbs@estienne.CS.Berkeley.EDU, nate@sneezy.sri.com
Cc:        current@FreeBSD.org
Subject:   Re: Kernel build fails?
Message-ID:  <199503060130.LAA09193@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199503060130.LAA09193>