* SUCH DAMAGE.
*
* from: @(#)if_loop.c 7.13 (Berkeley) 4/26/91
- * $Id: if_loop.c,v 1.4 1993/11/15 20:45:58 wollman Exp $
+ * $Id: if_loop.c,v 1.6 1993/12/20 19:31:29 wollman Exp $
*/
/*
#include "socket.h"
#include "errno.h"
#include "ioctl.h"
+#include "kernel.h"
#include "../net/if.h"
#include "../net/if_types.h"
#include "bpfilter.h"
#if NBPFILTER > 0
-#include <sys/time.h>
-#include <net/bpf.h>
+#include "sys/time.h"
+#include "net/bpf.h"
static caddr_t lo_bpf;
#endif
ifp->if_name = "lo";
ifp->if_mtu = LOMTU;
+#ifdef MULTICAST
+ ifp->if_flags = IFF_LOOPBACK|IFF_MULTICAST;
+#else
ifp->if_flags = IFF_LOOPBACK;
+#endif
ifp->if_ioctl = loioctl;
ifp->if_output = looutput;
ifp->if_type = IFT_LOOP;
#endif
}
+TEXT_SET(pseudo_set, loattach);
+
int
looutput(ifp, m, dst, rt)
struct ifnet *ifp;
caddr_t data;
{
register struct ifaddr *ifa;
+#ifdef MULTICAST
+ register struct ifreq *ifr;
+#endif
int error = 0;
switch (cmd) {
*/
break;
+#ifdef MULTICAST
+ case SIOCADDMULTI:
+ case SIOCDELMULTI:
+ ifr = (struct ifreq *)data;
+ if (ifr == 0) {
+ error = EAFNOSUPPORT; /* XXX */
+ break;
+ }
+ switch (ifr->ifr_addr.sa_family) {
+
+#ifdef INET
+ case AF_INET:
+ break;
+#endif
+
+ default:
+ error = EAFNOSUPPORT;
+ break;
+ }
+ break;
+#endif
default:
error = EINVAL;
}