Page MenuHomeFreeBSD

Add a --sctp flag to nc.
ClosedPublic

Authored by markj on Jul 10 2020, 4:27 PM.

Details

Summary

This is handy for testing, as we don't have a lot of SCTP-enabled code
in the base system. traceroute(6) supports SCTP but uses raw sockets.

The change just adds an SCTP mode akin to UDP mode. We could perhaps
extend this further and make use of the SCTP syscalls to exercise some
unique SCTP features, but I'm not very familiar with them. If anyone
has any suggestions I will try to implement them.

Use a long option to minimize the risk of conflicts with OpenBSD, which
has about 40 single-char option flags. For bonus points, this change
unbreaks --no-tcpopt by adding a missing case required by getopt_long().

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markj requested review of this revision.Jul 10 2020, 4:27 PM
markj created this revision.
This revision is now accepted and ready to land.Jul 10 2020, 4:43 PM

I'm willing to add support for SCTP features which make sense for nc over time. Just wasn't sure if this is acceptable for contributed code...

I'm willing to add support for SCTP features which make sense for nc over time. Just wasn't sure if this is acceptable for contributed code...

The impression I got from talking to a couple of folks on IRC is that upstream (OpenBSD) has already diverged quite a lot, so it is acceptable to add FreeBSD-specific code here, especially if it uses long options like --sctp so as to avoid conflicts. @delphij was the last to work on keeping us in sync, so I defer to him on this.

This revision was automatically updated to reflect the committed changes.

I'm willing to add support for SCTP features which make sense for nc over time. Just wasn't sure if this is acceptable for contributed code...

The impression I got from talking to a couple of folks on IRC is that upstream (OpenBSD) has already diverged quite a lot, so it is acceptable to add FreeBSD-specific code here, especially if it uses long options like --sctp so as to avoid conflicts. @delphij was the last to work on keeping us in sync, so I defer to him on this.

Thanks for the information. Since OpenBSD has no SCTP support, I thought it is hard to go via upstream. But if additions are acceptable, I'll add some features. Will put @delphij on the corresponding reviews.