Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109087120
D35301.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35301.diff
View Options
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1899,8 +1899,12 @@
mb->m_len = length;
progress += length;
- if (flags & M_PKTHDR)
+ if (flags & M_PKTHDR) {
m->m_pkthdr.len += length;
+ m->m_pkthdr.memlen += MSIZE;
+ if (mb->m_flags & M_EXT)
+ m->m_pkthdr.memlen += mb->m_ext.ext_size;
+ }
}
KASSERT(progress == total, ("%s: progress != total", __func__));
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -1268,7 +1268,7 @@
if (cc <= sbspace(sb)) {
STAILQ_INSERT_TAIL(&sb->uxdg_mb, f, m_stailqpkt);
/* XXX: would be nice if m_uiotombuf() returns count. */
- for (; f != NULL ; f = f->m_next) {
+ for (; f != NULL; f = f->m_next) {
if (f->m_type != MT_DATA)
sb->sb_ctl += f->m_len;
sb->sb_mbcnt += MSIZE;
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -207,13 +207,17 @@
/* Layer specific non-persistent local storage for reassembly, etc. */
union {
- uint8_t eight[8];
- uint16_t sixteen[4];
- uint32_t thirtytwo[2];
- uint64_t sixtyfour[1];
- uintptr_t unintptr[1];
- void *ptr;
- } PH_loc;
+ union {
+ uint8_t eight[8];
+ uint16_t sixteen[4];
+ uint32_t thirtytwo[2];
+ uint64_t sixtyfour[1];
+ uintptr_t unintptr[1];
+ void *ptr;
+ } PH_loc;
+ /* Upon allocation: total packet memory consumption. */
+ u_int memlen;
+ };
};
#define ether_vtag PH_per.sixteen[0]
#define tcp_tun_port PH_per.sixteen[0] /* outbound */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Feb 1, 3:01 PM (9 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16385842
Default Alt Text
D35301.diff (1 KB)
Attached To
Mode
D35301: m_uiotombuf: write total memory length of the allocated chain in pkthdr
Attached
Detach File
Event Timeline
Log In to Comment