Skip to content

ipv4: First steps toward removing RTO_ONLINK

Guillaume Nault dccp netdev 1 version Applied

Status from this message: This series was applied to netdev/net-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 8 repliesApplied 3/3

Patches in v1 All 3 applied

#Subject and filesSizeRepliesApplied
1/3ipv4: Don't reset ->flowi4_scope in ip_rt_fix_tos().net/ipv4/route.c+2 -24 repliesApplied
2/3ipv4: Avoid using RTO_ONLINK with ip_route_connect().include/net/route.h net/dccp/ipv4.c net/ipv4/af_inet.c +2 more+34 -251 replyApplied
3/3ipv4: Initialise ->flowi4_scope properly in ICMP handlers.net/ipv4/route.c+17 -201 replyApplied

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchDavid Ahern
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 0/3] ipv4: First steps toward removing RTO_ONLINK

RTO_ONLINK is a flag that allows to reduce the scope of route lookups. It's stored in a normally unused bit of the ->flowi4_tos field, in struct flowi4. However it has several problems:

* This bit is also used by ECN. Although ECN bits are supposed to be cleared before doing a route lookup, it happened that some code paths didn't properly sanitise their ->flowi4_tos. So this mechanism is fragile and we had bugs in the past where ECN bits slipped in and could end up being erroneously interpreted as RTO_ONLINK.

* A dscp_t type was recently introduced to ensure ECN bits are cleared during route lookups. ->flowi4_tos is the most important structure field to convert, but RTO_ONLINK prevents such conversion, as dscp_t mandates that ECN bits (where RTO_ONLINK is stored) be zero.

Therefore we need to stop using RTO_ONLINK altogether. Fortunately RTO_ONLINK isn't a necessity. Instead of passing a flag in ->flowi4_tos to tell the route lookup function to restrict the scope, we can simply initialise the scope correctly.

Patch 1 does some preparatory work: it stops resetting ->flowi4_scope automatically before a route lookup, thus allowing callers to set their desired scope without having to rely on the RTO_ONLINK flag.

Patch 2-3 convert a few code paths to avoid relying on RTO_ONLINK.

More conversions will have to take place before we can eventually remove this flag.

Guillaume Nault (3):
ipv4: Don't reset ->flowi4_scope in ip_rt_fix_tos().
ipv4: Avoid using RTO_ONLINK with ip_route_connect().
ipv4: Initialise ->flowi4_scope properly in ICMP handlers.

 include/net/route.h | 36 ++++++++++++++++++++++++------------
 net/dccp/ipv4.c     |  5 ++---
 net/ipv4/af_inet.c  |  6 +++---
 net/ipv4/datagram.c |  7 +++----
 net/ipv4/route.c    | 41 +++++++++++++++++++----------------------
 net/ipv4/tcp_ipv4.c |  5 ++---
 6 files changed, 53 insertions(+), 47 deletions(-)
Signature · 1 line
2.21.3