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

Expand mDNS settings #833

Merged
merged 10 commits into from
Dec 4, 2024
Merged

Expand mDNS settings #833

merged 10 commits into from
Dec 4, 2024

Conversation

troglobit
Copy link
Contributor

@troglobit troglobit commented Nov 24, 2024

Description

This PR adds support for modifying the following Avahi daemon settings:

  • domain-name
  • allow-interfaces
  • deny-interfaces
  • enable-reflector
  • reflect-filters

Also included, a review of the default sysctl settings, and some fixes and clarifications to the Networking Guide.

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

@troglobit troglobit added this to the Infix v24.11.1 milestone Nov 24, 2024
@troglobit troglobit self-assigned this Nov 24, 2024
@troglobit troglobit added the enhancement New feature or request label Nov 24, 2024
@troglobit troglobit linked an issue Nov 25, 2024 that may be closed by this pull request
@troglobit troglobit linked an issue Dec 3, 2024 that may be closed by this pull request
@troglobit
Copy link
Contributor Author

@mattiaswal + @jovatn this PR is now finished and awaiting your review.

Copy link
Contributor

@jovatn jovatn left a comment

Choose a reason for hiding this comment

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

Update https://github.com/kernelkit/infix/blob/main/doc/discovery.md#mdns with (rudimentary) descriptions of available mdns settings.

sysctl updates looks good to me, but perhaps we could have an IRL session for rubber ducking on sysctl changes?

src/confd/yang/infix-services.yang Outdated Show resolved Hide resolved
src/confd/yang/infix-services.yang Outdated Show resolved Hide resolved
src/confd/yang/infix-services.yang Show resolved Hide resolved
These changes are based on the sysctl recommendations by Frr [1].

Not all recommendations have been incorporated, e.g., ip forwarding is
not enabled per interface, because in Infix this is an opt-in feature.

A readme.txt has been added, documenting the various settings.

New for IPv4:
 - Adjust IGMP max memberships: 20 -> 1000
 - Use neighbor information on nexthop selection
 - Use inbound interface address on ICMP errors
 - Ignore routes with link down
 - Disable rp_filter

ARP settings have been changed to better fit routers, i.e., systems
with multiple interfaces:

 - Always use best local address when sending ARP
 - Only reply to ARP if target IP is on the inbound interface
 - Generate ARP requests when device is brought up or HW address changes

New for IPv6:
 - Keep static global addresses on link down
 - Ignore routes with link down

Fixes #829

[1]: https://github.com/FRRouting/frr/blob/master/doc/user/Useful_Sysctl_Settings.md

Signed-off-by: Joachim Wiberg <[email protected]>
@troglobit troglobit force-pushed the mdns-settings branch 2 times, most recently from fef6de8 to 4d26e39 Compare December 4, 2024 10:41
doc/ChangeLog.md Outdated Show resolved Hide resolved
src/confd/src/infix-services.c Outdated Show resolved Hide resolved
test/case/infix_services/Readme.adoc Show resolved Hide resolved
Use container for interface allow/deny and for reflector settings.
Hopefully there will be more settings in the future, e.g., control
reflector interfaces independently.

Fix #678

Signed-off-by: Joachim Wiberg <[email protected]>
The Avahi daemon needs to be restarted when changing its configuration
file in /etc/avahi/avahi-daemon.conf, not sufficient to SIGHUP.

Also, minor reformatting for new style.

Signed-off-by: Joachim Wiberg <[email protected]>
Signed-off-by: Joachim Wiberg <[email protected]>
Fixes the following issue when deleting /infix-services:mdns/interfaces,
which works fine over RESTCONF:

Traceback (most recent call last):
  File "/home/jocke/src/infix/test/./case/infix_services/mdns_allow_deny/test.py", line 142, in <module>
    dut.delete_xpath("/infix-services:mdns/interfaces")
  File "/home/jocke/src/infix/test/infamy/netconf.py", line 418, in delete_xpath
    oldd = mod.parse_data_dict(old, no_state=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.infix/venv/lib/python3.11/site-packages/libyang/schema.py", line 215, in parse_data_dict
    return dict_to_dnode(
           ^^^^^^^^^^^^^^
  File "/root/.infix/venv/lib/python3.11/site-packages/libyang/data.py", line 1277, in dict_to_dnode
    result.root().validate(
  File "/root/.infix/venv/lib/python3.11/site-packages/libyang/data.py", line 430, in validate
    self.validate_all(no_state, validate_present)
  File "/root/.infix/venv/lib/python3.11/site-packages/libyang/data.py", line 449, in validate_all
    raise self.context.error("validation failed")
libyang.util.LibyangError: validation failed:
    Invalid leafref value "e3" - no target instance "/if:interfaces/if:interface/if:name" with the same value.

The patch skips validation of the diff in favor of checking the result
of libyang.xpath_del().

Signed-off-by: Joachim Wiberg <[email protected]>
Signed-off-by: Joachim Wiberg <[email protected]>
Overhaul text and grammar.  Simplify, correct, and add information about
the new mDNS settings.  Replace 'unit' with 'device', which is the more
common term for hardware.

Signed-off-by: Joachim Wiberg <[email protected]>
Copy link
Contributor

@mattiaswal mattiaswal left a comment

Choose a reason for hiding this comment

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

💯

@wkz wkz merged commit 42b7cf9 into main Dec 4, 2024
6 checks passed
@wkz wkz deleted the mdns-settings branch December 4, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Review sysctl settings mdns: expose more Avahi configuration settings
4 participants