Page MenuHomeFreeBSD

Add header definition for RFC4340, Datagram Congestion Control Protocol
Needs ReviewPublic

Authored by thj on Wed, Aug 7, 11:46 AM.

Details

Reviewers
jtl
bz
Group Reviewers
network
Summary

Split out from https://reviews.freebsd.org/D16851

Add header definition for RFC4340, Datagram Congestion Control Protocol

Add a header definition for DCCP as defined in RFC4340. This header definition
is required to perform validation when receiving and forwarding DCCP packets.
We do not currently support DCCP.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 25731
Build 24313: arc lint + arc unit

Event Timeline

thj created this revision.Wed, Aug 7, 11:46 AM
rscheff_gmx.at added inline comments.
sys/netinet/dccp.h
42

#elseif

46

#else #warning BYTE_ORDER unexpected or not set

58

This definition doesn't match either the short or long header here...
For the long header, you are missing a uint8_t reserved before the 6-byte sequence, while for the short header, the sequence number would only be 4 byte here...

Its not clear if you want this header structure to be a univeral struct, but even then, mapping to the long header (if the reserved bits get used eventually) seems to be more future-proof.

Maybe point the intent out as a comment?

thj added inline comments.Wed, Aug 7, 12:20 PM
sys/netinet/dccp.h
42

Reply to both comments about the ENDIAN preprocess.

This is the way that ip.h, ip6.h and tcp.h set up bit fields like this. Should we be different in dccp?

58

The intention is to have enough header space to hold either a long or short header. I will add a comment to clarify.

thj updated this revision to Diff 60542.Wed, Aug 7, 1:32 PM

Add comment to explain the seq field is sized to hold either the short or the long sequence number

thj updated this revision to Diff 60548.Wed, Aug 7, 4:43 PM

Extend the sequence number field to include a reserved byte in the long header.

rscheff_gmx.at added inline comments.Wed, Aug 7, 6:30 PM
sys/netinet/dccp.h
46

shouldn't be the checksum field a uint16_t type, instead of a 2-byte array?

thj added inline comments.Thu, Aug 8, 3:25 PM
sys/netinet/dccp.h
46

The opposite was a comment before I split out this change from D16851

"Due to alignment, it seems likely that an extra byte will be added before d_cksum. The easiest way to get around this is to turn this into a 2-byte array (e.g. uint8_t d_cksum[2])."

https://reviews.freebsd.org/D16851#inline-130434