Skip to content

Add udev ID_NET_NAME_* property restoration for VPP interfaces#868

Merged
sknat merged 1 commit intomasterfrom
abasu-fix-dhcpv6-iaid
Feb 4, 2026
Merged

Add udev ID_NET_NAME_* property restoration for VPP interfaces#868
sknat merged 1 commit intomasterfrom
abasu-fix-dhcpv6-iaid

Conversation

@aritrbas
Copy link
Collaborator

@aritrbas aritrbas commented Jan 27, 2026

Capture ID_NET_NAME_* properties before VPP driver unbind and restore them via udev rules after VPP creates host-facing tap/tun interface. This is needed for IAID generation by DHCPv6 client in systemd-networkd to be consistent across VPP lifecycle on the node.

Key changes:

  • Repurpose BEFORE_IF_READ hook to capture udev properties before driver unbind
  • Move SetInterfaceNames() before HookBeforeIfRead so interface names are available
  • Store ID_NET_NAME_* values and MAC address while interface still has original driver
  • Create udev rules for the interface to restore ID_NET_NAME_* values after VPP runs.
  • Cleanup udev rules on VPP shutdown.
  • BEFORE_IF_READ → capture, VPP_RUNNING → create, VPP_DONE_OK/ERRORED → cleanup.
  • Add enableUdevNetNameRules config knob in CalicoVppDebugConfigType (default: true)
    • Allows disabling udev net name rules generation (if needed)
    • When disabled, skips captureHostUdevProps(), createUdevNetNameRules() and removeUdevNetNameRules()
  • Support both native Go hooks (multi-interface) and shell script fallback (single-interface).

@aritrbas aritrbas self-assigned this Jan 27, 2026
Copy link
Collaborator

@sknat sknat left a comment

Choose a reason for hiding this comment

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

Great ! Many thanks.
Just two minor comments on the golang agent implementation

@aritrbas aritrbas force-pushed the abasu-fix-dhcpv6-iaid branch from 06109fe to 046b57e Compare January 29, 2026 23:54
Capture ID_NET_NAME_* properties before VPP driver unbind and restore them
via udev rules after VPP creates host-facing tap/tun interface. This is
needed for IAID generation by DHCPv6 client in systemd-networkd to be
consistent across VPP lifecycle on the node.

Key changes:
- Repurpose BEFORE_IF_READ hook to capture udev properties before driver unbind
- Move SetInterfaceNames() before HookBeforeIfRead so interface names are available
- Store ID_NET_NAME_* values and MAC address while interface still has original driver
- Create udev rules for the interface to restore ID_NET_NAME_* values after VPP runs
- Cleanup udev rules on VPP shutdown
- BEFORE_IF_READ → capture, VPP_RUNNING → create, VPP_DONE_OK/ERRORED → cleanup
- Add EnableUdevNetNameRules config knob in CalicoVppDebugConfigType (default: true)
  - Allows disabling udev net name rules generation (if needed). When disabled, skips
    captureHostUdevProps(), createUdevNetNameRules() and removeUdevNetNameRules()
- Support both native Go hooks (multi-interface) and shell fallback (single-interface)

Signed-off-by: Aritra Basu <aritrbas@cisco.com>
@aritrbas aritrbas force-pushed the abasu-fix-dhcpv6-iaid branch from 046b57e to b218753 Compare January 30, 2026 19:35
Copy link
Collaborator

@sknat sknat left a comment

Choose a reason for hiding this comment

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

thank for the changes,
lgtm

@sknat sknat merged commit f491481 into master Feb 4, 2026
5 checks passed
@sknat sknat deleted the abasu-fix-dhcpv6-iaid branch February 4, 2026 14:54
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