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: Always receive RS #15613

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

zebra: Always receive RS #15613

wants to merge 1 commit into from

Conversation

hengwu0
Copy link

@hengwu0 hengwu0 commented Mar 25, 2024

zebra: The socket is listening on ND_ROUTER_SOLICIT of icmpv6, but won't recv it when RA is disabled. It will let packets accumulate in kernel. We should always receive RS packets regardless of whether RA is disabled.
fix: #15303, #15365

@frrbot frrbot bot added the zebra label Mar 25, 2024
@hengwu0 hengwu0 changed the title zebra: Always listen and receive RS zebra: Always receive RS Mar 25, 2024
@hengwu0 hengwu0 force-pushed the master branch 3 times, most recently from 1bf0d59 to 8c5e6ff Compare March 25, 2024 15:04
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.

I'm not sure this is the right approach. It seems to me that either a) we should stop unconditionally opening the per-vrf socket, or b) once opened, we should be willing to read it, and just drain the messages if they won't be used (because of configuration).

zebra/rtadv.c Outdated
}
}

/* Always receive RS, no matter RA is disabled or not */
rtadv_start_interface_events(zvrf, zif);
Copy link
Contributor

Choose a reason for hiding this comment

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

This function does several things - not just reading a socket. I don't think this wants to be unconditionally enabled.

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@hengwu0
Copy link
Author

hengwu0 commented Mar 26, 2024

I'm not sure this is the right approach. It seems to me that either a) we should stop unconditionally opening the per-vrf socket, or b) once opened, we should be willing to read it, and just drain the messages if they won't be used (because of configuration).

I confirm that this error occurred in this environment:

  1. Open OS IPv6 forwarding capability;
  2. Ceasing all interfaces to be an advertising interface(set the AdvSendAdvertisements flag to FALSE)
[root@localhost ~]# cat /etc/frr/zebra.conf
!configuration by zddi!
hostname zebra
password zebra
log file /disk_extend/var_log/frr_log/zebra.log
!
interface eth0
 ip address 10.2.48.140/22
 ipv6 nd suppress-ra
!
interface lo
!
line vty

All RS(Router Solicitation) packets will blocked in zebra's recv-q. It will be used more than 2GiB memory in my testing, although kernel's default rmem size is 67108864. The kernel's alloc_pages won't be caculated in /proc/meminfo, but we can see the used value in free command released almost 2G after zebra being stoped with recv-q buffer full.

@hengwu0
Copy link
Author

hengwu0 commented Mar 26, 2024

I'm not sure this is the right approach. It seems to me that either a) we should stop unconditionally opening the per-vrf socket, or b) once opened, we should be willing to read it, and just drain the messages if they won't be used (because of configuration).

we also can set the recv-buffer of per-vrf socket to the 2097152. The value which can be acceptable to mem leak.

zebra: The socket is listening on ND_ROUTER_SOLICIT of icmpv6, but won't
recv it when RA is disabled. It will let packets accumulate in kernel.
We should always receive RS packets regardless of whether RA is disabled.

Signed-off-by: hengwu0 <[email protected]>
@hengwu0
Copy link
Author

hengwu0 commented Apr 9, 2024

This PR is very important, if we only use BGP with ipv6-forward enabled. Since there will no configure in zebra.conf about RS/RA. All RS(Router Solicitation) packets will be blocked in zebra's recv-q by default.

@mjstapp
Copy link
Contributor

mjstapp commented Apr 9, 2024

hmm, well, I made a couple of suggestions, and then you also offered a suggestion. but the code in the PR still has the problem that I commented about. if the PR is important to you, then please ... fix it?

This PR is very important, if we only use BGP with ipv6-forward enabled. Since there will no configure in zebra.conf about RS/RA. All RS(Router Solicitation) packets will be blocked in zebra's recv-q by default.

Copy link

github-actions bot commented Oct 7, 2024

This PR is stale because it has been open 180 days with no activity. Comment or remove the autoclose label in order to avoid having this PR closed.

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.

zebra: netstat Recv-Q value is continue keep going up.
2 participants