Commit b5d9c9c2 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

inet: add rfc 3168 extract in front of INET_ECN_encapsulate()

INET_ECN_encapsulate() is better understood if we can read the official
statement.
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2c67e9ac
...@@ -30,6 +30,14 @@ static inline int INET_ECN_is_capable(__u8 dsfield) ...@@ -30,6 +30,14 @@ static inline int INET_ECN_is_capable(__u8 dsfield)
return dsfield & INET_ECN_ECT_0; return dsfield & INET_ECN_ECT_0;
} }
/*
* RFC 3168 9.1.1
* The full-functionality option for ECN encapsulation is to copy the
* ECN codepoint of the inside header to the outside header on
* encapsulation if the inside header is not-ECT or ECT, and to set the
* ECN codepoint of the outside header to ECT(0) if the ECN codepoint of
* the inside header is CE.
*/
static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
{ {
outer &= ~INET_ECN_MASK; outer &= ~INET_ECN_MASK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment