Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dhcp
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 128
    • Issues 128
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • dhcp
  • Merge requests
  • !62

Faster server startup under FreeBSD with thousands of addresses/interfaces

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Nick Rogers requested to merge courtland/dhcp:master into master Aug 07, 2020
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

This addresses a server performance issue under FreeBSD, where the interface hardware address discovery process (get_hw_addr) is quite slow when there are hundreds or thousands of addresses/interfaces. The slowness is because the BPF code iterates getifaddrs() entirely for each interface. getifaddrs returns all interface aliases, so you end up with a bad O(n^2) performance situation when there are hundreds or thousands of network interfaces (i.e. VLANs). This MR leverages the fact that if_nametoindex is a fast lookup, which can be passed to a sysctl that returns a single struct containing the MAC address.

Fixes #125.

I realize this is probably an exceptional corner case, however I have many production systems in this configuration, and I am willing to help get some kind of appropriate fix upstreamed.

Thanks!

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: master