Persist shared IP address on interfaces.
Needs ReviewPublic

Authored by roy on Sun, Jun 25, 11:40 AM.
This revision needs review, but there are no reviewers specified.

Details

Summary

Send unicast DHCP messages by BPF rather than a UDP socket.
Open a BPF socket for all interfaces whether active or not.
Redirect packets to the correct interface based on xid and chaddr.
Announce the primary address via ARP when any address is added or deleted.
Remove the now redundant prefer another address code.

Fixes T126.

Test Plan

Setup your DHCP server to assign the same address to many interfaces
on the same host.
On the host, start dhcpcd and bring up/down/activate the interfaces
in a random order.
Pinging another host on the network should be possible at all times
if any interface is up.

Diff Detail

Repository
rDHC dhcpcd
Branch
arcpatch-D122
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 140
Build 140: arc lint + arc unit
roy created this revision.Sun, Jun 25, 11:40 AM
roy added inline comments.Sun, Jun 25, 2:30 PM
src/dhcp.c
2704

Can't check xid if it's FORCERENEW

2749

Check FORCERENEW as well as the server can set any xid.

roy updated this revision to Diff 53.Mon, Jun 26, 11:36 AM
  • Don't redirect on FORCERENEW when xid mis-matches.
roy marked 2 inline comments as done.Mon, Jun 26, 11:36 AM
roy updated this revision to Diff 57.Thu, Jun 29, 12:05 AM

Sync with master.

roy updated this revision to Diff 58.Tue, Jul 4, 12:09 PM
  • Cancel existing ARP announcements of the same address.
  • Move ipv4_announceaddr to arp_announceaddr.
  • When aborting a lease, rebuild routes and announce the best address.
  • Don't sort interfaces directly when dropping carrier but preserving IP.
  • Simplify
roy updated this revision to Diff 59.Tue, Jul 4, 2:54 PM
  • Cancel existing ARP announcements of the same address.
  • Move ipv4_announceaddr to arp_announceaddr.
  • When aborting a lease, rebuild routes and announce the best address.
  • Don't sort interfaces directly when dropping carrier but preserving IP.
  • Simplify
  • Always announce addresses even for kernels supporting RFC 5227.