Bug 111537 - [inet6] [patch] ip6_input() treats mbuf cluster wrong
Summary: [inet6] [patch] ip6_input() treats mbuf cluster wrong
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-13 14:00 UTC by Thomas Karcher
Modified: 2019-02-12 08:42 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (545 bytes, patch)
2007-04-13 14:00 UTC, Thomas Karcher
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Karcher 2007-04-13 14:00:09 UTC
In ip6_input() after line 294, a bunch of code takes care of copying the mbuf/mbuf cluster to a more KAME conform mbuf/mbuf cluster - but in my opinion, it does it not completely right ...

In line 318, the m_copydata() call works only if the new mbuf n is "just" an mbuf and not an mbuf cluster. See the solution what I mean.

Fix: I think the code should look like this:

 318                 if (n && n->m_pkthdr.len > MHLEN) {
 319                         m_copydata(m, 0, n->m_pkthdr.len, n->m_ext.ext_buf);
 320                         n->m_data = n->m_ext.ext_buf;
 321                 } else {
 322                         m_copydata(m, 0, n->m_pkthdr.len, mtod(n, caddr_t));
 323                 }

Please find a diff attached.


Patch attached with submission follows:
Comment 1 K. Macy freebsd_committer freebsd_triage 2007-11-19 08:46:30 UTC
Responsible Changed
From-To: freebsd-bugs->kmacy


Add to queue to verify that the submitter is correct.
Comment 2 Gavin Atkinson freebsd_committer freebsd_triage 2011-05-29 23:26:57 UTC
Responsible Changed
From-To: kmacy->freebsd-net

kmacy has asked for all of his PRs to be reassigned back to the pool.
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:37 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 4 Andriy Voskoboinyk freebsd_committer freebsd_triage 2019-02-12 08:42:37 UTC
Nope, the m_data pointer is initialized during uma_zalloc_arg - see mb_ctor_clust() in sys/kern/kern_mbuf.c