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));
}