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

Move common firewall rules to respective packages #2553

Merged
merged 8 commits into from
Aug 9, 2022

Conversation

mkg20001
Copy link
Member

No description provided.

@github-actions github-actions bot added 3. topic: babel Topic: Babel Layer 3 Routing 3. topic: firewall 3. topic: package Topic: Gluon Packages labels Jun 16, 2022
@mkg20001 mkg20001 changed the title Move mmfd rules to mmfd package Move common firewall rules to respective package Jun 17, 2022
@mkg20001 mkg20001 changed the title Move common firewall rules to respective package Move common firewall rules to respective packages Jun 17, 2022
@mkg20001 mkg20001 force-pushed the mmfd branch 2 times, most recently from 363908b to 5191d0e Compare June 17, 2022 08:12
Copy link
Contributor

@T-X T-X left a comment

Choose a reason for hiding this comment

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

I tested this and checked the babel startup. There is a regression though, babel won't start anymore, because 300-gluon-mesh-babel-mkconfig fails to create /etc/gluon-babeld.conf because the IPv6 address is now not yet set on the loopback interface in UCI. As now 300-layer3-ip6 will be run after 300-gluon-mesh-babel-mkconfig. Before the change 300-gluon-mesh-babel-ip6 was called before 300-gluon-mesh-babel-mkconfig. Renaming 300-layer3-ip6 to 250-layer3-ip6 fixes this issue and makes babeld start fine again.

Also I think you can also move package/{gluon-mesh-babel => gluon-layer3-common}/luasrc/lib/gluon/radvd/argument in this pull-request, too.

Other than that looks good to me.

Edit: A check_site.lua should also be added to gluon-layer3-common for any site/domain settings it uses/requires. prefix6, next_node.ip6 and node_prefix6 if I'm not missing anything. And check if something in the check_site.lua of the other packages might need to be updated after the code moving, too.

@mkg20001
Copy link
Member Author

babel explicitly requires node_client_prefix6. This is true for l3 also or should this actually be optional?

@T-X
Copy link
Contributor

T-X commented Jun 25, 2022

babel explicitly requires node_client_prefix6. This is true for l3 also or should this actually be optional?

My understanding of check_site.lua is, that checks for anything should be added to a specific package where it would crash or misbehave during runtime otherwise. I don't see the gluon-layer3-common package using node_client_prefix6 anywhere, so should not need to be added in there.

At the moment it is optional for gluon-l3roamd and mandatory for gluon-mesh-babel.


I've made a pull-request at #2569 with an idea on how to generally make node_client_prefix6 optional (and deprecated) in the site config though. Feel free to test and comment.

@neocturne
Copy link
Member

By the way, do we need mmfd for anything? If it isn't needed for l3roamd, I'd like to get rid of it, as it adds a lot of complexity.

@mkg20001
Copy link
Member Author

Both babel and OLSRD need it for respondd.

@mkg20001 mkg20001 requested a review from T-X July 1, 2022 19:29
@mkg20001 mkg20001 force-pushed the mmfd branch 2 times, most recently from 3f0386e to 1873049 Compare July 4, 2022 09:37
@@ -1,4 +1,3 @@
need_string_match(in_domain({'node_prefix6'}), '^[%x:]+/64$')
Copy link
Contributor

Choose a reason for hiding this comment

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

In my opinion the node_prefix6 check should stay in here, even if gluon-layer3-common checks it, too:

$ git grep "site\." package/gluon-mesh-babel/
package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/300-gluon-mesh-babel-mkconfig:file:write("out ip " .. site.next_node.ip6() .. "/128 deny\n")
package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/300-gluon-mesh-babel-mkconfig:file:write("redistribute ip " .. site.next_node.ip6() .. "/128 deny\n")
package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/300-gluon-mesh-babel-mkconfig:file:write("redistribute ip " .. site.prefix6() .. " eq 128  allow\n")
package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/300-gluon-mesh-babel-mkconfig:file:write("redistribute ip " .. site.node_client_prefix6() .. " eq 128  allow\n")
package/gluon-mesh-babel/luasrc/lib/gluon/upgrade/300-gluon-mesh-babel-mkconfig:file:write("redistribute ip " .. site.node_prefix6() .. " eq 128  allow\n")
package/gluon-mesh-babel/src/respondd.c:                fprintf(stderr, "get_addresses: could not obtain mesh-prefix from site.conf. Not adding addresses to json data\n");
package/gluon-mesh-babel/src/respondd.c:                fprintf(stderr, "get_addresses: could not convert mesh-prefix from site.conf to string\n");

Copy link
Member

Choose a reason for hiding this comment

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

In my opinion we should not duplicate checks that are already provided by dependencies. It may even make sense to have the l3-common package check values it doesn't use itself if all actual L3 protocol package need them, so we consolidate common checks.

Copy link
Member Author

Choose a reason for hiding this comment

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

So what do now?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've moved node_prefix6. Is that enough? Anything else left?

@blocktrron blocktrron merged commit 5600b87 into freifunk-gluon:master Aug 9, 2022
@mkg20001 mkg20001 deleted the mmfd branch August 9, 2022 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. topic: babel Topic: Babel Layer 3 Routing 3. topic: firewall 3. topic: package Topic: Gluon Packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants