Add a comment explaining why disc(4) bears the IFF_LOOPBACK flag.

It should be the final follow-up to an old yet unfinished discussion
on whether IFF_LOOPBACK is necessary for disc(4) and why.
This commit is contained in:
Yaroslav Tykhiy 2007-10-27 19:57:41 +00:00
parent a39cea66f4
commit 68b11e74f4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=173076

View File

@ -92,6 +92,16 @@ disc_clone_create(struct if_clone *ifc, int unit, caddr_t params)
ifp->if_softc = sc;
if_initname(ifp, ifc->ifc_name, unit);
ifp->if_mtu = DSMTU;
/*
* IFF_LOOPBACK should not be removed from disc's flags because
* it controls what PF-specific routes are magically added when
* a network address is assigned to the interface. Things just
* won't work as intended w/o such routes because the output
* interface selection for a packet is totally route-driven.
* A valid alternative to IFF_LOOPBACK can be IFF_BROADCAST or
* IFF_POINTOPOINT, but it would result in different properties
* of the interface.
*/
ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST;
ifp->if_drv_flags = IFF_DRV_RUNNING;
ifp->if_ioctl = discioctl;