Simplify the mtag API: - Remove m_tag_init(), m_tag_first(), m_tag_next() and m_tag_delete_nonpersistent(). - Remove the 't' argument from m_tag_delete_chain().diff -r1.2237 -r1.2238 src/distrib/sets/lists/comp/mi
(maxv)
--- src/distrib/sets/lists/comp/mi 2018/10/28 00:44:37 1.2237
+++ src/distrib/sets/lists/comp/mi 2018/11/15 10:06:06 1.2238
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | # $NetBSD: mi,v 1.2237 2018/10/28 00:44:37 uwe Exp $ | 1 | # $NetBSD: mi,v 1.2238 2018/11/15 10:06:06 maxv Exp $ | |
2 | # | 2 | # | |
3 | # Note: don't delete entries from here - mark them as "obsolete" instead. | 3 | # Note: don't delete entries from here - mark them as "obsolete" instead. | |
4 | ./etc/mtree/set.comp comp-sys-root | 4 | ./etc/mtree/set.comp comp-sys-root | |
5 | ./usr/bin/addr2line comp-debug-bin binutils | 5 | ./usr/bin/addr2line comp-debug-bin binutils | |
6 | ./usr/bin/ar comp-util-bin binutils | 6 | ./usr/bin/ar comp-util-bin binutils | |
7 | ./usr/bin/as comp-util-bin binutils | 7 | ./usr/bin/as comp-util-bin binutils | |
8 | ./usr/bin/asa comp-fortran-bin | 8 | ./usr/bin/asa comp-fortran-bin | |
9 | ./usr/bin/atf-compile comp-obsolete obsolete | 9 | ./usr/bin/atf-compile comp-obsolete obsolete | |
10 | ./usr/bin/c++ comp-cxx-bin gcccmds | 10 | ./usr/bin/c++ comp-cxx-bin gcccmds | |
11 | ./usr/bin/c++filt comp-cxx-bin binutils | 11 | ./usr/bin/c++filt comp-cxx-bin binutils | |
12 | ./usr/bin/c11 comp-c-bin | 12 | ./usr/bin/c11 comp-c-bin | |
13 | ./usr/bin/c89 comp-c-bin | 13 | ./usr/bin/c89 comp-c-bin | |
14 | ./usr/bin/c99 comp-c-bin | 14 | ./usr/bin/c99 comp-c-bin | |
@@ -11225,33 +11225,33 @@ | @@ -11225,33 +11225,33 @@ | |||
11225 | ./usr/share/man/cat9/m_get.0 comp-sys-catman .cat | 11225 | ./usr/share/man/cat9/m_get.0 comp-sys-catman .cat | |
11226 | ./usr/share/man/cat9/m_getclr.0 comp-obsolete obsolete | 11226 | ./usr/share/man/cat9/m_getclr.0 comp-obsolete obsolete | |
11227 | ./usr/share/man/cat9/m_gethdr.0 comp-sys-catman .cat | 11227 | ./usr/share/man/cat9/m_gethdr.0 comp-sys-catman .cat | |
11228 | ./usr/share/man/cat9/m_makewritable.0 comp-sys-catman .cat | 11228 | ./usr/share/man/cat9/m_makewritable.0 comp-sys-catman .cat | |
11229 | ./usr/share/man/cat9/m_prepend.0 comp-sys-catman .cat | 11229 | ./usr/share/man/cat9/m_prepend.0 comp-sys-catman .cat | |
11230 | ./usr/share/man/cat9/m_pulldown.0 comp-sys-catman .cat | 11230 | ./usr/share/man/cat9/m_pulldown.0 comp-sys-catman .cat | |
11231 | ./usr/share/man/cat9/m_pullup.0 comp-sys-catman .cat | 11231 | ./usr/share/man/cat9/m_pullup.0 comp-sys-catman .cat | |
11232 | ./usr/share/man/cat9/m_split.0 comp-sys-catman .cat | 11232 | ./usr/share/man/cat9/m_split.0 comp-sys-catman .cat | |
11233 | ./usr/share/man/cat9/m_tag.0 comp-sys-catman .cat | 11233 | ./usr/share/man/cat9/m_tag.0 comp-sys-catman .cat | |
11234 | ./usr/share/man/cat9/m_tag_copy.0 comp-sys-catman .cat | 11234 | ./usr/share/man/cat9/m_tag_copy.0 comp-sys-catman .cat | |
11235 | ./usr/share/man/cat9/m_tag_copy_chain.0 comp-sys-catman .cat | 11235 | ./usr/share/man/cat9/m_tag_copy_chain.0 comp-sys-catman .cat | |
11236 | ./usr/share/man/cat9/m_tag_delete.0 comp-sys-catman .cat | 11236 | ./usr/share/man/cat9/m_tag_delete.0 comp-sys-catman .cat | |
11237 | ./usr/share/man/cat9/m_tag_delete_chain.0 comp-sys-catman .cat | 11237 | ./usr/share/man/cat9/m_tag_delete_chain.0 comp-sys-catman .cat | |
11238 | ./usr/share/man/cat9/m_tag_delete_nonpersistent.0 comp-sys-catman .cat | 11238 | ./usr/share/man/cat9/m_tag_delete_nonpersistent.0 comp-obsolete obsolete | |
11239 | ./usr/share/man/cat9/m_tag_find.0 comp-sys-catman .cat | 11239 | ./usr/share/man/cat9/m_tag_find.0 comp-sys-catman .cat | |
11240 | ./usr/share/man/cat9/m_tag_first.0 comp-sys-catman .cat | 11240 | ./usr/share/man/cat9/m_tag_first.0 comp-obsolete obsolete | |
11241 | ./usr/share/man/cat9/m_tag_free.0 comp-sys-catman .cat | 11241 | ./usr/share/man/cat9/m_tag_free.0 comp-sys-catman .cat | |
11242 | ./usr/share/man/cat9/m_tag_get.0 comp-sys-catman .cat | 11242 | ./usr/share/man/cat9/m_tag_get.0 comp-sys-catman .cat | |
11243 | ./usr/share/man/cat9/m_tag_init.0 comp-sys-catman .cat | 11243 | ./usr/share/man/cat9/m_tag_init.0 comp-obsolete obsolete | |
11244 | ./usr/share/man/cat9/m_tag_next.0 comp-sys-catman .cat | 11244 | ./usr/share/man/cat9/m_tag_next.0 comp-obsolete obsolete | |
11245 | ./usr/share/man/cat9/m_tag_prepend.0 comp-sys-catman .cat | 11245 | ./usr/share/man/cat9/m_tag_prepend.0 comp-sys-catman .cat | |
11246 | ./usr/share/man/cat9/m_tag_unlink.0 comp-sys-catman .cat | 11246 | ./usr/share/man/cat9/m_tag_unlink.0 comp-sys-catman .cat | |
11247 | ./usr/share/man/cat9/makeiplcookie.0 comp-sys-catman .cat | 11247 | ./usr/share/man/cat9/makeiplcookie.0 comp-sys-catman .cat | |
11248 | ./usr/share/man/cat9/malloc.0 comp-sys-catman .cat | 11248 | ./usr/share/man/cat9/malloc.0 comp-sys-catman .cat | |
11249 | ./usr/share/man/cat9/malloc_roundup.0 comp-obsolete obsolete | 11249 | ./usr/share/man/cat9/malloc_roundup.0 comp-obsolete obsolete | |
11250 | ./usr/share/man/cat9/malloc_type_attach.0 comp-sys-catman .cat | 11250 | ./usr/share/man/cat9/malloc_type_attach.0 comp-sys-catman .cat | |
11251 | ./usr/share/man/cat9/malloc_type_detach.0 comp-sys-catman .cat | 11251 | ./usr/share/man/cat9/malloc_type_detach.0 comp-sys-catman .cat | |
11252 | ./usr/share/man/cat9/malloc_type_setlimit.0 comp-obsolete obsolete | 11252 | ./usr/share/man/cat9/malloc_type_setlimit.0 comp-obsolete obsolete | |
11253 | ./usr/share/man/cat9/mb.0 comp-sys-catman .cat | 11253 | ./usr/share/man/cat9/mb.0 comp-sys-catman .cat | |
11254 | ./usr/share/man/cat9/mb_memory.0 comp-sys-catman .cat | 11254 | ./usr/share/man/cat9/mb_memory.0 comp-sys-catman .cat | |
11255 | ./usr/share/man/cat9/mb_read.0 comp-sys-catman .cat | 11255 | ./usr/share/man/cat9/mb_read.0 comp-sys-catman .cat | |
11256 | ./usr/share/man/cat9/mb_write.0 comp-sys-catman .cat | 11256 | ./usr/share/man/cat9/mb_write.0 comp-sys-catman .cat | |
11257 | ./usr/share/man/cat9/mbuf.0 comp-sys-catman .cat | 11257 | ./usr/share/man/cat9/mbuf.0 comp-sys-catman .cat | |
@@ -19038,33 +19038,33 @@ | @@ -19038,33 +19038,33 @@ | |||
19038 | ./usr/share/man/html9/m_get.html comp-sys-htmlman html | 19038 | ./usr/share/man/html9/m_get.html comp-sys-htmlman html | |
19039 | ./usr/share/man/html9/m_getclr.html comp-obsolete obsolete | 19039 | ./usr/share/man/html9/m_getclr.html comp-obsolete obsolete | |
19040 | ./usr/share/man/html9/m_gethdr.html comp-sys-htmlman html | 19040 | ./usr/share/man/html9/m_gethdr.html comp-sys-htmlman html | |
19041 | ./usr/share/man/html9/m_makewritable.html comp-sys-htmlman html | 19041 | ./usr/share/man/html9/m_makewritable.html comp-sys-htmlman html | |
19042 | ./usr/share/man/html9/m_prepend.html comp-sys-htmlman html | 19042 | ./usr/share/man/html9/m_prepend.html comp-sys-htmlman html | |
19043 | ./usr/share/man/html9/m_pulldown.html comp-sys-htmlman html | 19043 | ./usr/share/man/html9/m_pulldown.html comp-sys-htmlman html | |
19044 | ./usr/share/man/html9/m_pullup.html comp-sys-htmlman html | 19044 | ./usr/share/man/html9/m_pullup.html comp-sys-htmlman html | |
19045 | ./usr/share/man/html9/m_split.html comp-sys-htmlman html | 19045 | ./usr/share/man/html9/m_split.html comp-sys-htmlman html | |
19046 | ./usr/share/man/html9/m_tag.html comp-sys-htmlman html | 19046 | ./usr/share/man/html9/m_tag.html comp-sys-htmlman html | |
19047 | ./usr/share/man/html9/m_tag_copy.html comp-sys-htmlman html | 19047 | ./usr/share/man/html9/m_tag_copy.html comp-sys-htmlman html | |
19048 | ./usr/share/man/html9/m_tag_copy_chain.html comp-sys-htmlman html | 19048 | ./usr/share/man/html9/m_tag_copy_chain.html comp-sys-htmlman html | |
19049 | ./usr/share/man/html9/m_tag_delete.html comp-sys-htmlman html | 19049 | ./usr/share/man/html9/m_tag_delete.html comp-sys-htmlman html | |
19050 | ./usr/share/man/html9/m_tag_delete_chain.html comp-sys-htmlman html | 19050 | ./usr/share/man/html9/m_tag_delete_chain.html comp-sys-htmlman html | |
19051 | ./usr/share/man/html9/m_tag_delete_nonpersistent.html comp-sys-htmlman html | 19051 | ./usr/share/man/html9/m_tag_delete_nonpersistent.html comp-obsolete obsolete | |
19052 | ./usr/share/man/html9/m_tag_find.html comp-sys-htmlman html | 19052 | ./usr/share/man/html9/m_tag_find.html comp-sys-htmlman html | |
19053 | ./usr/share/man/html9/m_tag_first.html comp-sys-htmlman html | 19053 | ./usr/share/man/html9/m_tag_first.html comp-obsolete obsolete | |
19054 | ./usr/share/man/html9/m_tag_free.html comp-sys-htmlman html | 19054 | ./usr/share/man/html9/m_tag_free.html comp-sys-htmlman html | |
19055 | ./usr/share/man/html9/m_tag_get.html comp-sys-htmlman html | 19055 | ./usr/share/man/html9/m_tag_get.html comp-sys-htmlman html | |
19056 | ./usr/share/man/html9/m_tag_init.html comp-sys-htmlman html | 19056 | ./usr/share/man/html9/m_tag_init.html comp-obsolete obsolete | |
19057 | ./usr/share/man/html9/m_tag_next.html comp-sys-htmlman html | 19057 | ./usr/share/man/html9/m_tag_next.html comp-obsolete obsolete | |
19058 | ./usr/share/man/html9/m_tag_prepend.html comp-sys-htmlman html | 19058 | ./usr/share/man/html9/m_tag_prepend.html comp-sys-htmlman html | |
19059 | ./usr/share/man/html9/m_tag_unlink.html comp-sys-htmlman html | 19059 | ./usr/share/man/html9/m_tag_unlink.html comp-sys-htmlman html | |
19060 | ./usr/share/man/html9/makeiplcookie.html comp-sys-htmlman html | 19060 | ./usr/share/man/html9/makeiplcookie.html comp-sys-htmlman html | |
19061 | ./usr/share/man/html9/malloc.html comp-sys-htmlman html | 19061 | ./usr/share/man/html9/malloc.html comp-sys-htmlman html | |
19062 | ./usr/share/man/html9/malloc_roundup.html comp-obsolete obsolete | 19062 | ./usr/share/man/html9/malloc_roundup.html comp-obsolete obsolete | |
19063 | ./usr/share/man/html9/malloc_type_attach.html comp-sys-htmlman html | 19063 | ./usr/share/man/html9/malloc_type_attach.html comp-sys-htmlman html | |
19064 | ./usr/share/man/html9/malloc_type_detach.html comp-sys-htmlman html | 19064 | ./usr/share/man/html9/malloc_type_detach.html comp-sys-htmlman html | |
19065 | ./usr/share/man/html9/malloc_type_setlimit.html comp-obsolete obsolete | 19065 | ./usr/share/man/html9/malloc_type_setlimit.html comp-obsolete obsolete | |
19066 | ./usr/share/man/html9/mb.html comp-sys-htmlman html | 19066 | ./usr/share/man/html9/mb.html comp-sys-htmlman html | |
19067 | ./usr/share/man/html9/mb_memory.html comp-sys-htmlman html | 19067 | ./usr/share/man/html9/mb_memory.html comp-sys-htmlman html | |
19068 | ./usr/share/man/html9/mb_read.html comp-sys-htmlman html | 19068 | ./usr/share/man/html9/mb_read.html comp-sys-htmlman html | |
19069 | ./usr/share/man/html9/mb_write.html comp-sys-htmlman html | 19069 | ./usr/share/man/html9/mb_write.html comp-sys-htmlman html | |
19070 | ./usr/share/man/html9/mbuf.html comp-sys-htmlman html | 19070 | ./usr/share/man/html9/mbuf.html comp-sys-htmlman html | |
@@ -27005,33 +27005,33 @@ | @@ -27005,33 +27005,33 @@ | |||
27005 | ./usr/share/man/man9/m_get.9 comp-sys-man .man | 27005 | ./usr/share/man/man9/m_get.9 comp-sys-man .man | |
27006 | ./usr/share/man/man9/m_getclr.9 comp-obsolete obsolete | 27006 | ./usr/share/man/man9/m_getclr.9 comp-obsolete obsolete | |
27007 | ./usr/share/man/man9/m_gethdr.9 comp-sys-man .man | 27007 | ./usr/share/man/man9/m_gethdr.9 comp-sys-man .man | |
27008 | ./usr/share/man/man9/m_makewritable.9 comp-sys-man .man | 27008 | ./usr/share/man/man9/m_makewritable.9 comp-sys-man .man | |
27009 | ./usr/share/man/man9/m_prepend.9 comp-sys-man .man | 27009 | ./usr/share/man/man9/m_prepend.9 comp-sys-man .man | |
27010 | ./usr/share/man/man9/m_pulldown.9 comp-sys-man .man | 27010 | ./usr/share/man/man9/m_pulldown.9 comp-sys-man .man | |
27011 | ./usr/share/man/man9/m_pullup.9 comp-sys-man .man | 27011 | ./usr/share/man/man9/m_pullup.9 comp-sys-man .man | |
27012 | ./usr/share/man/man9/m_split.9 comp-sys-man .man | 27012 | ./usr/share/man/man9/m_split.9 comp-sys-man .man | |
27013 | ./usr/share/man/man9/m_tag.9 comp-sys-man .man | 27013 | ./usr/share/man/man9/m_tag.9 comp-sys-man .man | |
27014 | ./usr/share/man/man9/m_tag_copy.9 comp-sys-man .man | 27014 | ./usr/share/man/man9/m_tag_copy.9 comp-sys-man .man | |
27015 | ./usr/share/man/man9/m_tag_copy_chain.9 comp-sys-man .man | 27015 | ./usr/share/man/man9/m_tag_copy_chain.9 comp-sys-man .man | |
27016 | ./usr/share/man/man9/m_tag_delete.9 comp-sys-man .man | 27016 | ./usr/share/man/man9/m_tag_delete.9 comp-sys-man .man | |
27017 | ./usr/share/man/man9/m_tag_delete_chain.9 comp-sys-man .man | 27017 | ./usr/share/man/man9/m_tag_delete_chain.9 comp-sys-man .man | |
27018 | ./usr/share/man/man9/m_tag_delete_nonpersistent.9 comp-sys-man .man | 27018 | ./usr/share/man/man9/m_tag_delete_nonpersistent.9 comp-obsolete obsolete | |
27019 | ./usr/share/man/man9/m_tag_find.9 comp-sys-man .man | 27019 | ./usr/share/man/man9/m_tag_find.9 comp-sys-man .man | |
27020 | ./usr/share/man/man9/m_tag_first.9 comp-sys-man .man | 27020 | ./usr/share/man/man9/m_tag_first.9 comp-obsolete obsolete | |
27021 | ./usr/share/man/man9/m_tag_free.9 comp-sys-man .man | 27021 | ./usr/share/man/man9/m_tag_free.9 comp-sys-man .man | |
27022 | ./usr/share/man/man9/m_tag_get.9 comp-sys-man .man | 27022 | ./usr/share/man/man9/m_tag_get.9 comp-sys-man .man | |
27023 | ./usr/share/man/man9/m_tag_init.9 comp-sys-man .man | 27023 | ./usr/share/man/man9/m_tag_init.9 comp-obsolete obsolete | |
27024 | ./usr/share/man/man9/m_tag_next.9 comp-sys-man .man | 27024 | ./usr/share/man/man9/m_tag_next.9 comp-obsolete obsolete | |
27025 | ./usr/share/man/man9/m_tag_prepend.9 comp-sys-man .man | 27025 | ./usr/share/man/man9/m_tag_prepend.9 comp-sys-man .man | |
27026 | ./usr/share/man/man9/m_tag_unlink.9 comp-sys-man .man | 27026 | ./usr/share/man/man9/m_tag_unlink.9 comp-sys-man .man | |
27027 | ./usr/share/man/man9/makeiplcookie.9 comp-sys-man .man | 27027 | ./usr/share/man/man9/makeiplcookie.9 comp-sys-man .man | |
27028 | ./usr/share/man/man9/malloc.9 comp-sys-man .man | 27028 | ./usr/share/man/man9/malloc.9 comp-sys-man .man | |
27029 | ./usr/share/man/man9/malloc_roundup.9 comp-obsolete obsolete | 27029 | ./usr/share/man/man9/malloc_roundup.9 comp-obsolete obsolete | |
27030 | ./usr/share/man/man9/malloc_type_attach.9 comp-sys-man .man | 27030 | ./usr/share/man/man9/malloc_type_attach.9 comp-sys-man .man | |
27031 | ./usr/share/man/man9/malloc_type_detach.9 comp-sys-man .man | 27031 | ./usr/share/man/man9/malloc_type_detach.9 comp-sys-man .man | |
27032 | ./usr/share/man/man9/malloc_type_setlimit.9 comp-obsolete obsolete | 27032 | ./usr/share/man/man9/malloc_type_setlimit.9 comp-obsolete obsolete | |
27033 | ./usr/share/man/man9/mb.9 comp-sys-man .man | 27033 | ./usr/share/man/man9/mb.9 comp-sys-man .man | |
27034 | ./usr/share/man/man9/mb_memory.9 comp-sys-man .man | 27034 | ./usr/share/man/man9/mb_memory.9 comp-sys-man .man | |
27035 | ./usr/share/man/man9/mb_read.9 comp-sys-man .man | 27035 | ./usr/share/man/man9/mb_read.9 comp-sys-man .man | |
27036 | ./usr/share/man/man9/mb_write.9 comp-sys-man .man | 27036 | ./usr/share/man/man9/mb_write.9 comp-sys-man .man | |
27037 | ./usr/share/man/man9/mbuf.9 comp-sys-man .man | 27037 | ./usr/share/man/man9/mbuf.9 comp-sys-man .man |
--- src/share/man/man9/Makefile 2018/10/05 09:51:55 1.431
+++ src/share/man/man9/Makefile 2018/11/15 10:06:06 1.432
--- src/share/man/man9/m_tag.9 2018/11/15 09:38:57 1.6
+++ src/share/man/man9/m_tag.9 2018/11/15 10:06:06 1.7
--- src/sys/kern/uipc_mbuf.c 2018/11/15 09:38:57 1.221
+++ src/sys/kern/uipc_mbuf.c 2018/11/15 10:06:07 1.222
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: uipc_mbuf.c,v 1.221 2018/11/15 09:38:57 maxv Exp $ */ | 1 | /* $NetBSD: uipc_mbuf.c,v 1.222 2018/11/15 10:06:07 maxv Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, | 8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, | |
9 | * NASA Ames Research Center. | 9 | * NASA Ames Research Center. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -52,27 +52,27 @@ | @@ -52,27 +52,27 @@ | |||
52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
59 | * SUCH DAMAGE. | 59 | * SUCH DAMAGE. | |
60 | * | 60 | * | |
61 | * @(#)uipc_mbuf.c 8.4 (Berkeley) 2/14/95 | 61 | * @(#)uipc_mbuf.c 8.4 (Berkeley) 2/14/95 | |
62 | */ | 62 | */ | |
63 | 63 | |||
64 | #include <sys/cdefs.h> | 64 | #include <sys/cdefs.h> | |
65 | __KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.221 2018/11/15 09:38:57 maxv Exp $"); | 65 | __KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.222 2018/11/15 10:06:07 maxv Exp $"); | |
66 | 66 | |||
67 | #ifdef _KERNEL_OPT | 67 | #ifdef _KERNEL_OPT | |
68 | #include "opt_mbuftrace.h" | 68 | #include "opt_mbuftrace.h" | |
69 | #include "opt_nmbclusters.h" | 69 | #include "opt_nmbclusters.h" | |
70 | #include "opt_ddb.h" | 70 | #include "opt_ddb.h" | |
71 | #include "ether.h" | 71 | #include "ether.h" | |
72 | #endif | 72 | #endif | |
73 | 73 | |||
74 | #include <sys/param.h> | 74 | #include <sys/param.h> | |
75 | #include <sys/systm.h> | 75 | #include <sys/systm.h> | |
76 | #include <sys/atomic.h> | 76 | #include <sys/atomic.h> | |
77 | #include <sys/cpu.h> | 77 | #include <sys/cpu.h> | |
78 | #include <sys/proc.h> | 78 | #include <sys/proc.h> | |
@@ -1711,51 +1711,53 @@ m_defrag(struct mbuf *m, int how) | @@ -1711,51 +1711,53 @@ m_defrag(struct mbuf *m, int how) | |||
1711 | } while (sz > 0); | 1711 | } while (sz > 0); | |
1712 | 1712 | |||
1713 | m_freem(m->m_next); | 1713 | m_freem(m->m_next); | |
1714 | m->m_next = m0; | 1714 | m->m_next = m0; | |
1715 | 1715 | |||
1716 | return m; | 1716 | return m; | |
1717 | } | 1717 | } | |
1718 | 1718 | |||
1719 | void | 1719 | void | |
1720 | m_remove_pkthdr(struct mbuf *m) | 1720 | m_remove_pkthdr(struct mbuf *m) | |
1721 | { | 1721 | { | |
1722 | KASSERT(m->m_flags & M_PKTHDR); | 1722 | KASSERT(m->m_flags & M_PKTHDR); | |
1723 | 1723 | |||
1724 | m_tag_delete_chain(m, NULL); | 1724 | m_tag_delete_chain(m); | |
1725 | m->m_flags &= ~M_PKTHDR; | 1725 | m->m_flags &= ~M_PKTHDR; | |
1726 | memset(&m->m_pkthdr, 0, sizeof(m->m_pkthdr)); | 1726 | memset(&m->m_pkthdr, 0, sizeof(m->m_pkthdr)); | |
1727 | } | 1727 | } | |
1728 | 1728 | |||
1729 | void | 1729 | void | |
1730 | m_copy_pkthdr(struct mbuf *to, struct mbuf *from) | 1730 | m_copy_pkthdr(struct mbuf *to, struct mbuf *from) | |
1731 | { | 1731 | { | |
1732 | KASSERT((to->m_flags & M_EXT) == 0); | 1732 | KASSERT((to->m_flags & M_EXT) == 0); | |
1733 | KASSERT((to->m_flags & M_PKTHDR) == 0 || m_tag_first(to) == NULL); | 1733 | KASSERT((to->m_flags & M_PKTHDR) == 0 || | |
1734 | SLIST_FIRST(&to->m_pkthdr.tags) == NULL); | |||
1734 | KASSERT((from->m_flags & M_PKTHDR) != 0); | 1735 | KASSERT((from->m_flags & M_PKTHDR) != 0); | |
1735 | 1736 | |||
1736 | to->m_pkthdr = from->m_pkthdr; | 1737 | to->m_pkthdr = from->m_pkthdr; | |
1737 | to->m_flags = from->m_flags & M_COPYFLAGS; | 1738 | to->m_flags = from->m_flags & M_COPYFLAGS; | |
1738 | to->m_data = to->m_pktdat; | 1739 | to->m_data = to->m_pktdat; | |
1739 | 1740 | |||
1740 | SLIST_INIT(&to->m_pkthdr.tags); | 1741 | SLIST_INIT(&to->m_pkthdr.tags); | |
1741 | m_tag_copy_chain(to, from); | 1742 | m_tag_copy_chain(to, from); | |
1742 | } | 1743 | } | |
1743 | 1744 | |||
1744 | void | 1745 | void | |
1745 | m_move_pkthdr(struct mbuf *to, struct mbuf *from) | 1746 | m_move_pkthdr(struct mbuf *to, struct mbuf *from) | |
1746 | { | 1747 | { | |
1747 | KASSERT((to->m_flags & M_EXT) == 0); | 1748 | KASSERT((to->m_flags & M_EXT) == 0); | |
1748 | KASSERT((to->m_flags & M_PKTHDR) == 0 || m_tag_first(to) == NULL); | 1749 | KASSERT((to->m_flags & M_PKTHDR) == 0 || | |
1750 | SLIST_FIRST(&to->m_pkthdr.tags) == NULL); | |||
1749 | KASSERT((from->m_flags & M_PKTHDR) != 0); | 1751 | KASSERT((from->m_flags & M_PKTHDR) != 0); | |
1750 | 1752 | |||
1751 | to->m_pkthdr = from->m_pkthdr; | 1753 | to->m_pkthdr = from->m_pkthdr; | |
1752 | to->m_flags = from->m_flags & M_COPYFLAGS; | 1754 | to->m_flags = from->m_flags & M_COPYFLAGS; | |
1753 | to->m_data = to->m_pktdat; | 1755 | to->m_data = to->m_pktdat; | |
1754 | 1756 | |||
1755 | from->m_flags &= ~M_PKTHDR; | 1757 | from->m_flags &= ~M_PKTHDR; | |
1756 | } | 1758 | } | |
1757 | 1759 | |||
1758 | /* | 1760 | /* | |
1759 | * Apply function f to the data in an mbuf chain starting "off" bytes from the | 1761 | * Apply function f to the data in an mbuf chain starting "off" bytes from the | |
1760 | * beginning, continuing for "len" bytes. | 1762 | * beginning, continuing for "len" bytes. | |
1761 | */ | 1763 | */ | |
@@ -1895,27 +1897,27 @@ m_ext_free(struct mbuf *m) | @@ -1895,27 +1897,27 @@ m_ext_free(struct mbuf *m) | |||
1895 | /* | 1897 | /* | |
1896 | * Free a single mbuf and associated external storage. Return the | 1898 | * Free a single mbuf and associated external storage. Return the | |
1897 | * successor, if any. | 1899 | * successor, if any. | |
1898 | */ | 1900 | */ | |
1899 | struct mbuf * | 1901 | struct mbuf * | |
1900 | m_free(struct mbuf *m) | 1902 | m_free(struct mbuf *m) | |
1901 | { | 1903 | { | |
1902 | struct mbuf *n; | 1904 | struct mbuf *n; | |
1903 | 1905 | |||
1904 | mowner_revoke(m, 1, m->m_flags); | 1906 | mowner_revoke(m, 1, m->m_flags); | |
1905 | mbstat_type_add(m->m_type, -1); | 1907 | mbstat_type_add(m->m_type, -1); | |
1906 | 1908 | |||
1907 | if (m->m_flags & M_PKTHDR) | 1909 | if (m->m_flags & M_PKTHDR) | |
1908 | m_tag_delete_chain(m, NULL); | 1910 | m_tag_delete_chain(m); | |
1909 | 1911 | |||
1910 | n = m->m_next; | 1912 | n = m->m_next; | |
1911 | 1913 | |||
1912 | if (m->m_flags & M_EXT) { | 1914 | if (m->m_flags & M_EXT) { | |
1913 | m_ext_free(m); | 1915 | m_ext_free(m); | |
1914 | } else { | 1916 | } else { | |
1915 | if (__predict_false(m->m_type == MT_FREE)) { | 1917 | if (__predict_false(m->m_type == MT_FREE)) { | |
1916 | panic("mbuf %p already freed", m); | 1918 | panic("mbuf %p already freed", m); | |
1917 | } | 1919 | } | |
1918 | m->m_type = MT_FREE; | 1920 | m->m_type = MT_FREE; | |
1919 | m->m_data = NULL; | 1921 | m->m_data = NULL; | |
1920 | pool_cache_put(mb_cache, m); | 1922 | pool_cache_put(mb_cache, m); | |
1921 | } | 1923 | } | |
@@ -2247,49 +2249,38 @@ void | @@ -2247,49 +2249,38 @@ void | |||
2247 | m_tag_unlink(struct mbuf *m, struct m_tag *t) | 2249 | m_tag_unlink(struct mbuf *m, struct m_tag *t) | |
2248 | { | 2250 | { | |
2249 | SLIST_REMOVE(&m->m_pkthdr.tags, t, m_tag, m_tag_link); | 2251 | SLIST_REMOVE(&m->m_pkthdr.tags, t, m_tag, m_tag_link); | |
2250 | } | 2252 | } | |
2251 | 2253 | |||
2252 | void | 2254 | void | |
2253 | m_tag_delete(struct mbuf *m, struct m_tag *t) | 2255 | m_tag_delete(struct mbuf *m, struct m_tag *t) | |
2254 | { | 2256 | { | |
2255 | m_tag_unlink(m, t); | 2257 | m_tag_unlink(m, t); | |
2256 | m_tag_free(t); | 2258 | m_tag_free(t); | |
2257 | } | 2259 | } | |
2258 | 2260 | |||
2259 | void | 2261 | void | |
2260 | m_tag_delete_chain(struct mbuf *m, struct m_tag *t) | 2262 | m_tag_delete_chain(struct mbuf *m) | |
2261 | { | 2263 | { | |
2262 | struct m_tag *p, *q; | 2264 | struct m_tag *p, *q; | |
2263 | 2265 | |||
2264 | if (t != NULL) | 2266 | p = SLIST_FIRST(&m->m_pkthdr.tags); | |
2265 | p = t; | |||
2266 | else | |||
2267 | p = SLIST_FIRST(&m->m_pkthdr.tags); | |||
2268 | if (p == NULL) | 2267 | if (p == NULL) | |
2269 | return; | 2268 | return; | |
2270 | while ((q = SLIST_NEXT(p, m_tag_link)) != NULL) | 2269 | while ((q = SLIST_NEXT(p, m_tag_link)) != NULL) | |
2271 | m_tag_delete(m, q); | 2270 | m_tag_delete(m, q); | |
2272 | m_tag_delete(m, p); | 2271 | m_tag_delete(m, p); | |
2273 | } | 2272 | } | |
2274 | 2273 | |||
2275 | void | |||
2276 | m_tag_delete_nonpersistent(struct mbuf *m) | |||
2277 | { | |||
2278 | /* NetBSD has no persistent tags yet, so just delete all tags. */ | |||
2279 | m_tag_delete_chain(m, NULL); | |||
2280 | } | |||
2281 | ||||
2282 | ||||
2283 | struct m_tag * | 2274 | struct m_tag * | |
2284 | m_tag_find(const struct mbuf *m, int type, struct m_tag *t) | 2275 | m_tag_find(const struct mbuf *m, int type, struct m_tag *t) | |
2285 | { | 2276 | { | |
2286 | struct m_tag *p; | 2277 | struct m_tag *p; | |
2287 | 2278 | |||
2288 | if (t == NULL) | 2279 | if (t == NULL) | |
2289 | p = SLIST_FIRST(&m->m_pkthdr.tags); | 2280 | p = SLIST_FIRST(&m->m_pkthdr.tags); | |
2290 | else | 2281 | else | |
2291 | p = SLIST_NEXT(t, m_tag_link); | 2282 | p = SLIST_NEXT(t, m_tag_link); | |
2292 | while (p != NULL) { | 2283 | while (p != NULL) { | |
2293 | if (p->m_tag_id == type) | 2284 | if (p->m_tag_id == type) | |
2294 | return p; | 2285 | return p; | |
2295 | p = SLIST_NEXT(p, m_tag_link); | 2286 | p = SLIST_NEXT(p, m_tag_link); | |
@@ -2310,46 +2301,28 @@ m_tag_copy(struct m_tag *t) | @@ -2310,46 +2301,28 @@ m_tag_copy(struct m_tag *t) | |||
2310 | } | 2301 | } | |
2311 | 2302 | |||
2312 | /* | 2303 | /* | |
2313 | * Copy two tag chains. The destination mbuf (to) loses any attached | 2304 | * Copy two tag chains. The destination mbuf (to) loses any attached | |
2314 | * tags even if the operation fails. This should not be a problem, as | 2305 | * tags even if the operation fails. This should not be a problem, as | |
2315 | * m_tag_copy_chain() is typically called with a newly-allocated | 2306 | * m_tag_copy_chain() is typically called with a newly-allocated | |
2316 | * destination mbuf. | 2307 | * destination mbuf. | |
2317 | */ | 2308 | */ | |
2318 | int | 2309 | int | |
2319 | m_tag_copy_chain(struct mbuf *to, struct mbuf *from) | 2310 | m_tag_copy_chain(struct mbuf *to, struct mbuf *from) | |
2320 | { | 2311 | { | |
2321 | struct m_tag *p, *t, *tprev = NULL; | 2312 | struct m_tag *p, *t, *tprev = NULL; | |
2322 | 2313 | |||
2323 | m_tag_delete_chain(to, NULL); | 2314 | m_tag_delete_chain(to); | |
2324 | SLIST_FOREACH(p, &from->m_pkthdr.tags, m_tag_link) { | 2315 | SLIST_FOREACH(p, &from->m_pkthdr.tags, m_tag_link) { | |
2325 | t = m_tag_copy(p); | 2316 | t = m_tag_copy(p); | |
2326 | if (t == NULL) { | 2317 | if (t == NULL) { | |
2327 | m_tag_delete_chain(to, NULL); | 2318 | m_tag_delete_chain(to); | |
2328 | return 0; | 2319 | return 0; | |
2329 | } | 2320 | } | |
2330 | if (tprev == NULL) | 2321 | if (tprev == NULL) | |
2331 | SLIST_INSERT_HEAD(&to->m_pkthdr.tags, t, m_tag_link); | 2322 | SLIST_INSERT_HEAD(&to->m_pkthdr.tags, t, m_tag_link); | |
2332 | else | 2323 | else | |
2333 | SLIST_INSERT_AFTER(tprev, t, m_tag_link); | 2324 | SLIST_INSERT_AFTER(tprev, t, m_tag_link); | |
2334 | tprev = t; | 2325 | tprev = t; | |
2335 | } | 2326 | } | |
2336 | return 1; | 2327 | return 1; | |
2337 | } | 2328 | } | |
2338 | ||||
2339 | void | |||
2340 | m_tag_init(struct mbuf *m) | |||
2341 | { | |||
2342 | SLIST_INIT(&m->m_pkthdr.tags); | |||
2343 | } | |||
2344 | ||||
2345 | struct m_tag * | |||
2346 | m_tag_first(struct mbuf *m) | |||
2347 | { | |||
2348 | return (SLIST_FIRST(&m->m_pkthdr.tags)); | |||
2349 | } | |||
2350 | ||||
2351 | struct m_tag * | |||
2352 | m_tag_next(struct mbuf *m, struct m_tag *t) | |||
2353 | { | |||
2354 | return (SLIST_NEXT(t, m_tag_link)); | |||
2355 | } |
--- src/sys/net/if_loop.c 2018/08/10 06:46:09 1.105
+++ src/sys/net/if_loop.c 2018/11/15 10:06:07 1.106
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: if_loop.c,v 1.105 2018/08/10 06:46:09 maxv Exp $ */ | 1 | /* $NetBSD: if_loop.c,v 1.106 2018/11/15 10:06:07 maxv Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | 4 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -55,27 +55,27 @@ | @@ -55,27 +55,27 @@ | |||
55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 55 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 56 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 57 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
58 | * SUCH DAMAGE. | 58 | * SUCH DAMAGE. | |
59 | * | 59 | * | |
60 | * @(#)if_loop.c 8.2 (Berkeley) 1/9/95 | 60 | * @(#)if_loop.c 8.2 (Berkeley) 1/9/95 | |
61 | */ | 61 | */ | |
62 | 62 | |||
63 | /* | 63 | /* | |
64 | * Loopback interface driver for protocol testing and timing. | 64 | * Loopback interface driver for protocol testing and timing. | |
65 | */ | 65 | */ | |
66 | 66 | |||
67 | #include <sys/cdefs.h> | 67 | #include <sys/cdefs.h> | |
68 | __KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.105 2018/08/10 06:46:09 maxv Exp $"); | 68 | __KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.106 2018/11/15 10:06:07 maxv Exp $"); | |
69 | 69 | |||
70 | #ifdef _KERNEL_OPT | 70 | #ifdef _KERNEL_OPT | |
71 | #include "opt_inet.h" | 71 | #include "opt_inet.h" | |
72 | #include "opt_atalk.h" | 72 | #include "opt_atalk.h" | |
73 | #include "opt_mbuftrace.h" | 73 | #include "opt_mbuftrace.h" | |
74 | #include "opt_mpls.h" | 74 | #include "opt_mpls.h" | |
75 | #include "opt_net_mpsafe.h" | 75 | #include "opt_net_mpsafe.h" | |
76 | #endif | 76 | #endif | |
77 | 77 | |||
78 | #include <sys/param.h> | 78 | #include <sys/param.h> | |
79 | #include <sys/systm.h> | 79 | #include <sys/systm.h> | |
80 | #include <sys/kernel.h> | 80 | #include <sys/kernel.h> | |
81 | #include <sys/mbuf.h> | 81 | #include <sys/mbuf.h> | |
@@ -288,27 +288,27 @@ looutput(struct ifnet *ifp, struct mbuf | @@ -288,27 +288,27 @@ looutput(struct ifnet *ifp, struct mbuf | |||
288 | 288 | |||
289 | M_PREPEND(m, sizeof(uint32_t), M_DONTWAIT); | 289 | M_PREPEND(m, sizeof(uint32_t), M_DONTWAIT); | |
290 | if (m == NULL) { | 290 | if (m == NULL) { | |
291 | error = ENOBUFS; | 291 | error = ENOBUFS; | |
292 | goto out; | 292 | goto out; | |
293 | } | 293 | } | |
294 | *(mtod(m, uint32_t *)) = dst->sa_family; | 294 | *(mtod(m, uint32_t *)) = dst->sa_family; | |
295 | 295 | |||
296 | error = if_transmit_lock(ifp, m); | 296 | error = if_transmit_lock(ifp, m); | |
297 | goto out; | 297 | goto out; | |
298 | } | 298 | } | |
299 | #endif /* ALTQ */ | 299 | #endif /* ALTQ */ | |
300 | 300 | |||
301 | m_tag_delete_nonpersistent(m); | 301 | m_tag_delete_chain(m); | |
302 | 302 | |||
303 | #ifdef MPLS | 303 | #ifdef MPLS | |
304 | if (rt != NULL && rt_gettag(rt) != NULL && | 304 | if (rt != NULL && rt_gettag(rt) != NULL && | |
305 | rt_gettag(rt)->sa_family == AF_MPLS && | 305 | rt_gettag(rt)->sa_family == AF_MPLS && | |
306 | (m->m_flags & (M_MCAST | M_BCAST)) == 0) { | 306 | (m->m_flags & (M_MCAST | M_BCAST)) == 0) { | |
307 | union mpls_shim msh; | 307 | union mpls_shim msh; | |
308 | msh.s_addr = MPLS_GETSADDR(rt); | 308 | msh.s_addr = MPLS_GETSADDR(rt); | |
309 | if (msh.shim.label != MPLS_LABEL_IMPLNULL) { | 309 | if (msh.shim.label != MPLS_LABEL_IMPLNULL) { | |
310 | ifq = &mplsintrq; | 310 | ifq = &mplsintrq; | |
311 | isr = NETISR_MPLS; | 311 | isr = NETISR_MPLS; | |
312 | } | 312 | } | |
313 | } | 313 | } | |
314 | if (isr != NETISR_MPLS) | 314 | if (isr != NETISR_MPLS) |
--- src/sys/netcan/can.c 2018/06/26 06:48:03 1.4
+++ src/sys/netcan/can.c 2018/11/15 10:06:07 1.5
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: can.c,v 1.4 2018/06/26 06:48:03 msaitoh Exp $ */ | 1 | /* $NetBSD: can.c,v 1.5 2018/11/15 10:06:07 maxv Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2003, 2017 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2003, 2017 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Robert Swindells and Manuel Bouyer | 8 | * by Robert Swindells and Manuel Bouyer | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | 29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | 30 | */ | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | __KERNEL_RCSID(0, "$NetBSD: can.c,v 1.4 2018/06/26 06:48:03 msaitoh Exp $"); | 33 | __KERNEL_RCSID(0, "$NetBSD: can.c,v 1.5 2018/11/15 10:06:07 maxv Exp $"); | |
34 | 34 | |||
35 | #include <sys/param.h> | 35 | #include <sys/param.h> | |
36 | #include <sys/systm.h> | 36 | #include <sys/systm.h> | |
37 | #include <sys/mbuf.h> | 37 | #include <sys/mbuf.h> | |
38 | #include <sys/ioctl.h> | 38 | #include <sys/ioctl.h> | |
39 | #include <sys/domain.h> | 39 | #include <sys/domain.h> | |
40 | #include <sys/protosw.h> | 40 | #include <sys/protosw.h> | |
41 | #include <sys/errno.h> | 41 | #include <sys/errno.h> | |
42 | #include <sys/socket.h> | 42 | #include <sys/socket.h> | |
43 | #include <sys/socketvar.h> | 43 | #include <sys/socketvar.h> | |
44 | #include <sys/proc.h> | 44 | #include <sys/proc.h> | |
45 | #include <sys/kauth.h> | 45 | #include <sys/kauth.h> | |
46 | 46 | |||
@@ -261,27 +261,27 @@ can_output(struct mbuf *m, struct canpcb | @@ -261,27 +261,27 @@ can_output(struct mbuf *m, struct canpcb | |||
261 | 261 | |||
262 | /* | 262 | /* | |
263 | * cleanup mbuf tag, keeping the PACKET_TAG_SO tag | 263 | * cleanup mbuf tag, keeping the PACKET_TAG_SO tag | |
264 | */ | 264 | */ | |
265 | void | 265 | void | |
266 | can_mbuf_tag_clean(struct mbuf *m) | 266 | can_mbuf_tag_clean(struct mbuf *m) | |
267 | { | 267 | { | |
268 | struct m_tag *sotag; | 268 | struct m_tag *sotag; | |
269 | 269 | |||
270 | sotag = m_tag_find(m, PACKET_TAG_SO, NULL); | 270 | sotag = m_tag_find(m, PACKET_TAG_SO, NULL); | |
271 | if (sotag) | 271 | if (sotag) | |
272 | m_tag_unlink(m, sotag); | 272 | m_tag_unlink(m, sotag); | |
273 | 273 | |||
274 | m_tag_delete_nonpersistent(m); | 274 | m_tag_delete_chain(m); | |
275 | if (sotag) | 275 | if (sotag) | |
276 | m_tag_prepend(m, sotag); | 276 | m_tag_prepend(m, sotag); | |
277 | } | 277 | } | |
278 | 278 | |||
279 | /* | 279 | /* | |
280 | * Process a received CAN frame | 280 | * Process a received CAN frame | |
281 | * the packet is in the mbuf chain m with | 281 | * the packet is in the mbuf chain m with | |
282 | * the CAN header. | 282 | * the CAN header. | |
283 | */ | 283 | */ | |
284 | void | 284 | void | |
285 | can_input(struct ifnet *ifp, struct mbuf *m) | 285 | can_input(struct ifnet *ifp, struct mbuf *m) | |
286 | { | 286 | { | |
287 | struct ifqueue *inq; | 287 | struct ifqueue *inq; |
--- src/sys/netinet/ip_icmp.c 2018/09/14 05:09:51 1.174
+++ src/sys/netinet/ip_icmp.c 2018/11/15 10:06:07 1.175
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ip_icmp.c,v 1.174 2018/09/14 05:09:51 maxv Exp $ */ | 1 | /* $NetBSD: ip_icmp.c,v 1.175 2018/11/15 10:06:07 maxv Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Public Access Networks Corporation ("Panix"). It was developed under | 8 | * by Public Access Networks Corporation ("Panix"). It was developed under | |
9 | * contract to Panix by Eric Haszlakiewicz and Thor Lancelot Simon. | 9 | * contract to Panix by Eric Haszlakiewicz and Thor Lancelot Simon. | |
10 | * | 10 | * | |
11 | * This code is derived from software contributed to The NetBSD Foundation | 11 | * This code is derived from software contributed to The NetBSD Foundation | |
12 | * by Jason R. Thorpe of Zembu Labs, Inc. | 12 | * by Jason R. Thorpe of Zembu Labs, Inc. | |
13 | * | 13 | * | |
14 | * Redistribution and use in source and binary forms, with or without | 14 | * Redistribution and use in source and binary forms, with or without | |
@@ -84,27 +84,27 @@ | @@ -84,27 +84,27 @@ | |||
84 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 84 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
85 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 85 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
86 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 86 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
87 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 87 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
88 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 88 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
89 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 89 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
90 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 90 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
91 | * SUCH DAMAGE. | 91 | * SUCH DAMAGE. | |
92 | * | 92 | * | |
93 | * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 | 93 | * @(#)ip_icmp.c 8.2 (Berkeley) 1/4/94 | |
94 | */ | 94 | */ | |
95 | 95 | |||
96 | #include <sys/cdefs.h> | 96 | #include <sys/cdefs.h> | |
97 | __KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.174 2018/09/14 05:09:51 maxv Exp $"); | 97 | __KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.175 2018/11/15 10:06:07 maxv Exp $"); | |
98 | 98 | |||
99 | #ifdef _KERNEL_OPT | 99 | #ifdef _KERNEL_OPT | |
100 | #include "opt_ipsec.h" | 100 | #include "opt_ipsec.h" | |
101 | #endif | 101 | #endif | |
102 | 102 | |||
103 | #include <sys/param.h> | 103 | #include <sys/param.h> | |
104 | #include <sys/systm.h> | 104 | #include <sys/systm.h> | |
105 | #include <sys/mbuf.h> | 105 | #include <sys/mbuf.h> | |
106 | #include <sys/protosw.h> | 106 | #include <sys/protosw.h> | |
107 | #include <sys/socket.h> | 107 | #include <sys/socket.h> | |
108 | #include <sys/socketvar.h> /* For softnet_lock */ | 108 | #include <sys/socketvar.h> /* For softnet_lock */ | |
109 | #include <sys/kmem.h> | 109 | #include <sys/kmem.h> | |
110 | #include <sys/time.h> | 110 | #include <sys/time.h> | |
@@ -909,27 +909,27 @@ icmp_reflect(struct mbuf *m) | @@ -909,27 +909,27 @@ icmp_reflect(struct mbuf *m) | |||
909 | /* | 909 | /* | |
910 | * Now strip out original options by copying rest of first | 910 | * Now strip out original options by copying rest of first | |
911 | * mbuf's data back, and adjust the IP length. | 911 | * mbuf's data back, and adjust the IP length. | |
912 | */ | 912 | */ | |
913 | ip->ip_len = htons(ntohs(ip->ip_len) - optlen); | 913 | ip->ip_len = htons(ntohs(ip->ip_len) - optlen); | |
914 | ip->ip_hl = sizeof(struct ip) >> 2; | 914 | ip->ip_hl = sizeof(struct ip) >> 2; | |
915 | m->m_len -= optlen; | 915 | m->m_len -= optlen; | |
916 | if (m->m_flags & M_PKTHDR) | 916 | if (m->m_flags & M_PKTHDR) | |
917 | m->m_pkthdr.len -= optlen; | 917 | m->m_pkthdr.len -= optlen; | |
918 | optlen += sizeof(struct ip); | 918 | optlen += sizeof(struct ip); | |
919 | memmove(ip + 1, (char *)ip + optlen, | 919 | memmove(ip + 1, (char *)ip + optlen, | |
920 | (unsigned)(m->m_len - sizeof(struct ip))); | 920 | (unsigned)(m->m_len - sizeof(struct ip))); | |
921 | } | 921 | } | |
922 | m_tag_delete_nonpersistent(m); | 922 | m_tag_delete_chain(m); | |
923 | m->m_flags &= ~(M_BCAST|M_MCAST); | 923 | m->m_flags &= ~(M_BCAST|M_MCAST); | |
924 | 924 | |||
925 | /* | 925 | /* | |
926 | * Clear any in-bound checksum flags for this packet. | 926 | * Clear any in-bound checksum flags for this packet. | |
927 | */ | 927 | */ | |
928 | if (m->m_flags & M_PKTHDR) | 928 | if (m->m_flags & M_PKTHDR) | |
929 | m->m_pkthdr.csum_flags = 0; | 929 | m->m_pkthdr.csum_flags = 0; | |
930 | 930 | |||
931 | icmp_send(m, opts); | 931 | icmp_send(m, opts); | |
932 | done: | 932 | done: | |
933 | curlwp_bindx(bound); | 933 | curlwp_bindx(bound); | |
934 | if (opts) | 934 | if (opts) | |
935 | (void)m_free(opts); | 935 | (void)m_free(opts); |
--- src/sys/sys/mbuf.h 2018/10/12 05:49:38 1.211
+++ src/sys/sys/mbuf.h 2018/11/15 10:06:07 1.212
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mbuf.h,v 1.211 2018/10/12 05:49:38 msaitoh Exp $ */ | 1 | /* $NetBSD: mbuf.h,v 1.212 2018/11/15 10:06:07 maxv Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, | 8 | * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, | |
9 | * NASA Ames Research Center and Matt Thomas of 3am Software Foundry. | 9 | * NASA Ames Research Center and Matt Thomas of 3am Software Foundry. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -808,34 +808,30 @@ struct mbuf *m_add(struct mbuf *, struct | @@ -808,34 +808,30 @@ struct mbuf *m_add(struct mbuf *, struct | |||
808 | 808 | |||
809 | /* Inline routines. */ | 809 | /* Inline routines. */ | |
810 | static __inline u_int m_length(const struct mbuf *) __unused; | 810 | static __inline u_int m_length(const struct mbuf *) __unused; | |
811 | 811 | |||
812 | /* Statistics */ | 812 | /* Statistics */ | |
813 | void mbstat_type_add(int, int); | 813 | void mbstat_type_add(int, int); | |
814 | 814 | |||
815 | /* Packet tag routines */ | 815 | /* Packet tag routines */ | |
816 | struct m_tag *m_tag_get(int, int, int); | 816 | struct m_tag *m_tag_get(int, int, int); | |
817 | void m_tag_free(struct m_tag *); | 817 | void m_tag_free(struct m_tag *); | |
818 | void m_tag_prepend(struct mbuf *, struct m_tag *); | 818 | void m_tag_prepend(struct mbuf *, struct m_tag *); | |
819 | void m_tag_unlink(struct mbuf *, struct m_tag *); | 819 | void m_tag_unlink(struct mbuf *, struct m_tag *); | |
820 | void m_tag_delete(struct mbuf *, struct m_tag *); | 820 | void m_tag_delete(struct mbuf *, struct m_tag *); | |
821 | void m_tag_delete_chain(struct mbuf *, struct m_tag *); | 821 | void m_tag_delete_chain(struct mbuf *); | |
822 | void m_tag_delete_nonpersistent(struct mbuf *); | |||
823 | struct m_tag *m_tag_find(const struct mbuf *, int, struct m_tag *); | 822 | struct m_tag *m_tag_find(const struct mbuf *, int, struct m_tag *); | |
824 | struct m_tag *m_tag_copy(struct m_tag *); | 823 | struct m_tag *m_tag_copy(struct m_tag *); | |
825 | int m_tag_copy_chain(struct mbuf *, struct mbuf *); | 824 | int m_tag_copy_chain(struct mbuf *, struct mbuf *); | |
826 | void m_tag_init(struct mbuf *); | |||
827 | struct m_tag *m_tag_first(struct mbuf *); | |||
828 | struct m_tag *m_tag_next(struct mbuf *, struct m_tag *); | |||
829 | 825 | |||
830 | /* Packet tag types */ | 826 | /* Packet tag types */ | |
831 | #define PACKET_TAG_NONE 0 /* Nothing */ | 827 | #define PACKET_TAG_NONE 0 /* Nothing */ | |
832 | #define PACKET_TAG_SO 4 /* sending socket pointer */ | 828 | #define PACKET_TAG_SO 4 /* sending socket pointer */ | |
833 | #define PACKET_TAG_PF 11 /* packet filter */ | 829 | #define PACKET_TAG_PF 11 /* packet filter */ | |
834 | #define PACKET_TAG_ALTQ_QID 12 /* ALTQ queue id */ | 830 | #define PACKET_TAG_ALTQ_QID 12 /* ALTQ queue id */ | |
835 | #define PACKET_TAG_IPSEC_OUT_DONE 18 | 831 | #define PACKET_TAG_IPSEC_OUT_DONE 18 | |
836 | #define PACKET_TAG_IPSEC_NAT_T_PORTS 25 /* two uint16_t */ | 832 | #define PACKET_TAG_IPSEC_NAT_T_PORTS 25 /* two uint16_t */ | |
837 | #define PACKET_TAG_INET6 26 /* IPv6 info */ | 833 | #define PACKET_TAG_INET6 26 /* IPv6 info */ | |
838 | #define PACKET_TAG_TUNNEL_INFO 28 /* tunnel identification and | 834 | #define PACKET_TAG_TUNNEL_INFO 28 /* tunnel identification and | |
839 | * protocol callback, for | 835 | * protocol callback, for | |
840 | * loop detection/recovery | 836 | * loop detection/recovery | |
841 | */ | 837 | */ |