Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2044793

Summary: nmstate-rust cannot convert route by submask
Product: Red Hat Enterprise Linux 8 Reporter: Mingyu Shi <mshi>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED ERRATA QA Contact: Mingyu Shi <mshi>
Severity: low Docs Contact:
Priority: low    
Version: 8.6CC: ferferna, jiji, jishi, network-qe, sfaye, till
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nmstate-1.3.1-1.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-08 09:17:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mingyu Shi 2022-01-25 08:30:39 UTC
Description of problem:
Compared with nmstate python, nmstate-rust cannot convert route by submask automatically

Version-Release number of selected component (if applicable):
nmstate-1.2.1-0.1.alpha1.el8.x86_64
nispor-1.2.3-1.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
nmstatectl-rust apply << EOF > route.yaml
interfaces:
  - name: dummy0
    type: dummy
    state: up
    ipv4:
      address:
        - ip: 192.0.1.100
          prefix-length: 24
      enabled: true
routes:
  config:
    - destination: 192.168.199.200/24
      metric: 150
      next-hop-address: 192.0.1.100
      next-hop-interface: dummy0
EOF

Actual results:
[2022-01-25T08:29:17Z ERROR nmstate::route] VerificationError: Desired route RouteEntry { state: None, destination: Some("192.168.199.200/24"), next_hop_iface: Some("dummy0"), next_hop_addr: Some("192.0.1.100"), metric: Some(150), table_id: None } not found after apply
[2022-01-25T08:29:18Z ERROR nmstate::route] VerificationError: Desired route RouteEntry { state: None, destination: Some("192.168.199.200/24"), next_hop_iface: Some("dummy0"), next_hop_addr: Some("192.0.1.100"), metric: Some(150), table_id: None } not found after apply
[2022-01-25T08:29:19Z ERROR nmstate::route] VerificationError: Desired route RouteEntry { state: None, destination: Some("192.168.199.200/24"), next_hop_iface: Some("dummy0"), next_hop_addr: Some("192.0.1.100"), metric: Some(150), table_id: None } not found after apply
[2022-01-25T08:29:20Z ERROR nmstate::route] VerificationError: Desired route RouteEntry { state: None, destination: Some("192.168.199.200/24"), next_hop_iface: Some("dummy0"), next_hop_addr: Some("192.0.1.100"), metric: Some(150), table_id: None } not found after apply
[2022-01-25T08:29:21Z ERROR nmstate::route] VerificationError: Desired route RouteEntry { state: None, destination: Some("192.168.199.200/24"), next_hop_iface: Some("dummy0"), next_hop_addr: Some("192.0.1.100"), metric: Some(150), table_id: None } not found after apply
NmstateError: VerificationError: Desired route RouteEntry { state: None, destination: Some("192.168.199.200/24"), next_hop_iface: Some("dummy0"), next_hop_addr: Some("192.0.1.100"), metric: Some(150), table_id: None } not found after apply

Expected results:
No failure
While nmstate python can automatically convert 192.168.199.200/24 to 192.168.199.0/24

Additional info:

Comment 1 Mingyu Shi 2022-01-25 11:31:42 UTC
Similarly, when configuring route rules, nmstate python converts but nmstate-rust not.
It is not blocked and actually works as the same in kernel, the only difference is the output:

After applying these route rules:
route-rules:
  config:
  - ip-to: 192.0.2.0/24
    priority: 1000
    route-table: 50
  - ip-from: 192.0.2.1/24
    priority: 1001
    route-table: 50
  - ip-to: 198.51.100.99/24
    priority: 1002
    route-table: 51
  - ip-from: 198.51.100.255/24
    priority: 1003
    route-table: 51
  - ip-to: 192.0.2.0/24
    ip-from: 192.0.2.1/24
    priority: 20000
    route-table: 50
  - ip-to: 100::/64
    priority: 20000
    route-table: 50
    ip-from: 100::/64

Here's the result of `ip rule` command: 
left python, right rust
# diff -y viapy viarust
0:      from all lookup local                                   0:      from all lookup local
1000:   from all to 192.0.2.0/24 lookup 50                      1000:   from all to 192.0.2.0/24 lookup 50
1001:   from 192.0.2.0/24 lookup 50                           | 1001:   from 192.0.2.1/24 lookup 50
1002:   from all to 198.51.100.0/24 lookup 51                 | 1002:   from all to 198.51.100.99/24 lookup 51
1003:   from 198.51.100.0/24 lookup 51                        | 1003:   from 198.51.100.255/24 lookup 51
20000:  from 192.0.2.0/24 to 192.0.2.0/24 lookup 50           | 20000:  from 192.0.2.1/24 to 192.0.2.0/24 lookup 50
32766:  from all lookup main                                    32766:  from all lookup main
32767:  from all lookup default                                 32767:  from all lookup default

Comment 4 Mingyu Shi 2022-08-09 09:47:58 UTC
Verified with:
nmstate-1.3.2-1.el8.x86_64
nispor-1.2.7-1.el8.x86_64
NetworkManager-1.39.12-1.el8.x86_64

Comment 6 errata-xmlrpc 2022-11-08 09:17:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (nmstate bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:7465