Page MenuHomeFreeBSD

D33680.diff
No OneTemporary

D33680.diff

diff --git a/share/man/man9/mbuf_tags.9 b/share/man/man9/mbuf_tags.9
--- a/share/man/man9/mbuf_tags.9
+++ b/share/man/man9/mbuf_tags.9
@@ -20,7 +20,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 12, 2008
+.Dd December 28, 2021
.Dt MBUF_TAGS 9
.Os
.Sh NAME
@@ -29,7 +29,7 @@
.Sh SYNOPSIS
.In sys/mbuf.h
.Ft "struct m_tag *"
-.Fn m_tag_alloc "uint32_t cookie" "int type" "int len" "int wait"
+.Fn m_tag_alloc "uint32_t cookie" "uint16_t type" "int len" "int wait"
.Ft "struct m_tag *"
.Fn m_tag_copy "struct m_tag *t" "int how"
.Ft int
@@ -41,17 +41,17 @@
.Ft void
.Fn m_tag_delete_nonpersistent "struct mbuf *m"
.Ft "struct m_tag *"
-.Fn m_tag_find "struct mbuf *m" "int type" "struct m_tag *start"
+.Fn m_tag_find "struct mbuf *m" "uint16_t type" "struct m_tag *start"
.Ft "struct m_tag *"
.Fn m_tag_first "struct mbuf *m"
.Ft void
.Fn m_tag_free "struct m_tag *t"
.Ft "struct m_tag *"
-.Fn m_tag_get "int type" "int len" "int wait"
+.Fn m_tag_get "uint16_t type" "int len" "int wait"
.Ft void
.Fn m_tag_init "struct mbuf *m"
.Ft struct m_tag *
-.Fn m_tag_locate "struct mbuf *m" "uint32_t cookie" "int type" "struct m_tag *t"
+.Fn m_tag_locate "struct mbuf *m" "uint32_t cookie" "uint16_t type" "struct m_tag *t"
.Ft "struct m_tag *"
.Fn m_tag_next "struct mbuf *m" "struct m_tag *t"
.Ft void
diff --git a/sys/kern/uipc_mbuf2.c b/sys/kern/uipc_mbuf2.c
--- a/sys/kern/uipc_mbuf2.c
+++ b/sys/kern/uipc_mbuf2.c
@@ -314,7 +314,7 @@
/* Get a packet tag structure along with specified data following. */
struct m_tag *
-m_tag_alloc(uint32_t cookie, int type, int len, int wait)
+m_tag_alloc(uint32_t cookie, uint16_t type, int len, int wait)
{
struct m_tag *t;
@@ -376,7 +376,7 @@
/* Find a tag, starting from a given position. */
struct m_tag *
-m_tag_locate(struct mbuf *m, uint32_t cookie, int type, struct m_tag *t)
+m_tag_locate(struct mbuf *m, uint32_t cookie, uint16_t type, struct m_tag *t)
{
struct m_tag *p;
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1369,11 +1369,12 @@
/* Specific cookies and tags. */
/* Packet tag routines. */
-struct m_tag *m_tag_alloc(u_int32_t, int, int, int);
+struct m_tag *m_tag_alloc(uint32_t, uint16_t, int, int);
void m_tag_delete(struct mbuf *, struct m_tag *);
void m_tag_delete_chain(struct mbuf *, struct m_tag *);
void m_tag_free_default(struct m_tag *);
-struct m_tag *m_tag_locate(struct mbuf *, u_int32_t, int, struct m_tag *);
+struct m_tag *m_tag_locate(struct mbuf *, uint32_t, uint16_t,
+ struct m_tag *);
struct m_tag *m_tag_copy(struct m_tag *, int);
int m_tag_copy_chain(struct mbuf *, const struct mbuf *, int);
void m_tag_delete_nonpersistent(struct mbuf *);
@@ -1395,7 +1396,7 @@
* XXX probably should be called m_tag_init, but that was already taken.
*/
static __inline void
-m_tag_setup(struct m_tag *t, u_int32_t cookie, int type, int len)
+m_tag_setup(struct m_tag *t, uint32_t cookie, uint16_t type, int len)
{
t->m_tag_id = type;
@@ -1457,13 +1458,13 @@
#define MTAG_ABI_COMPAT 0 /* compatibility ABI */
static __inline struct m_tag *
-m_tag_get(int type, int length, int wait)
+m_tag_get(uint16_t type, int length, int wait)
{
return (m_tag_alloc(MTAG_ABI_COMPAT, type, length, wait));
}
static __inline struct m_tag *
-m_tag_find(struct mbuf *m, int type, struct m_tag *start)
+m_tag_find(struct mbuf *m, uint16_t type, struct m_tag *start)
{
return (SLIST_EMPTY(&m->m_pkthdr.tags) ? (struct m_tag *)NULL :
m_tag_locate(m, MTAG_ABI_COMPAT, type, start));

File Metadata

Mime Type
text/plain
Expires
Tue, Jan 21, 1:06 PM (21 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16011348
Default Alt Text
D33680.diff (3 KB)

Event Timeline