1
/*********************************************************
2
* Copyright (C) 2007 VMware, Inc. All rights reserved.
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation version 2 and no later version.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13
* You should have received a copy of the GNU General Public License along
14
* with this program; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
*********************************************************/
20
* Detect whether the old or new sk_filter() interface is used. This was
21
* changed in 2.4.21, but it's backported to some distro kernels.
23
* This test will fail to build on kernels with the new interface.
26
#include "compat_version.h"
27
#include "compat_autoconf.h"
30
* We'd restrict this test to 2.4.21 and earlier kernels, but Mandrake's
31
* enterprise-2.4.21-013mdk-9.1 appears to really be 2.4.20 with some patches,
32
* and not the patches we care about, so let's test on 2.4.21 kernels too.
34
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 22)
35
#include <linux/stddef.h>
36
#include <linux/socket.h>
38
#include <linux/filter.h>
40
struct sk_buff test_skbuff;
41
struct sk_filter test_filter;
46
struct sk_buff *skb = &test_skbuff;
47
struct sk_filter *filter = &test_filter;
49
return sk_filter(skb, filter);
52
#error "This test intentionally fails on 2.4.22 or newer kernels."