diff options
author | yar <yar@FreeBSD.org> | 2007-10-27 19:57:41 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2007-10-27 19:57:41 +0000 |
commit | b4d6e528d29958497e84463bb2c022caab0fb35c (patch) | |
tree | d27a64bcb66b5e0bf18b3c4bb0a273d3a7dc0140 /sys/net | |
parent | 2913d803334e3123dddbaf4a49f4b1eaf1d820fc (diff) | |
download | FreeBSD-src-b4d6e528d29958497e84463bb2c022caab0fb35c.zip FreeBSD-src-b4d6e528d29958497e84463bb2c022caab0fb35c.tar.gz |
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.
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_disc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/net/if_disc.c b/sys/net/if_disc.c index 51f05d5..98a06c1 100644 --- a/sys/net/if_disc.c +++ b/sys/net/if_disc.c @@ -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; |