Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Remove the 't' argument from m_tag_find().
details: https://anonhg.NetBSD.org/src/rev/d8ab65c0ddd5
branches: trunk
changeset: 445865:d8ab65c0ddd5
user: maxv <maxv%NetBSD.org@localhost>
date: Thu Nov 15 10:23:55 2018 +0000
description:
Remove the 't' argument from m_tag_find().
diffstat:
share/man/man9/m_tag.9 | 13 +++----------
sys/altq/altq_cbq.c | 6 +++---
sys/altq/altq_hfsc.c | 6 +++---
sys/altq/altq_priq.c | 6 +++---
sys/altq/altq_red.c | 6 +++---
sys/dev/ieee1394/if_fwip.c | 6 +++---
sys/dist/pf/net/pf_mtag.c | 8 ++++----
sys/kern/uipc_mbuf.c | 11 ++++-------
sys/net/if.c | 6 +++---
sys/net/if_ethersubr.c | 6 +++---
sys/net/if_ieee1394subr.c | 9 ++++-----
sys/net/npf/npf_mbuf.c | 4 ++--
sys/netcan/can.c | 8 ++++----
sys/netinet/ip_icmp.c | 6 +++---
sys/netinet/ip_input.c | 6 +++---
sys/netinet6/ip6_input.c | 10 +++++-----
sys/netipsec/ipsec.h | 4 ++--
sys/netipsec/ipsec_input.c | 6 +++---
sys/netipsec/ipsecif.c | 10 +++++-----
sys/sys/mbuf.h | 4 ++--
20 files changed, 65 insertions(+), 76 deletions(-)
diffs (truncated from 599 to 300 lines):
diff -r cf75df28809d -r d8ab65c0ddd5 share/man/man9/m_tag.9
--- a/share/man/man9/m_tag.9 Thu Nov 15 10:23:32 2018 +0000
+++ b/share/man/man9/m_tag.9 Thu Nov 15 10:23:55 2018 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: m_tag.9,v 1.7 2018/11/15 10:06:06 maxv Exp $
+.\" $NetBSD: m_tag.9,v 1.8 2018/11/15 10:23:55 maxv Exp $
.\"
.\" Copyright (c)2004 YAMAMOTO Takashi,
.\" All rights reserved.
@@ -56,7 +56,7 @@
.Ft void
.Fn m_tag_delete_chain "struct mbuf *m"
.Ft struct m_tag *
-.Fn m_tag_find "struct mbuf *m" "int type" "struct m_tag *t"
+.Fn m_tag_find "struct mbuf *m" "int type"
.Ft struct m_tag *
.Fn m_tag_copy "struct m_tag *m"
.Ft int
@@ -121,18 +121,11 @@
Unlink and free mbuf tags from the mbuf
.Fa m .
.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-.It Fn m_tag_find "m" "type" "t"
+.It Fn m_tag_find "m" "type"
Find an mbuf tag with type
.Fa type
-after the mbuf tag
-.Fa t
in the tag chain associated with the mbuf
.Fa m .
-If
-.Fa t
-is
-.Dv NULL ,
-search from the first mbuf tag.
If an mbuf tag is found, return a pointer to it.
Otherwise return
.Dv NULL .
diff -r cf75df28809d -r d8ab65c0ddd5 sys/altq/altq_cbq.c
--- a/sys/altq/altq_cbq.c Thu Nov 15 10:23:32 2018 +0000
+++ b/sys/altq/altq_cbq.c Thu Nov 15 10:23:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_cbq.c,v 1.31 2017/07/28 13:53:17 riastradh Exp $ */
+/* $NetBSD: altq_cbq.c,v 1.32 2018/11/15 10:23:55 maxv Exp $ */
/* $KAME: altq_cbq.c,v 1.21 2005/04/13 03:44:24 suz Exp $ */
/*
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.31 2017/07/28 13:53:17 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.32 2018/11/15 10:23:55 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -514,7 +514,7 @@
return (ENOBUFS);
}
cl = NULL;
- if ((t = m_tag_find(m, PACKET_TAG_ALTQ_QID, NULL)) != NULL)
+ if ((t = m_tag_find(m, PACKET_TAG_ALTQ_QID)) != NULL)
cl = clh_to_clp(cbqp, ((struct altq_tag *)(t+1))->qid);
#ifdef ALTQ3_COMPAT
else if (ifq->altq_flags & ALTQF_CLASSIFY)
diff -r cf75df28809d -r d8ab65c0ddd5 sys/altq/altq_hfsc.c
--- a/sys/altq/altq_hfsc.c Thu Nov 15 10:23:32 2018 +0000
+++ b/sys/altq/altq_hfsc.c Thu Nov 15 10:23:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_hfsc.c,v 1.27 2017/07/28 13:53:17 riastradh Exp $ */
+/* $NetBSD: altq_hfsc.c,v 1.28 2018/11/15 10:23:55 maxv Exp $ */
/* $KAME: altq_hfsc.c,v 1.26 2005/04/13 03:44:24 suz Exp $ */
/*
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.27 2017/07/28 13:53:17 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.28 2018/11/15 10:23:55 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -683,7 +683,7 @@
return (ENOBUFS);
}
cl = NULL;
- if ((t = m_tag_find(m, PACKET_TAG_ALTQ_QID, NULL)) != NULL)
+ if ((t = m_tag_find(m, PACKET_TAG_ALTQ_QID)) != NULL)
cl = clh_to_clp(hif, ((struct altq_tag *)(t+1))->qid);
#ifdef ALTQ3_COMPAT
else if ((ifq->altq_flags & ALTQF_CLASSIFY))
diff -r cf75df28809d -r d8ab65c0ddd5 sys/altq/altq_priq.c
--- a/sys/altq/altq_priq.c Thu Nov 15 10:23:32 2018 +0000
+++ b/sys/altq/altq_priq.c Thu Nov 15 10:23:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_priq.c,v 1.25 2018/06/15 08:34:18 mrg Exp $ */
+/* $NetBSD: altq_priq.c,v 1.26 2018/11/15 10:23:55 maxv Exp $ */
/* $KAME: altq_priq.c,v 1.13 2005/04/13 03:44:25 suz Exp $ */
/*
* Copyright (C) 2000-2003
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_priq.c,v 1.25 2018/06/15 08:34:18 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_priq.c,v 1.26 2018/11/15 10:23:55 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -442,7 +442,7 @@
return (ENOBUFS);
}
cl = NULL;
- if ((t = m_tag_find(m, PACKET_TAG_ALTQ_QID, NULL)) != NULL)
+ if ((t = m_tag_find(m, PACKET_TAG_ALTQ_QID)) != NULL)
cl = clh_to_clp(pif, ((struct altq_tag *)(t+1))->qid);
#ifdef ALTQ3_COMPAT
else if (ifq->altq_flags & ALTQF_CLASSIFY)
diff -r cf75df28809d -r d8ab65c0ddd5 sys/altq/altq_red.c
--- a/sys/altq/altq_red.c Thu Nov 15 10:23:32 2018 +0000
+++ b/sys/altq/altq_red.c Thu Nov 15 10:23:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: altq_red.c,v 1.30 2016/04/20 08:58:48 knakahara Exp $ */
+/* $NetBSD: altq_red.c,v 1.31 2018/11/15 10:23:55 maxv Exp $ */
/* $KAME: altq_red.c,v 1.20 2005/04/13 03:44:25 suz Exp $ */
/*
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: altq_red.c,v 1.30 2016/04/20 08:58:48 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_red.c,v 1.31 2018/11/15 10:23:55 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_altq.h"
@@ -527,7 +527,7 @@
void *hdr;
int af;
- t = m_tag_find(m, PACKET_TAG_ALTQ_QID, NULL);
+ t = m_tag_find(m, PACKET_TAG_ALTQ_QID);
if (t != NULL) {
at = (struct altq_tag *)(t + 1);
if (at == NULL)
diff -r cf75df28809d -r d8ab65c0ddd5 sys/dev/ieee1394/if_fwip.c
--- a/sys/dev/ieee1394/if_fwip.c Thu Nov 15 10:23:32 2018 +0000
+++ b/sys/dev/ieee1394/if_fwip.c Thu Nov 15 10:23:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_fwip.c,v 1.28 2018/09/03 16:29:31 riastradh Exp $ */
+/* $NetBSD: if_fwip.c,v 1.29 2018/11/15 10:23:55 maxv Exp $ */
/*-
* Copyright (c) 2004
* Doug Rabson
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_fwip.c,v 1.28 2018/09/03 16:29:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_fwip.c,v 1.29 2018/11/15 10:23:55 maxv Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -567,7 +567,7 @@
* discovery. If we don't have a link-level address,
* just stick the thing on the broadcast channel.
*/
- mtag = m_tag_find(m, MTAG_FIREWIRE_HWADDR, 0);
+ mtag = m_tag_find(m, MTAG_FIREWIRE_HWADDR);
if (mtag == NULL)
destfw = 0;
else
diff -r cf75df28809d -r d8ab65c0ddd5 sys/dist/pf/net/pf_mtag.c
--- a/sys/dist/pf/net/pf_mtag.c Thu Nov 15 10:23:32 2018 +0000
+++ b/sys/dist/pf/net/pf_mtag.c Thu Nov 15 10:23:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pf_mtag.c,v 1.2 2008/06/18 09:06:27 yamt Exp $ */
+/* $NetBSD: pf_mtag.c,v 1.3 2018/11/15 10:23:55 maxv Exp $ */
/* $OpenBSD: pf.c,v 1.504 2005/10/17 08:43:35 henning Exp $ */
/*
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pf_mtag.c,v 1.2 2008/06/18 09:06:27 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf_mtag.c,v 1.3 2018/11/15 10:23:55 maxv Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -51,7 +51,7 @@
{
struct m_tag *mtag;
- if ((mtag = m_tag_find(m, PACKET_TAG_PF, NULL)) == NULL)
+ if ((mtag = m_tag_find(m, PACKET_TAG_PF)) == NULL)
return (NULL);
return ((struct pf_mtag *)(mtag + 1));
@@ -62,7 +62,7 @@
{
struct m_tag *mtag;
- if ((mtag = m_tag_find(m, PACKET_TAG_PF, NULL)) == NULL) {
+ if ((mtag = m_tag_find(m, PACKET_TAG_PF)) == NULL) {
mtag = m_tag_get(PACKET_TAG_PF, sizeof(struct pf_mtag),
M_NOWAIT);
if (mtag == NULL)
diff -r cf75df28809d -r d8ab65c0ddd5 sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c Thu Nov 15 10:23:32 2018 +0000
+++ b/sys/kern/uipc_mbuf.c Thu Nov 15 10:23:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_mbuf.c,v 1.222 2018/11/15 10:06:07 maxv Exp $ */
+/* $NetBSD: uipc_mbuf.c,v 1.223 2018/11/15 10:23:55 maxv Exp $ */
/*
* Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.222 2018/11/15 10:06:07 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.223 2018/11/15 10:23:55 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_mbuftrace.h"
@@ -2272,14 +2272,11 @@
}
struct m_tag *
-m_tag_find(const struct mbuf *m, int type, struct m_tag *t)
+m_tag_find(const struct mbuf *m, int type)
{
struct m_tag *p;
- if (t == NULL)
- p = SLIST_FIRST(&m->m_pkthdr.tags);
- else
- p = SLIST_NEXT(t, m_tag_link);
+ p = SLIST_FIRST(&m->m_pkthdr.tags);
while (p != NULL) {
if (p->m_tag_id == type)
return p;
diff -r cf75df28809d -r d8ab65c0ddd5 sys/net/if.c
--- a/sys/net/if.c Thu Nov 15 10:23:32 2018 +0000
+++ b/sys/net/if.c Thu Nov 15 10:23:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if.c,v 1.440 2018/10/30 05:54:42 ozaki-r Exp $ */
+/* $NetBSD: if.c,v 1.441 2018/11/15 10:23:56 maxv Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.440 2018/10/30 05:54:42 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.441 2018/11/15 10:23:56 maxv Exp $");
#if defined(_KERNEL_OPT)
#include "opt_inet.h"
@@ -2860,7 +2860,7 @@
struct m_tag *mtag;
int *count;
- mtag = m_tag_find(m, PACKET_TAG_TUNNEL_INFO, NULL);
+ mtag = m_tag_find(m, PACKET_TAG_TUNNEL_INFO);
if (mtag != NULL) {
count = (int *)(mtag + 1);
if (++(*count) > limit) {
diff -r cf75df28809d -r d8ab65c0ddd5 sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c Thu Nov 15 10:23:32 2018 +0000
+++ b/sys/net/if_ethersubr.c Thu Nov 15 10:23:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ethersubr.c,v 1.270 2018/06/14 07:54:57 yamaguchi Exp $ */
+/* $NetBSD: if_ethersubr.c,v 1.271 2018/11/15 10:23:56 maxv Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.270 2018/06/14 07:54:57 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.271 2018/11/15 10:23:56 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -376,7 +376,7 @@
#ifdef MPLS
{
struct m_tag *mtag;
- mtag = m_tag_find(m, PACKET_TAG_MPLS, NULL);
+ mtag = m_tag_find(m, PACKET_TAG_MPLS);
if (mtag != NULL) {
/* Having the tag itself indicates it's MPLS */
etype = htons(ETHERTYPE_MPLS);
diff -r cf75df28809d -r d8ab65c0ddd5 sys/net/if_ieee1394subr.c
--- a/sys/net/if_ieee1394subr.c Thu Nov 15 10:23:32 2018 +0000
Home |
Main Index |
Thread Index |
Old Index