mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
networkd: Permit all-zero RoutingPolicyRule prefixes
For example this `From` address range is no longer ignored:
[RoutingPolicyRule]
From=0.0.0.0/8
This commit is contained in:
committed by
Yu Watanabe
parent
ffd0815171
commit
2e8a32afbc
@@ -14,6 +14,7 @@ OutgoingInterface=test1
|
||||
|
||||
[RoutingPolicyRule]
|
||||
IncomingInterface=test1
|
||||
From=::/0
|
||||
Table=8
|
||||
Priority=100
|
||||
Family=ipv6
|
||||
@@ -23,3 +24,9 @@ IncomingInterface=test1
|
||||
Table=9
|
||||
Priority=101
|
||||
Family=both
|
||||
|
||||
[RoutingPolicyRule]
|
||||
IncomingInterface=test1
|
||||
From=0.0.0.0/8
|
||||
Table=10
|
||||
Priority=102
|
||||
|
||||
@@ -1858,7 +1858,7 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
||||
'routing-policy-rule-reconfigure2.network',
|
||||
]
|
||||
|
||||
routing_policy_rule_tables = ['7', '8', '9', '1011']
|
||||
routing_policy_rule_tables = ['7', '8', '9', '10', '1011']
|
||||
routes = [['blackhole', '202.54.1.2'], ['unreachable', '202.54.1.3'], ['prohibit', '202.54.1.4']]
|
||||
|
||||
def setUp(self):
|
||||
@@ -2108,6 +2108,13 @@ class NetworkdNetworkTests(unittest.TestCase, Utilities):
|
||||
self.assertRegex(output, 'iif test1')
|
||||
self.assertRegex(output, 'lookup 8')
|
||||
|
||||
output = check_output('ip rule list iif test1 priority 102')
|
||||
print(output)
|
||||
self.assertRegex(output, '102:')
|
||||
self.assertRegex(output, 'from 0.0.0.0/8')
|
||||
self.assertRegex(output, 'iif test1')
|
||||
self.assertRegex(output, 'lookup 10')
|
||||
|
||||
def test_routing_policy_rule_issue_11280(self):
|
||||
copy_unit_to_networkd_unit_path('routing-policy-rule-test1.network', '11-dummy.netdev',
|
||||
'routing-policy-rule-dummy98.network', '12-dummy.netdev')
|
||||
|
||||
Reference in New Issue
Block a user