Date: Wed, 20 Aug 2008 01:18:17 -0700 From: Julian Elischer <julian@elischer.org> To: freebsd-virtualization@freebsd.org Subject: Re: report and comment Message-ID: <48ABD349.6030701@elischer.org> In-Reply-To: <48ABD1EF.5060307@elischer.org> References: <48ABD1EF.5060307@elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Julian Elischer wrote: > I have MOSTLY merged the last commit into > all the p4 branches.. > > progress should be good towards commit 1.5 > > > something I just noticed.... > > in sys/netinet/tcp_subr.c > ================================================ > [...] > #endif * Locking of the global variables isn_secret, isn_last_reseed, > isn_offset, > * isn_offset_old, and isn_ctx is performed using the TCP pcbinfo lock. In > * general, this means holding an exclusive (write) lock. > */ > > #define ISN_BYTES_PER_SECOND 1048576 > #define ISN_STATIC_INCREMENT 4096 > #define ISN_RANDOM_INCREMENT (4096 - 1) > > #ifndef VIMAGE > static u_char isn_secret[32]; > static int isn_last_reseed; > static u_int32_t isn_offset, isn_offset_old; > static MD5_CTX isn_ctx; > #endif > > tcp_seq > tcp_new_isn(struct tcpcb *tp) > { > [...] > ================================================ > > and in sys/contrib/pf/net/pf_subr.c > > ================================================ > [...] > * Locking of the global variables isn_secret, isn_last_reseed, isn_offset, > * isn_offset_old, and isn_ctx is performed using the TCP pcbinfo lock. In > * general, this means holding an exclusive (write) lock. > */ > > #define ISN_BYTES_PER_SECOND 1048576 > #define ISN_STATIC_INCREMENT 4096 > #define ISN_RANDOM_INCREMENT (4096 - 1) > > #ifndef VIMAGE > static u_char isn_secret[32]; > static int isn_last_reseed; > static u_int32_t isn_offset; > static MD5_CTX isn_ctx; > #endif > > u_int32_t > pf_new_isn(struct pf_state *s) > { > [...] > ===================================================== > > so we have the same global variables, static, in 2 places.. > so one set should go in the pf vars and the other in the inet > vars. The first answers I think of are: > > > 1/ rename one set > 2/ make one of them a VV_ macro that goes elsewhere. looking at the code better... I see the entire function is about the same.. 3/ remove the duplicated code in pf and call the one in tcp_subr.c from both places.. > > anyone have other suggestions? > > > > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to > "freebsd-virtualization-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48ABD349.6030701>