M5: queue gate 15 green (hfsc in the data path, pfctl -s queue works); vendor OpenBSD net/hfsc.h + net/fq_codel.h so kernel and pfctl share the ABI; pflog payload anchored; splassert no longer BUGs
This commit is contained in:
1 parent
4bade69cf9
commit
90c51f43fc
46 files changed
+502
-126
No files matched your search
@@ -115,11 +115,22 @@ pfk_pflog_pull(struct mbuf *m, char *buf, size_t want)
|
||||
{
|
||||
struct sk_buff *skb = m ? m_to_skb(m) : NULL;
|
||||
size_t n;
|
||||
int off;
|
||||
|
||||
if (skb == NULL)
|
||||
return 0;
|
||||
n = min_t(size_t, want, skb->len);
|
||||
if (skb_copy_bits(skb, 0, buf, n))
|
||||
/*
|
||||
* BSD logs from the network header; pf may already have advanced the
|
||||
* mbuf/skb data pointer to the transport header while parsing, so
|
||||
* anchor explicitly at the IP header instead of at skb->data.
|
||||
*/
|
||||
off = skb_network_offset(skb);
|
||||
if (off < 0)
|
||||
off = 0;
|
||||
if (off > skb->len)
|
||||
return 0;
|
||||
n = min_t(size_t, want, skb->len - off);
|
||||
if (skb_copy_bits(skb, off, buf, n))
|
||||
return 0;
|
||||
return n;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user