Skip to content

dhcp-relay: Handle server responses #9

@yoelcaspersen

Description

@yoelcaspersen

Initial checks:

  • Destination MAC != FF:FF:FF:FF:FF:FF
  • Destination IP = relay IP address
  • UDP destination port = 68
  • OP == 2
  • GIADDR == relay IP address
  • If hops > 16: Discard packet
  • If option 82 is not set, discard

If option 82 is set, do the following:

  • Rewrite destination MAC = client MAC (use CHADDR)
  • Rewrite source MAC (must be the MAC of the relay interface) (perhaps optional)
  • Set destination IP = broadcast address
  • Set source IP = GIADDR
  • Increment hops field
  • Set new VLAN headers
  • Re-calc IP checksum

Final action:

  • Return XDP_TX (bounce packet) - will only work if client VLANs are tagged on the same interface we use for receiving server responses

TBD: Should we look at BOOTP flags (unicast vs. broadcast response)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions