Thread (12 messages) flat view 12 messages, 3 authors, 2014-03-24

Re: [PATCH net-next 4/9] net: ptp: use sk_unattached_filter_create() for BPF

From: David Miller <davem@davemloft.net>
Date: 2014-03-24 22:39:54

From: Daniel Borkmann <redacted>
Date: Fri, 21 Mar 2014 13:20:13 +0100
quoted hunk ↗ jump to hunk
@@ -135,5 +137,10 @@ EXPORT_SYMBOL_GPL(skb_defer_rx_timestamp);
 
 void __init skb_timestamping_init(void)
 {
-	BUG_ON(sk_chk_filter(ptp_filter, ARRAY_SIZE(ptp_filter)));
+	struct sock_filter ptp_filter[] = { PTP_FILTER };
Perhaps you want this to be static or static const?  Why copy
PTP_FILTER onto the stack at run time?
+	struct sock_fprog ptp_prog = {
+		.len = ARRAY_SIZE(ptp_filter), .filter = ptp_filter,
+	};
+
+	BUG_ON(sk_unattached_filter_create(&ptp_insns, &ptp_prog));
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help