summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2010-04-02 21:32:42 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2010-04-02 21:32:42 +0000
commit1b4b20ba994ecc8e9b07730cf86e4a52a80a5af8 (patch)
treebc74c18fba132a9e8ebfbe0658097ec95d5cbfd1
parent7bc40181caefa1db029d44017c45c69dff199c34 (diff)
Special-case SIOCADDMULTI and SIOCDELMULTI ioctls, based on code from if_tun.
Makes IPv6 work with if_vether. ok deraadt
-rw-r--r--sys/net/if_vether.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/net/if_vether.c b/sys/net/if_vether.c
index ec34c9b8b57..5d74266af8d 100644
--- a/sys/net/if_vether.c
+++ b/sys/net/if_vether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vether.c,v 1.13 2010/04/02 04:26:53 deraadt Exp $ */
+/* $OpenBSD: if_vether.c,v 1.14 2010/04/02 21:32:41 stsp Exp $ */
/*
* Copyright (c) 2009 Theo de Raadt
@@ -169,6 +169,27 @@ vetherioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
}
break;
+ case SIOCADDMULTI:
+ case SIOCDELMULTI: {
+ if (ifr == 0) {
+ error = EAFNOSUPPORT; /* XXX */
+ break;
+ }
+
+ error = (cmd == SIOCADDMULTI) ?
+ ether_addmulti(ifr, &sc->sc_ac) :
+ ether_delmulti(ifr, &sc->sc_ac);
+ if (error == ENETRESET) {
+ /*
+ * Multicast list has changed; set the hardware
+ * filter accordingly. The good thing is we do
+ * not have a hardware filter (:
+ */
+ error = 0;
+ }
+ break;
+ }
+
case SIOCGIFMEDIA:
case SIOCSIFMEDIA:
error = ifmedia_ioctl(ifp, ifr, &sc->sc_media, cmd);