Commit 3e69007
authored
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 #39131 parent e454990 commit 3e69007
2 files changed
+33
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
295 | 303 | | |
296 | 304 | | |
297 | 305 | | |
| |||
304 | 312 | | |
305 | 313 | | |
306 | 314 | | |
307 | | - | |
308 | | - | |
309 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
310 | 323 | | |
311 | | - | |
312 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
313 | 327 | | |
314 | 328 | | |
315 | 329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
116 | 127 | | |
117 | 128 | | |
118 | | - | |
| 129 | + | |
119 | 130 | | |
120 | 131 | | |
121 | 132 | | |
122 | 133 | | |
123 | 134 | | |
| 135 | + | |
0 commit comments