HomeFreeBSD

In the head network stack an interface ifp->if_addrlen always matches

Description

In the head network stack an interface ifp->if_addrlen always matches
((struct sockaddr_dl *)ifp->if_addr->ifa_addr))->sdl_alen. We can use
either to determine interface address length. In the projects/ifnet,
the if_addrlen moves to ifdrv_addrlen, being the same for all instances
of a certain driver. However, the vlan(4) driver theoretically may
have different address length on different instances. We've got code
in vlan(4) that allows it to run on infiniband.

o Change if_addrlen() to return sdl_alen of hardware address instead

of ifdrv_addrlen.

o Generalize setup of ifa_addr. Set up sdl->sdl_alen and copy the

link level address in the if_attach(), instead of doing that in
ether_ifattach/arc_ifattch/whatever_ifattach.

o Make ifat_lla an optional argument. An interface may not know its

address at creation time, thus it will have address of all zeroes.

Sponsored by: Netflix
Sponsored by: Nginx, Inc.

Details

Provenance
glebiusAuthored on
Parents
rS280619: Remove remnants of vlan_cookie()/vlan_setcookie().
Branches
Unknown
Tags
Unknown

Event Timeline