svn commit: r208857 - head/sys/netinet

Luigi Rizzo rizzo at
Sun Jun 6 01:10:02 UTC 2010

On Sat, Jun 05, 2010 at 05:53:55PM -0700, Randall Stewart wrote:
> Luigi:
> We on the SCTP team ;-) have always worked under the
> constraint of "scrubbing out" with un-ifdef loads of stuff for
> - Windows
> - MacOS-X
> - User-Space Implementation
> - Panda (translated IOS-XR)
> Now there is a HUGE amount of cruft that has some ugly ifdef's in it  
> which
> I was told way back was a no-no.... (I was also told unifdef is your
> friend ;-D)
> Anyway.. I would be more than glad to bring back the "full" code if
> folks would all agree..  it actually makes it a lot easier when you
> are debugging to have the precise line number instead of working between
> two worlds ;-)
> But of course we would have to get agreement from quite a few folks...  
> but
> I am game ;-)

as a data point, i went through a similar problem when i
ported ipfw+dummynet to linux and windows, and as you can see
from the code in HEAD, the amount of OS-dependent code in
the common files is minimal (much much less than in the
first versions).

Being ashamed of committing large #ifdef sections was a big
motivator for trying to pack os-dependent parts in os-specific
files and leave the core as clean as possible

In the case of SCTP, i don't think anyone but the SCTP team
would put hands or think of modifying the code, so if FreeBSD
trusts your code (which obviously is the case), and as long
as there no licensing issues (this is something you can tell us)
I don't see why people should object on having the unscrubbed code.


> R
> On Jun 5, 2010, at 5:44 PM, Luigi Rizzo wrote:
> >On Sat, Jun 05, 2010 at 09:39:53PM +0000, Randall Stewart wrote:
> >>Author: rrs
> >>Date: Sat Jun  5 21:39:52 2010
> >>New Revision: 208857
> >>URL:
> >>
> >>Log:
> >> Purge out a Windows def that somehow slipped
> >> past the scrubber.
> >
> >i wonder if it makes sense to scrub away the code for other OS.
> >While I understand the rationale, seeing the whole code might have
> >several advantages:
> >- understand the constraints that other OS impose;
> >- learn what APIs are available in other OS;
> >- teach people how to write portable code;
> >
> >cheers
> >luigi
> >
> ------------------------------
> Randall Stewart
> 803-317-4952 (cell)

More information about the svn-src-all mailing list