]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: fib: Fix metrics match when deleting a route
authorPhil Sutter <phil@nwl.cc>
Tue, 19 Dec 2017 14:17:13 +0000 (15:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Dec 2017 19:21:58 +0000 (14:21 -0500)
commitcd8540af2c444486773c7884d6d93888ae006f6f
treeeaa1ffaece732cdebe08a879d8f86f5d34d136b3
parent88cea458041f8de246b59a0fdb06f7f2018520f9
ipv4: fib: Fix metrics match when deleting a route

The recently added fib_metrics_match() causes a regression for routes
with both RTAX_FEATURES and RTAX_CC_ALGO if the latter has
TCP_CONG_NEEDS_ECN flag set:

| # ip link add d0 type dummy
| # ip link set d0 up
| # ip route add 172.29.29.0/24 dev d0 features ecn congctl dctcp
| # ip route del 172.29.29.0/24 dev d0 features ecn congctl dctcp
| RTNETLINK answers: No such process

During route insertion, fib_convert_metrics() detects that the given CC
algo requires ECN and hence sets DST_FEATURE_ECN_CA bit in
RTAX_FEATURES.

During route deletion though, fib_metrics_match() compares stored
RTAX_FEATURES value with that from userspace (which obviously has no
knowledge about DST_FEATURE_ECN_CA) and fails.

Fixes: d0e08e34fcac4 ("ipv4: do metrics match when looking up and deleting a route")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_semantics.c