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

Netlink and code duplication #172

Open
pktpls opened this issue Sep 12, 2023 · 1 comment
Open

Netlink and code duplication #172

pktpls opened this issue Sep 12, 2023 · 1 comment

Comments

@pktpls
Copy link
Contributor

pktpls commented Sep 12, 2023

I'm working on netlink impls for Wireguard and L2TP, my crappy ucode-mod-wireguard is already working. I based it off nl80211, deleted much and added some: https://github.com/freifunk-berlin/falter-packages/blob/master/packages/ucode-mod-wireguard/src/wireguard.c

I noticed that there's a lot of duplicated netlink boilerplate code and I'm only adding more to the pile.

My thoughts are it would be good to share some of that between modules, or alternatively expose the lower-level netlink plumbing to ucode userspace and implement things like nl80211, wireguard, l2tp in ucode.

What are your thoughts? I'm pushing ahead for now, but I'm open for anything and will adapt the wireguard/l2tp modules accordingly.

@jow-
Copy link
Owner

jow- commented Oct 9, 2023

For now I tend towards living with the code duplication since factoring out the shared bits into a shared library would complicate things. Maybe the boilerplate parts can be extracted into some kind of header-only library which will be shipped alongside the other ucode headers and which can be included by those modules that need it.

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

No branches or pull requests

2 participants