If mbuf is not writable get a writable copy before invoking
m_pullup(9). Tested by: Garrett Cooper < yanefbsd <at> gmail dot com >
This commit is contained in:
parent
b708fede3f
commit
8468f28e4d
@ -2559,7 +2559,16 @@ msk_encap(struct msk_if_softc *sc_if, struct mbuf **m_head)
|
||||
struct ip *ip;
|
||||
struct tcphdr *tcp;
|
||||
|
||||
/* TODO check for M_WRITABLE(m) */
|
||||
if (M_WRITABLE(m) == 0) {
|
||||
/* Get a writable copy. */
|
||||
m = m_dup(*m_head, M_DONTWAIT);
|
||||
m_freem(*m_head);
|
||||
if (m == NULL) {
|
||||
*m_head = NULL;
|
||||
return (ENOBUFS);
|
||||
}
|
||||
*m_head = m;
|
||||
}
|
||||
|
||||
offset = sizeof(struct ether_header);
|
||||
m = m_pullup(m, offset);
|
||||
|
Loading…
x
Reference in New Issue
Block a user