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

Allow passing args up to GenericNetlinkSocket constructor #1113

Merged
merged 1 commit into from
Jul 24, 2023

Conversation

kleinweby
Copy link
Contributor

Currently, most subclasses of GenericNetlinkSocket do not pass unused args up to GenericNetlinkSocket.init.

One use case of this is to pass fileno= with an existing file descriptor that was opened in another process/network namespace.

This patch fixes the following subclasses

  • EventSocket
  • NL80211
  • DevlinkSocket
  • L2tp
  • WireGuard

by passing up *args and **kwargs.

We also fix TaskStats by simply removing the init method that just calls super.

We did not need to fix MPTCP and NlEthtool as they don't overwrite init.

Currently, most subclasses of GenericNetlinkSocket do not pass unused
args up to GenericNetlinkSocket.__init__.

One use case of this is to pass fileno= with an existing file descriptor
that was opened in another process/network namespace.

This patch fixes the following subclasses

  - EventSocket
  - NL80211
  - DevlinkSocket
  - L2tp
  - WireGuard

by passing up *args and **kwargs.

We also fix TaskStats by simply removing the __init__ method that just
calls super.

We did not need to fix MPTCP and NlEthtool as they don't overwrite
__init__.
@svinota svinota merged commit 05adb3b into svinota:master Jul 24, 2023
14 checks passed
@svinota
Copy link
Owner

svinota commented Jul 24, 2023

Thanks a lot!

@kleinweby kleinweby deleted the pass-gennl-init-args branch July 24, 2023 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants