Filter out ENETRESET from ether_ioctl() since we aren't interested in multicast hugging.diff -r1.6 -r1.7 src/sys/rump/net/lib/libshmif/if_shmem.c
(pooka)
--- src/sys/rump/net/lib/libshmif/if_shmem.c 2009/04/06 20:41:29 1.6
+++ src/sys/rump/net/lib/libshmif/if_shmem.c 2009/05/26 19:03:05 1.7
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: if_shmem.c,v 1.6 2009/04/06 20:41:29 pooka Exp $ */ | 1 | /* $NetBSD: if_shmem.c,v 1.7 2009/05/26 19:03:05 pooka Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2009 Antti Kantee. All Rights Reserved. | 4 | * Copyright (c) 2009 Antti Kantee. All Rights Reserved. | |
5 | * | 5 | * | |
6 | * Development of this software was supported by The Nokia Foundation. | 6 | * Development of this software was supported by The Nokia Foundation. | |
7 | * | 7 | * | |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions | |
10 | * are met: | 10 | * are met: | |
11 | * 1. Redistributions of source code must retain the above copyright | 11 | * 1. Redistributions of source code must retain the above copyright | |
12 | * notice, this list of conditions and the following disclaimer. | 12 | * notice, this list of conditions and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | 13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in the | 14 | * notice, this list of conditions and the following disclaimer in the | |
@@ -18,27 +18,27 @@ | @@ -18,27 +18,27 @@ | |||
18 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 18 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
20 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | 20 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | |
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
23 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 23 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
27 | * SUCH DAMAGE. | 27 | * SUCH DAMAGE. | |
28 | */ | 28 | */ | |
29 | 29 | |||
30 | #include <sys/cdefs.h> | 30 | #include <sys/cdefs.h> | |
31 | __KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.6 2009/04/06 20:41:29 pooka Exp $"); | 31 | __KERNEL_RCSID(0, "$NetBSD: if_shmem.c,v 1.7 2009/05/26 19:03:05 pooka Exp $"); | |
32 | 32 | |||
33 | #include <sys/param.h> | 33 | #include <sys/param.h> | |
34 | #include <sys/fcntl.h> | 34 | #include <sys/fcntl.h> | |
35 | #include <sys/kmem.h> | 35 | #include <sys/kmem.h> | |
36 | #include <sys/kthread.h> | 36 | #include <sys/kthread.h> | |
37 | #include <sys/lock.h> | 37 | #include <sys/lock.h> | |
38 | #include <sys/atomic.h> | 38 | #include <sys/atomic.h> | |
39 | 39 | |||
40 | #include <net/if.h> | 40 | #include <net/if.h> | |
41 | #include <net/if_ether.h> | 41 | #include <net/if_ether.h> | |
42 | 42 | |||
43 | #include <netinet/in.h> | 43 | #include <netinet/in.h> | |
44 | #include <netinet/in_var.h> | 44 | #include <netinet/in_var.h> | |
@@ -252,26 +252,28 @@ shmif_init(struct ifnet *ifp) | @@ -252,26 +252,28 @@ shmif_init(struct ifnet *ifp) | |||
252 | } | 252 | } | |
253 | 253 | |||
254 | ifp->if_flags |= IFF_RUNNING; | 254 | ifp->if_flags |= IFF_RUNNING; | |
255 | return error; | 255 | return error; | |
256 | } | 256 | } | |
257 | 257 | |||
258 | static int | 258 | static int | |
259 | shmif_ioctl(struct ifnet *ifp, u_long cmd, void *data) | 259 | shmif_ioctl(struct ifnet *ifp, u_long cmd, void *data) | |
260 | { | 260 | { | |
261 | int s, rv; | 261 | int s, rv; | |
262 | 262 | |||
263 | s = splnet(); | 263 | s = splnet(); | |
264 | rv = ether_ioctl(ifp, cmd, data); | 264 | rv = ether_ioctl(ifp, cmd, data); | |
265 | if (rv == ENETRESET) | |||
266 | rv = 0; | |||
265 | splx(s); | 267 | splx(s); | |
266 | 268 | |||
267 | return rv; | 269 | return rv; | |
268 | } | 270 | } | |
269 | 271 | |||
270 | /* send everything in-context */ | 272 | /* send everything in-context */ | |
271 | static void | 273 | static void | |
272 | shmif_start(struct ifnet *ifp) | 274 | shmif_start(struct ifnet *ifp) | |
273 | { | 275 | { | |
274 | struct shmif_sc *sc = ifp->if_softc; | 276 | struct shmif_sc *sc = ifp->if_softc; | |
275 | struct mbuf *m, *m0; | 277 | struct mbuf *m, *m0; | |
276 | uint32_t lastoff, dataoff, npktlenoff; | 278 | uint32_t lastoff, dataoff, npktlenoff; | |
277 | uint32_t pktsize = 0; | 279 | uint32_t pktsize = 0; |
--- src/sys/rump/net/lib/libvirtif/if_virt.c 2009/03/27 13:46:35 1.8
+++ src/sys/rump/net/lib/libvirtif/if_virt.c 2009/05/26 19:03:05 1.9
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: if_virt.c,v 1.8 2009/03/27 13:46:35 pooka Exp $ */ | 1 | /* $NetBSD: if_virt.c,v 1.9 2009/05/26 19:03:05 pooka Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2008 Antti Kantee. All Rights Reserved. | 4 | * Copyright (c) 2008 Antti Kantee. All Rights Reserved. | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * | 14 | * | |
@@ -16,27 +16,27 @@ | @@ -16,27 +16,27 @@ | |||
16 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 16 | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | 18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | |
19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | 20 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |
21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 21 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 22 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 23 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
25 | * SUCH DAMAGE. | 25 | * SUCH DAMAGE. | |
26 | */ | 26 | */ | |
27 | 27 | |||
28 | #include <sys/cdefs.h> | 28 | #include <sys/cdefs.h> | |
29 | __KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.8 2009/03/27 13:46:35 pooka Exp $"); | 29 | __KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.9 2009/05/26 19:03:05 pooka Exp $"); | |
30 | 30 | |||
31 | #include <sys/param.h> | 31 | #include <sys/param.h> | |
32 | #include <sys/condvar.h> | 32 | #include <sys/condvar.h> | |
33 | #include <sys/fcntl.h> | 33 | #include <sys/fcntl.h> | |
34 | #include <sys/kmem.h> | 34 | #include <sys/kmem.h> | |
35 | #include <sys/kthread.h> | 35 | #include <sys/kthread.h> | |
36 | #include <sys/mutex.h> | 36 | #include <sys/mutex.h> | |
37 | #include <sys/sockio.h> | 37 | #include <sys/sockio.h> | |
38 | #include <sys/socketvar.h> | 38 | #include <sys/socketvar.h> | |
39 | 39 | |||
40 | #include <net/if.h> | 40 | #include <net/if.h> | |
41 | #include <net/if_ether.h> | 41 | #include <net/if_ether.h> | |
42 | #include <net/if_tap.h> | 42 | #include <net/if_tap.h> | |
@@ -157,26 +157,28 @@ virtif_init(struct ifnet *ifp) | @@ -157,26 +157,28 @@ virtif_init(struct ifnet *ifp) | |||
157 | } | 157 | } | |
158 | ifp->if_flags |= IFF_RUNNING; | 158 | ifp->if_flags |= IFF_RUNNING; | |
159 | 159 | |||
160 | return 0; | 160 | return 0; | |
161 | } | 161 | } | |
162 | 162 | |||
163 | static int | 163 | static int | |
164 | virtif_ioctl(struct ifnet *ifp, u_long cmd, void *data) | 164 | virtif_ioctl(struct ifnet *ifp, u_long cmd, void *data) | |
165 | { | 165 | { | |
166 | int s, rv; | 166 | int s, rv; | |
167 | 167 | |||
168 | s = splnet(); | 168 | s = splnet(); | |
169 | rv = ether_ioctl(ifp, cmd, data); | 169 | rv = ether_ioctl(ifp, cmd, data); | |
170 | if (rv == ENETRESET) | |||
171 | rv = 0; | |||
170 | splx(s); | 172 | splx(s); | |
171 | 173 | |||
172 | return rv; | 174 | return rv; | |
173 | } | 175 | } | |
174 | 176 | |||
175 | /* just send everything in-context */ | 177 | /* just send everything in-context */ | |
176 | static void | 178 | static void | |
177 | virtif_start(struct ifnet *ifp) | 179 | virtif_start(struct ifnet *ifp) | |
178 | { | 180 | { | |
179 | struct virtif_sc *sc = ifp->if_softc; | 181 | struct virtif_sc *sc = ifp->if_softc; | |
180 | 182 | |||
181 | mutex_enter(&sc->sc_sendmtx); | 183 | mutex_enter(&sc->sc_sendmtx); | |
182 | cv_signal(&sc->sc_sendcv); | 184 | cv_signal(&sc->sc_sendcv); |