In linux IP rule the pref and priority are interchangeable, use priority every time.

Bug #1869139 reported by jacy lee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Invalid
Undecided
Unassigned

Bug Description

In IP rule the pref and priority are interchangeable.When using pref as input, the returned result is priority, which is not standard, so need to convert pref to priority every time.

* Version:
  ** OpenStack version(rocky)

jacy lee (jacylees)
Changed in neutron:
assignee: nobody → jacy lee (jacylees)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/715131

Revision history for this message
Lajos Katona (lajos-katona) wrote :

Is this valid for master as well?

Revision history for this message
jacy lee (jacylees) wrote :

The problem only appeared before the rocky version. Since stein, the function add_ip_rule(namespace, ip, iif=None, table=None, priority=None, to=None) has specified priority as a parameter.

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello:

Since Stein the pyroute2 implementation only accepts a defined set of arguments.

@jacy, where "pref" is used as input in any IP rule command?

When you are listing the IP rules, you already have a priority parameter [1] that is shown in the rule dict [2].

Why do we need an alias for "priority"?

Regards.

[1] https://github.com/openstack/neutron/blob/stable/rocky/neutron/agent/linux/ip_lib.py#L469
[2] https://github.com/openstack/neutron/blob/stable/rocky/neutron/tests/functional/agent/linux/test_ip_lib.py#L131

Revision history for this message
jacy lee (jacylees) wrote :

Hello:
Run cmd 'ip rule help', the show result of the priority parameter is "pref". So it is possible to use pref as a parameter. When use pref as the parameter to call rule.add() [1], I can create two same priority rules. Because the list_rules() return key is "priority" while I used "pref", the _exists() always return false.[2]

In my own development, when I used "pref" to call this function, I found this problem. It is only a small problem and has little effect.

[1] https://github.com/openstack/neutron/blob/stable/rocky/neutron/agent/linux/ip_lib.py#L488
[2] https://github.com/openstack/neutron/blob/stable/rocky/neutron/agent/linux/ip_lib.py#L480

Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :
jacy lee (jacylees)
Changed in neutron:
status: New → Invalid
Revision history for this message
Slawek Kaplonski (slaweq) wrote : auto-abandon-script

This bug has had a related patch abandoned and has been automatically un-assigned due to inactivity. Please re-assign yourself if you are continuing work or adjust the state as appropriate if it is no longer valid.

Changed in neutron:
assignee: jacy lee (jacylees) → nobody
tags: added: timeout-abandon
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (stable/rocky)

Change abandoned by Slawek Kaplonski (<email address hidden>) on branch: stable/rocky
Review: https://review.opendev.org/715131
Reason: This review is > 4 weeks without comment, and failed Zuul jobs the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.