diff --git a/sys/net/bpf.c b/sys/net/bpf.c --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -2265,6 +2265,7 @@ static int bpf_gettime(struct bintime *bt, int tstype, struct mbuf *m) { + struct timespec ts; struct m_tag *tag; int quality; @@ -2273,6 +2274,11 @@ return (quality); if (m != NULL) { + if ((m->m_flags & (M_PKTHDR | M_TSTMP)) == (M_PKTHDR | M_TSTMP)) { + mbuf_tstmp2timespec(m, &ts); + timespec2bintime(&ts, bt); + return (BPF_TSTAMP_EXTERN); + } tag = m_tag_locate(m, MTAG_BPF, MTAG_BPF_TIMESTAMP, NULL); if (tag != NULL) { *bt = *(struct bintime *)(tag + 1);