🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Steve March Sat, 22 Jun 1991 08:06
Small mistake in RENO code
#395
Author: Steve March
Date: Sat, 22 Jun 1991 08:06
12 lines
1085 bytes
In the file ..../sys/netinet/in.c, in the routine in_sockmaskof(), the variable
mask is declared u_long (line 102) but is later assigned a negative value in
line 115.  Doesn't look right to me.

-Steve

===============================================================================
Steve March                            (H) (217)328-5176/328-5230  (W) 333-7408
Domain: march@cs.uiuc.edu             Path: {uunet|convex|pur-ee}!uiucdcs!march
"Time and space are modes by which we think and not conditions in which
 we live."  - Albert Einstein
Re: Small mistake in RENO code
#396
Author: Chris Torek
Date: Mon, 24 Jun 1991 01:22
24 lines
1376 bytes
In article <1991Jun22.080642.27211@m.cs.uiuc.edu> march@cs.uiuc.edu
(Steve March) writes:
>In the file ..../sys/netinet/in.c, in the routine in_sockmaskof(), the
>variable mask is declared u_long (line 102) but is later assigned a
>negative value in line 115.  Doesn't look right to me.

The code in question is:

	register u_long mask;
	...
	mask = -1;

which is intended to set `mask' to all-ones.  Since all the machines on
which 4BSD runs are 2's complement, this is fine; it would, however, be
better in some sense to use

	mask = ~0UL;

so as to guarantee this result in all cases.  Unfortunately, `U'-suffixed
constants are not recognized by the 4.3-reno Vax and Tahoe C compilers.
Perhaps `mask = ~0L' would suffice. :-)
-- 
In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427)
Berkeley, CA		Domain:	torek@ee.lbl.gov
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads