Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dhcp
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 109
    • Issues 109
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • 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 Projects
  • dhcp
  • Issues
  • #94

Closed
Open
Created Mar 17, 2020 by Joe LeVeque@jlevequeGuest

DHCP relay agent will not discover interfaces if they are down when dhcrelay starts

Currently, dhcrelay will not discover interfaces if they are down at the time the relay agent starts up. If the interface(s) are down at the moment dhcrelay enumerates the interfaces, yet they get brought up any time later, the relay will discard packets received on these interfaces and log the message, Discarding packet received on <iface_name> interface that has no IPv4 address assigned.

With this patch, the relay agent will discover all configured interfaces, whether or not they are up at the time the relay agent starts. Thus, the state of the configured interfaces can be down when the relay agent starts and brought up during the lifetime of the relay agent process, and the relay agent will relay packets as expected; it will not discard them. A DHCP relay agent shouldn't ignore a configured interface if the interface happens to be down when it starts up.

The patch is the addition of one line in common/discover.c, after line 638.

Current code:

		/* Skip non broadcast interfaces (plus loopback and
		   point-to-point in case an OS incorrectly marks them
		   as broadcast). Also skip down interfaces unless we're
		   trying to get a list of configurable interfaces. */
		if ((((local_family == AF_INET &&
		    !(info.flags & IFF_BROADCAST)) ||
#ifdef DHCPv6
		    (local_family == AF_INET6 &&
		    !(info.flags & IFF_MULTICAST)) ||
#endif
		      info.flags & IFF_LOOPBACK ||
		      info.flags & IFF_POINTOPOINT) && !tmp) ||
		    (!(info.flags & IFF_UP) &&
		     state != DISCOVER_UNCONFIGURED))
			continue;

Proposed patch:

		/* Skip non broadcast interfaces (plus loopback and
		   point-to-point in case an OS incorrectly marks them
		   as broadcast). Also skip down interfaces unless we're
		   trying to get a list of configurable interfaces. */
		if ((((local_family == AF_INET &&
		    !(info.flags & IFF_BROADCAST)) ||
#ifdef DHCPv6
		    (local_family == AF_INET6 &&
		    !(info.flags & IFF_MULTICAST)) ||
#endif
		      info.flags & IFF_LOOPBACK ||
		      info.flags & IFF_POINTOPOINT) && !tmp) ||
		    (!(info.flags & IFF_UP) &&
		     state != DISCOVER_UNCONFIGURED &&
		     state != DISCOVER_RELAY))
			continue;
Assignee
Assign to
Time tracking