Commit 27cc274
committed
northd: Use lower priority for all src routes.
The current implementation prefers dst routes over src routes only if
they have the same prefix length. This is not very useful for real world
use cases, because it doesn't make much sense to compare the prefix
length between different fields of the IP header (dst IP v.s. src IP).
The prefix length should make sense only when comparing for the same
field, either dst or src.
This patch changes the behavior by always prefering dst routes over src
routes, regardless of the prefix length, and comparing prefix length
only within the same type of routes.
E.g., there are two routes:
10.0.0.0/8 nexthop A dst-ip
192.168.11.0/24 nexthop B src-ip
For a packet 192.168.11.123 -> 10.1.2.3:
Before: nexthop will be B
After: nexthop will be A
Reported-by: Girish Moodalbail <gmoodalbail@gmail.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2020-May/050049.html
Signed-off-by: Han Zhou <hzhou@ovn.org>
Acked-by: Dumitru Ceara <dceara@redhat.com>1 parent 93fc05d commit 27cc274
4 files changed
Lines changed: 129 additions & 122 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
347 | 348 | | |
348 | 349 | | |
349 | 350 | | |
| |||
11832 | 11833 | | |
11833 | 11834 | | |
11834 | 11835 | | |
| 11836 | + | |
11835 | 11837 | | |
11836 | 11838 | | |
11837 | 11839 | | |
| |||
11840 | 11842 | | |
11841 | 11843 | | |
11842 | 11844 | | |
| 11845 | + | |
| 11846 | + | |
| 11847 | + | |
11843 | 11848 | | |
11844 | 11849 | | |
11845 | 11850 | | |
| |||
11853 | 11858 | | |
11854 | 11859 | | |
11855 | 11860 | | |
11856 | | - | |
| 11861 | + | |
11857 | 11862 | | |
11858 | 11863 | | |
11859 | 11864 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4325 | 4325 | | |
4326 | 4326 | | |
4327 | 4327 | | |
4328 | | - | |
4329 | | - | |
4330 | | - | |
| 4328 | + | |
| 4329 | + | |
| 4330 | + | |
4331 | 4331 | | |
4332 | 4332 | | |
4333 | 4333 | | |
| |||
0 commit comments