Simplify: use M_MOVE_PKTHDR directly.

ok knakahara@
This commit is contained in:
maxv 2018-05-08 06:08:19 +00:00
parent 9e98533ad3
commit f5ad45f878
1 changed files with 3 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_l2tp.c,v 1.26 2018/05/07 09:51:02 maxv Exp $ */
/* $NetBSD: if_l2tp.c,v 1.27 2018/05/08 06:08:19 maxv Exp $ */
/*
* Copyright (c) 2017 Internet Initiative Japan Inc.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.26 2018/05/07 09:51:02 maxv Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.27 2018/05/08 06:08:19 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@ -506,7 +506,7 @@ l2tp_input(struct mbuf *m, struct ifnet *ifp)
m_freem(m);
return;
}
M_COPY_PKTHDR(m_head, m);
M_MOVE_PKTHDR(m_head, m);
/*
* m_head should be:
@ -530,11 +530,6 @@ l2tp_input(struct mbuf *m, struct ifnet *ifp)
if (m->m_len == 0) {
m_head->m_next = m_free(m);
} else {
/*
* Already copied mtag with M_COPY_PKTHDR.
* but don't delete mtag in case cut off M_PKTHDR flag
*/
m_remove_pkthdr(m);
m_head->m_next = m;
}