Page MenuHomeFreeBSD

Pass addresses instead of sockaddr for lltable lookup. Introduce new light-weight versions of lookup functions.
Needs ReviewPublic

Authored by melifaro on Jan 17 2016, 8:20 AM.

Details

Reviewers
None
Group Reviewers
network
Summary

Internally lltable has been using addresses since r286624. IPv6 code is also using addresses instead of sockaddr in most places (see nd6_lookup() and nd6_alloc()).
Given that, switch lookup/allocation callbacks to use addresses.

Also, provide set of functions used solely for lltable lookups (e.g. not dealing with broadcast/multicast and is_gw).

Functions naming:
Currently llable has the following function prefixes/functions:

  • in[6]_lltable - used for internal per-AF lltable callbacks
  • arpresolve, nd6_resolve - exernal lookup API
  • nd6_alloc, nd6_lookup - internal IPv6 wrappers
  • lltable_alloc_entry - generic alloc callback wrapper
  • lla_lookup - generic lookup callback wrapper
  • llentry_alloc - used solely in flowtable to get ref'ed lle
  • llentry_free - internal lle callback for reclaiming memory when refcount==0
  • lla_rt_output - rtsock handler

This review changes the following:

  • arpresolve, nd6_resolve -> deprecated
  • in[6]_resolve_lla -> new external lookup API
  • lltable_alloc_entry, lla_lookup -> do not use directly, use inlined per-af wrappers
  • <arp|nd6>_alloc, <arp|nd6>_lookup - new per-af inlined wrappers (used for arg validation)
  • llentry_alloc -> llentry_request (because flowtable really _requests_ an entry regadless of whether is was allocated or not)

I'm not very much about functions naming, so any suggessions/comments are welcome.
(e.g. lle[46]_resolve() or arpresolve_new() or ..).

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 2150
Build 2159: arc lint + arc unit

Event Timeline

melifaro retitled this revision from to Pass addresses instead of sockaddr for lltable lookup. Introduce new light-weight versions of lookup functions..Jan 17 2016, 8:20 AM
melifaro updated this object.
melifaro edited the test plan for this revision. (Show Details)
melifaro updated this revision to Diff 12381.