Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PPP: fix default size of protocol field (#4106)
In commit 2f5d9bd ("PPP: protocol field can be limited to one byte"), a new class PPP_ was added to manage parsing and generation a PPP header with a one byte PPP protocol field. This was later reworked by commit 834309f ("Small doc cleanups"), which removed the PPP_ class, and changed the default behavior of the PPP class to generate a one byte protocol field by default, when its value was lower than 0x100. The RFC states that "by default, all implementations MUST transmit packets with two octet PPP Protocol fields". A header with a one byte protocol field is issued by implementations when the compression is negociated. This patch reverts to the original behavior, which is to generate a two bytes protocol field by default, but make it possible to explicitly generate a one byte protocol by passing the value as bytes(). The PPP class is still able to parse either a one or two bytes protocol. Link: https://www.rfc-editor.org/rfc/rfc1661.html#section-6.5 Fixes #3913
- Loading branch information