Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra: Fix connected route deletion when multiple entry exists #13340

Merged
merged 1 commit into from
Oct 13, 2023

Conversation

leonshaw
Copy link
Contributor

When multiple interfaces have addresses in the same network, deleting one of them may cause the wrong connected route being deleted. For example:

ip link add veth1 type veth peer veth2
ip link set veth1 up
ip link set veth2 up
ip addr add dev veth1 192.168.0.1/24
ip addr add dev veth2 192.168.0.2/24
ip addr flush dev veth1

Zebra deletes the route of interface veth2 rather than veth1.

Should match nexthop against ere->re_nhe instead of ere->re->nhe.

When multiple interfaces have addresses in the same network, deleting
one of them may cause the wrong connected route being deleted.
For example:

    ip link add veth1 type veth peer veth2
    ip link set veth1 up
    ip link set veth2 up
    ip addr add dev veth1 192.168.0.1/24
    ip addr add dev veth2 192.168.0.2/24
    ip addr flush dev veth1

Zebra deletes the route of interface veth2 rather than veth1.

Should match nexthop against ere->re_nhe instead of ere->re->nhe.

Signed-off-by: Xiao Liang <[email protected]>
@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Apr 20, 2023

Continuous Integration Result: SUCCESSFUL

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-10994/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@ton31337
Copy link
Member

@Mergifyio backport stable/8.5 stable/8.4

@mergify
Copy link

mergify bot commented Apr 20, 2023

backport stable/8.5 stable/8.4

✅ Backports have been created

Copy link
Contributor

@mjstapp mjstapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

were both of these changes required to fix the issue, or was it just the second assignment, inside the 'if' clause ?

@leonshaw
Copy link
Contributor Author

were both of these changes required to fix the issue, or was it just the second assignment, inside the 'if' clause ?

The nexthop to be deleted is stored in ere->re_nhe in rib_delete(), so need both.

frr/zebra/zebra_rib.c

Lines 4295 to 4308 in e2bebeb

if (nh) {
nhe = zebra_nhg_alloc();
nhe->nhg.nexthop = nexthop_dup(nh, NULL);
}
ere = XCALLOC(MTYPE_WQ_WRAPPER, sizeof(*ere));
ere->afi = afi;
ere->safi = safi;
ere->p = *p;
if (src_p)
ere->src_p = *src_p;
ere->src_p_provided = !!src_p;
ere->re = re;
ere->re_nhe = nhe;

@donaldsharp donaldsharp self-requested a review May 2, 2023 15:35
@mwinter-osr
Copy link
Member

CI:rerun Rerunning as the last execution is several months back

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Sep 25, 2023

Continuous Integration Result: FAILED

Continuous Integration Result: FAILED

See below for issues.
CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-14329/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Get source / Pull Request: Successful

Building Stage: Successful

Basic Tests: Failed

Topotests Ubuntu 18.04 arm8 part 9: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 9: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-14329/artifact/TOPO9U18ARM8/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 9: No useful log found
Topotests Ubuntu 18.04 arm8 part 3: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 3: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-14329/artifact/TOPO3U18ARM8/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 3: No useful log found
Topotests Ubuntu 18.04 arm8 part 1: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 1: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-14329/artifact/TOPO1U18ARM8/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 1: No useful log found
Topotests Ubuntu 18.04 arm8 part 8: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 8: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-14329/artifact/TOPO8U18AMD64/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 8: No useful log found
Topotests Ubuntu 18.04 arm8 part 6: Failed (click for details) Topotests Ubuntu 18.04 arm8 part 6: Unknown Log URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-14329/artifact/TOPO6U18ARM8/TopotestDetails/ Topotests Ubuntu 18.04 arm8 part 6: No useful log found
Successful on other platforms/tests
  • Topotests Ubuntu 18.04 amd64 part 2
  • Addresssanitizer topotests part 5
  • Topotests Ubuntu 18.04 i386 part 3
  • Topotests Ubuntu 18.04 i386 part 8
  • Topotests debian 10 amd64 part 8
  • Addresssanitizer topotests part 0
  • Topotests Ubuntu 18.04 arm8 part 4
  • Topotests debian 10 amd64 part 4
  • Topotests debian 10 amd64 part 9
  • Addresssanitizer topotests part 4
  • Topotests debian 10 amd64 part 3
  • Addresssanitizer topotests part 1
  • Topotests Ubuntu 18.04 i386 part 4
  • Topotests Ubuntu 18.04 amd64 part 8
  • Topotests Ubuntu 18.04 arm8 part 7
  • Addresssanitizer topotests part 9
  • Topotests Ubuntu 18.04 arm8 part 0
  • Static analyzer (clang)
  • Topotests debian 10 amd64 part 0
  • Topotests debian 10 amd64 part 2
  • Topotests Ubuntu 18.04 arm8 part 2
  • Topotests Ubuntu 18.04 amd64 part 9
  • Debian 10 deb pkg check
  • Topotests Ubuntu 18.04 i386 part 1
  • Addresssanitizer topotests part 7
  • Topotests Ubuntu 18.04 amd64 part 5
  • Topotests Ubuntu 18.04 i386 part 6
  • Topotests Ubuntu 18.04 arm8 part 5
  • Ubuntu 20.04 deb pkg check
  • Topotests debian 10 amd64 part 1
  • Topotests debian 10 amd64 part 6
  • Topotests Ubuntu 18.04 amd64 part 7
  • Topotests Ubuntu 18.04 i386 part 5
  • Topotests Ubuntu 18.04 i386 part 0
  • Addresssanitizer topotests part 3
  • Topotests Ubuntu 18.04 amd64 part 4
  • CentOS 7 rpm pkg check
  • Addresssanitizer topotests part 2
  • Topotests Ubuntu 18.04 amd64 part 0
  • Topotests Ubuntu 18.04 i386 part 9
  • Topotests Ubuntu 18.04 amd64 part 3
  • Topotests debian 10 amd64 part 7
  • Topotests debian 10 amd64 part 5
  • Debian 9 deb pkg check
  • Addresssanitizer topotests part 8
  • Topotests Ubuntu 18.04 i386 part 7
  • Topotests Ubuntu 18.04 amd64 part 6
  • Topotests Ubuntu 18.04 i386 part 2
  • Topotests Ubuntu 18.04 amd64 part 1
  • Addresssanitizer topotests part 6
  • Ubuntu 18.04 deb pkg check

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-PULLREQ2-14329/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

