Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102610413
D47551.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D47551.diff
View Options
diff --git a/sys/netlink/ktest_netlink_message_writer.h b/sys/netlink/ktest_netlink_message_writer.h
--- a/sys/netlink/ktest_netlink_message_writer.h
+++ b/sys/netlink/ktest_netlink_message_writer.h
@@ -30,12 +30,12 @@
#if defined(_KERNEL) && defined(INVARIANTS)
-bool nlmsg_get_buf_wrapper(struct nl_writer *nw, u_int size, bool waitok);
+bool nlmsg_get_buf_wrapper(struct nl_writer *nw, size_t size, bool waitok);
#ifndef KTEST_CALLER
bool
-nlmsg_get_buf_wrapper(struct nl_writer *nw, u_int size, bool waitok)
+nlmsg_get_buf_wrapper(struct nl_writer *nw, size_t size, bool waitok)
{
return (nlmsg_get_buf(nw, size, waitok));
}
diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c
--- a/sys/netlink/netlink_domain.c
+++ b/sys/netlink/netlink_domain.c
@@ -566,7 +566,7 @@
struct nlpcb *nlp = sotonlpcb(so);
struct sockbuf *sb = &so->so_snd;
struct nl_buf *nb;
- u_int len;
+ size_t len;
int error;
MPASS(m == NULL && uio != NULL);
diff --git a/sys/netlink/netlink_glue.c b/sys/netlink/netlink_glue.c
--- a/sys/netlink/netlink_glue.c
+++ b/sys/netlink/netlink_glue.c
@@ -135,7 +135,8 @@
}
static bool
-nlmsg_refill_buffer_stub(struct nl_writer *nw __unused, int required_len __unused)
+nlmsg_refill_buffer_stub(struct nl_writer *nw __unused,
+ size_t required_len __unused)
{
return (false);
}
@@ -237,7 +238,7 @@
}
bool
-nlmsg_refill_buffer(struct nl_writer *nw, int required_len)
+nlmsg_refill_buffer(struct nl_writer *nw, size_t required_len)
{
return (_nl->nlmsg_refill_buffer(nw, required_len));
}
diff --git a/sys/netlink/netlink_message_writer.h b/sys/netlink/netlink_message_writer.h
--- a/sys/netlink/netlink_message_writer.h
+++ b/sys/netlink/netlink_message_writer.h
@@ -71,9 +71,9 @@
bool _nlmsg_flush(struct nl_writer *nw);
void _nlmsg_ignore_limit(struct nl_writer *nw);
-bool _nlmsg_refill_buffer(struct nl_writer *nw, u_int required_len);
-bool _nlmsg_add(struct nl_writer *nw, uint32_t portid, uint32_t seq, uint16_t type,
- uint16_t flags, uint32_t len);
+bool _nlmsg_refill_buffer(struct nl_writer *nw, size_t required_len);
+bool _nlmsg_add(struct nl_writer *nw, uint32_t portid, uint32_t seq,
+ uint16_t type, uint16_t flags, uint32_t len);
bool _nlmsg_end(struct nl_writer *nw);
void _nlmsg_abort(struct nl_writer *nw);
@@ -107,7 +107,7 @@
}
static inline bool
-nlmsg_refill_buffer(struct nl_writer *nw, int required_size)
+nlmsg_refill_buffer(struct nl_writer *nw, size_t required_size)
{
return (_nlmsg_refill_buffer(nw, required_size));
}
@@ -146,9 +146,9 @@
bool nlmsg_flush(struct nl_writer *nw);
void nlmsg_ignore_limit(struct nl_writer *nw);
-bool nlmsg_refill_buffer(struct nl_writer *nw, int required_size);
-bool nlmsg_add(struct nl_writer *nw, uint32_t portid, uint32_t seq, uint16_t type,
- uint16_t flags, uint32_t len);
+bool nlmsg_refill_buffer(struct nl_writer *nw, size_t required_size);
+bool nlmsg_add(struct nl_writer *nw, uint32_t portid, uint32_t seq,
+ uint16_t type, uint16_t flags, uint32_t len);
bool nlmsg_end(struct nl_writer *nw);
void nlmsg_abort(struct nl_writer *nw);
diff --git a/sys/netlink/netlink_message_writer.c b/sys/netlink/netlink_message_writer.c
--- a/sys/netlink/netlink_message_writer.c
+++ b/sys/netlink/netlink_message_writer.c
@@ -45,13 +45,13 @@
_DECLARE_DEBUG(LOG_INFO);
static bool
-nlmsg_get_buf(struct nl_writer *nw, u_int len, bool waitok)
+nlmsg_get_buf(struct nl_writer *nw, size_t len, bool waitok)
{
const int mflag = waitok ? M_WAITOK : M_NOWAIT;
MPASS(nw->buf == NULL);
- NL_LOG(LOG_DEBUG3, "Setting up nw %p len %u %s", nw, len,
+ NL_LOG(LOG_DEBUG3, "Setting up nw %p len %zu %s", nw, len,
waitok ? "wait" : "nowait");
nw->buf = nl_buf_alloc(len, mflag);
@@ -139,17 +139,17 @@
* Return true on success.
*/
bool
-_nlmsg_refill_buffer(struct nl_writer *nw, u_int required_len)
+_nlmsg_refill_buffer(struct nl_writer *nw, size_t required_len)
{
struct nl_buf *new;
- u_int completed_len, new_len, last_len;
+ size_t completed_len, new_len, last_len;
MPASS(nw->buf != NULL);
if (nw->enomem)
return (false);
- NL_LOG(LOG_DEBUG3, "no space at offset %u/%u (want %u), trying to "
+ NL_LOG(LOG_DEBUG3, "no space at offset %u/%u (want %zu), trying to "
"reclaim", nw->buf->datalen, nw->buf->buflen, required_len);
/* Calculate new buffer size and allocate it. */
@@ -182,7 +182,7 @@
new->datalen = last_len;
}
- NL_LOG(LOG_DEBUG2, "completed: %u bytes, copied: %u bytes",
+ NL_LOG(LOG_DEBUG2, "completed: %zu bytes, copied: %zu bytes",
completed_len, last_len);
if (completed_len > 0) {
@@ -204,7 +204,7 @@
{
struct nl_buf *nb = nw->buf;
struct nlmsghdr *hdr;
- u_int required_len;
+ size_t required_len;
MPASS(nw->hdr == NULL);
diff --git a/sys/netlink/netlink_var.h b/sys/netlink/netlink_var.h
--- a/sys/netlink/netlink_var.h
+++ b/sys/netlink/netlink_var.h
@@ -179,7 +179,7 @@
struct nl_function_wrapper {
bool (*nlmsg_add)(struct nl_writer *nw, uint32_t portid, uint32_t seq, uint16_t type,
uint16_t flags, uint32_t len);
- bool (*nlmsg_refill_buffer)(struct nl_writer *nw, int required_len);
+ bool (*nlmsg_refill_buffer)(struct nl_writer *nw, size_t required_len);
bool (*nlmsg_flush)(struct nl_writer *nw);
bool (*nlmsg_end)(struct nl_writer *nw);
void (*nlmsg_abort)(struct nl_writer *nw);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 15, 6:37 PM (16 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14638977
Default Alt Text
D47551.diff (5 KB)
Attached To
Mode
D47551: netlink: use size_t through the allocation KPI
Attached
Detach File
Event Timeline
Log In to Comment