Commit c26bc92
committed
Fix ipv4 options parsing and bit numbering
RFC 5102 and its Errata[1] several times messed with a bit numbering.
"Options are mapped to bits according to their option numbers.
Option number X is mapped to bit X."
But actually it's in inverted order.
"A misunderstand arose as to whether bits were assigned in host order
or network order - so clarify that the bits are assigned from the
least significant to the most significant, ie right-to-left rather
than left-to-right."
That's about bit numbering in diagram. So final correct options mask is (from
Errata 2944):
0 1 2 3 4 5 6 7
+------+------+------+------+------+------+------+------+
| | EXP | to be assigned by IANA | QS | UMP | ...
+------+------+------+------+------+------+------+------+
8 9 10 11 12 13 14 15
+------+------+------+------+------+------+------+------+
... | DPS |NSAPA | SDB |RTRALT|ADDEXT| TR | EIP |IMITD | ...
+------+------+------+------+------+------+------+------+
16 17 18 19 20 21 22 23
+------+------+------+------+------+------+------+------+
... |ENCODE| VISA | FINN | MTUR | MTUP | ZSU | SSR | SID | ...
+------+------+------+------+------+------+------+------+
24 25 26 27 28 29 30 31
+------+------+------+------+------+------+------+------+
... | RR |CIPSO |E-SEC | TS | LSR | SEC | NOP | EOOL |
+------+------+------+------+------+------+------+------+
Link: https://www.rfc-editor.org/errata/rfc5102
Fixes: f631ed5 ("IPv6 support, and IP options support for v9/IPFIX.")
Signed-off-by: ABC <abc@openwall.com>1 parent 0561c72 commit c26bc92
1 file changed
+17
-47
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4769 | 4769 | | |
4770 | 4770 | | |
4771 | 4771 | | |
4772 | | - | |
4773 | | - | |
4774 | | - | |
4775 | | - | |
4776 | | - | |
4777 | | - | |
4778 | | - | |
4779 | | - | |
4780 | | - | |
4781 | | - | |
4782 | | - | |
4783 | | - | |
4784 | | - | |
4785 | | - | |
4786 | | - | |
4787 | | - | |
4788 | | - | |
4789 | | - | |
4790 | | - | |
4791 | | - | |
4792 | | - | |
4793 | | - | |
4794 | | - | |
4795 | | - | |
4796 | | - | |
4797 | | - | |
4798 | | - | |
4799 | | - | |
4800 | | - | |
4801 | | - | |
4802 | | - | |
4803 | | - | |
4804 | | - | |
| 4772 | + | |
4805 | 4773 | | |
4806 | 4774 | | |
4807 | 4775 | | |
| |||
4810 | 4778 | | |
4811 | 4779 | | |
4812 | 4780 | | |
4813 | | - | |
4814 | | - | |
4815 | | - | |
4816 | | - | |
4817 | | - | |
4818 | | - | |
4819 | | - | |
4820 | | - | |
4821 | | - | |
4822 | | - | |
4823 | | - | |
4824 | | - | |
4825 | | - | |
4826 | | - | |
| 4781 | + | |
| 4782 | + | |
| 4783 | + | |
| 4784 | + | |
| 4785 | + | |
| 4786 | + | |
| 4787 | + | |
| 4788 | + | |
| 4789 | + | |
| 4790 | + | |
| 4791 | + | |
| 4792 | + | |
| 4793 | + | |
| 4794 | + | |
| 4795 | + | |
| 4796 | + | |
4827 | 4797 | | |
4828 | 4798 | | |
4829 | 4799 | | |
| |||
0 commit comments