~n-muench/ubuntu/quantal/open-vm-tools/open-vm-tools.march-merge2b

« back to all changes in this revision

Viewing changes to modules/linux/shared/autoconf/sk_filter.c

  • Committer: Bazaar Package Importer
  • Author(s): Nate Muench
  • Date: 2010-09-06 21:06:01 UTC
  • mfrom: (2.4.19 sid)
  • Revision ID: james.westby@ubuntu.com-20100906210601-gxxy30e5roil4srt
Tags: 2010.06.16-268169-3ubuntu1
* Merge from Debian testing (LP: #632101), remaining changes:
  - Recommend open-vm-toolbox in open-vm-tools.
  - Rediffing vsock.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*********************************************************
2
 
 * Copyright (C) 2007 VMware, Inc. All rights reserved.
3
 
 *
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.
7
 
 *
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
11
 
 * for more details.
12
 
 *
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
16
 
 *
17
 
 *********************************************************/
18
 
 
19
 
/*
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.
22
 
 *
23
 
 * This test will fail to build on kernels with the new interface.
24
 
 */
25
 
 
26
 
#include "compat_version.h"
27
 
#include "compat_autoconf.h"
28
 
 
29
 
/*
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.
33
 
 */
34
 
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 22)
35
 
#include <linux/stddef.h>
36
 
#include <linux/socket.h>
37
 
#include <net/sock.h>
38
 
#include <linux/filter.h>
39
 
 
40
 
struct sk_buff test_skbuff;
41
 
struct sk_filter test_filter;
42
 
 
43
 
int
44
 
sk_filter_test(void)
45
 
{
46
 
   struct sk_buff *skb = &test_skbuff;
47
 
   struct sk_filter *filter = &test_filter;
48
 
 
49
 
   return sk_filter(skb, filter);
50
 
}
51
 
#else
52
 
#error "This test intentionally fails on 2.4.22 or newer kernels."
53
 
#endif