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: ignore IFF_PROMISC message #16959

Closed
wants to merge 1 commit into from

Conversation

lsang6WIND
Copy link

Ignore netlink NEW_LINK message when the change is only IFF_PROMISC. This will avoid route updates when the interface enter/left promiscuous mode.

Ignore netlink NEW_LINK message when the change is only IFF_PROMISC.
This will avoid route updates when the interface enter/left promiscuous
mode.

Signed-off-by: Loïc Sang <loic.sang@6wind.com>
@donaldsharp
Copy link
Member

I thought we went through this before. What guarantee do we have that only a promiscuous mode change is only that and nothing else on the interface?

@lsang6WIND
Copy link
Author

I thought we went through this before. What guarantee do we have that only a promiscuous mode change is only that and nothing else on the interface?

Despite the Linux documentation on struct ifinfomsg:
if_flags contains the state of interface flags.
if_change indicate the state change (flag change(s)).

so if if_change have only the IFF_PROMISC bit set, we should have only interface enter/left promiscuous mode change.

However, this part is not mentionned by https://man7.org/linux/man-pages/man7/rtnetlink.7.html

@@ -1489,6 +1489,14 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup)
return 0;
}

if (ifi->ifi_change == IFF_PROMISC) {
Copy link
Contributor

Choose a reason for hiding this comment

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

even if this identifies the changed flags accurately, what about other changes to other interface attributes? I don't see how we can bail out at this point in the processing.

@mjstapp
Copy link
Contributor

mjstapp commented Oct 1, 2024

so in addition to the other comment I made, frankly: has someone done a survey of kernels, and identified the kernel versions where this statement is correct? is it always correct, for every kernel everywhere in use? if not, how will you adapt to the differences?

Despite the Linux documentation on struct ifinfomsg: if_flags contains the state of interface flags. if_change indicate the state change (flag change(s)).

so if if_change have only the IFF_PROMISC bit set, we should have only interface enter/left promiscuous mode change.

However, this part is not mentionned by https://man7.org/linux/man-pages/man7/rtnetlink.7.html

@lsang6WIND
Copy link
Author

OK, close it.

@lsang6WIND lsang6WIND closed this Oct 1, 2024
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.

3 participants