DVR code can add duplicate routing rules

Bug #1398865 reported by Brian Haley
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Brian Haley

Bug Description

The IPRule code in ip_lib.py doesn't check if a rule already exists, so it could add a duplicate on agent restart. For example:

$ sudo ip netns exec qrouter-46460e86-ef11-46fb-8d27-da94435dfcc9 ip rule show
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
167772161: from 10.0.0.1/24 lookup 167772161
167772161: from 10.0.0.1/24 lookup 167772161

It should check first and not add anything if one is already there as there is no 'replace' option like the routing table has (which will either update or add).

DVR is currently the only consumer of this code.

Changed in neutron:
assignee: nobody → Brian Haley (brian-haley)
Revision history for this message
huangyunpeng (huangyunpeng) wrote :

the input routes info is dict , it can be do same params check in neutron-server , I have did some fix in this bug , make the same routes info unacceptable in db.

Changed in neutron:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/152330

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/152330
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=faa9a6fb46f1c32ae7cf79dab55501c585eda7aa
Submitter: Jenkins
Branch: master

commit faa9a6fb46f1c32ae7cf79dab55501c585eda7aa
Author: Brian Haley <email address hidden>
Date: Fri Jan 30 13:22:17 2015 -0500

    Check if routing rule exists before adding

    Since there is no equivalent to 'ip route replace...' with
    'ip rule...', we need to check the existence first before
    adding, as otherwise we'll end up with multiple identical
    routing rules.

    Change-Id: I8f1f2424dd854fad8a72478463fa8fadd6a5c168
    Closes-Bug: #1398865

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-3 → 2015.1.0
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.