On Thu, Apr 15, 2004 at 01:31:11PM -0700, Luigi Rizzo wrote:
> luigi 2004/04/15 13:31:11 PDT
> FreeBSD src repository
> Modified files:
> sys/dev/arl if_arl.c
> sys/dev/cs if_cs.c
> sys/dev/ed if_ed.c
> sys/dev/ex if_ex.c
> sys/dev/fe if_fe.c
> sys/dev/lnc if_lnc.c
> sys/dev/sbni if_sbni.c
> sys/dev/sn if_sn.c
> sys/dev/wl if_wl.c
> sys/dev/xe if_xe.c
> Remove improper use of if_addrhead in device drivers to check
> if the link-level address has been initialized already.
> The majority of modern drivers never does this and works fine, which
> makes me think that the check is totally unnecessary and a residue
> of cut&paste from other drivers.
I suspect I know where this came from. Until rev 1.177 of net/if.c,
there was an assumption that creating the ifaddr for the lladdr could
fail due to a malloc failure in if_attach. These drivers were probably
programming based on the assumption that this check could fail. Since
malloc was called with M_WAITOK this shouldn't be possiable and so
I removed the check there while redoing the allocation for interface
renaming support. In reality, given the fact that if_attach can't fail
(since it has a void return) the check should have resulted in a panic
rather then attaching an unusable interface.
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4