href added a commit to cloudscale-ch/frr that referenced this pull request Oct 12, 2023
OSPF on IPv4/IPv6 removes the wrong routes in certain cases, causing
issues when removing and re-enabling interfaces. This test proofs that.

These tests all pass with FRRouting#13340
and the latest master (d2324b7).

See FRRouting#14488
href added a commit to cloudscale-ch/frr that referenced this pull request Oct 12, 2023
OSPF on IPv4/IPv6 removes the wrong routes in certain cases, causing
issues when removing and re-enabling interfaces. This test proofs that.

These tests all pass with FRRouting#13340
and the latest master (d2324b7).

See FRRouting#14488
href added a commit to cloudscale-ch/frr that referenced this pull request Oct 12, 2023
OSPF on IPv4/IPv6 removes the wrong routes in certain cases, causing
issues when removing and re-enabling interfaces. This test proofs that.

These tests all pass with FRRouting#13340
and the latest master (d2324b7).

See FRRouting#14488

Signed-off-by: Denis Krienbühl <[email protected]>
@donaldsharp donaldsharp merged commit 4f7dc77 into FRRouting:master Oct 13, 2023
@donaldsharp
Copy link
Member

@Mergifyio backport stable/9.0 dev/9.1

@mergify
Copy link

mergify bot commented Oct 13, 2023

backport stable/9.0 dev/9.1

✅ Backports have been created

href added a commit to cloudscale-ch/frr that referenced this pull request Oct 13, 2023
OSPF on IPv4/IPv6 removes the wrong routes in certain cases, causing
issues when removing and re-enabling interfaces. This test proofs that.

These tests all pass with FRRouting#13340
and the latest master (d2324b7).

See FRRouting#14488

Signed-off-by: Denis Krienbühl <[email protected]>
donaldsharp added a commit that referenced this pull request Oct 13, 2023
zebra: Fix connected route deletion when multiple entry exists (backport #13340)
donaldsharp added a commit that referenced this pull request Oct 13, 2023
zebra: Fix connected route deletion when multiple entry exists (backport #13340)
donaldsharp added a commit that referenced this pull request Oct 13, 2023
zebra: Fix connected route deletion when multiple entry exists (backport #13340)
donaldsharp added a commit that referenced this pull request Oct 13, 2023
zebra: Fix connected route deletion when multiple entry exists (backport #13340)
mergify bot pushed a commit that referenced this pull request Oct 15, 2023
OSPF on IPv4/IPv6 removes the wrong routes in certain cases, causing
issues when removing and re-enabling interfaces. This test proofs that.

These tests all pass with #13340
and the latest master (d2324b7).

See #14488

Signed-off-by: Denis Krienbühl <[email protected]>
(cherry picked from commit 616e1fa)
@leonshaw leonshaw deleted the fix/rib-del-connected branch October 16, 2023 02:26
donaldsharp pushed a commit to donaldsharp/frr that referenced this pull request Mar 20, 2024
OSPF on IPv4/IPv6 removes the wrong routes in certain cases, causing
issues when removing and re-enabling interfaces. This test proofs that.

These tests all pass with FRRouting#13340
and the latest master (d2324b7).

See FRRouting#14488
Ticket: #3684268
Signed-off-by: Denis Krienbühl <[email protected]>
(cherry picked from commit 616e1fa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants