ia64/linux-2.6.18-xen.hg

view net/netfilter/xt_mark.c @ 871:9cbcc9008446

xen/x86: don't initialize cpu_data[]'s apicid field on generic code

Afaict, this is not only redundant with the intialization done in
drivers/xen/core/smpboot.c, but actually results - at least for
secondary CPUs - in the Xen-specific value written to be later
overwritten with whatever the generic code determines (with no
guarantee that the two values are identical).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu May 14 10:09:15 2009 +0100 (2009-05-14)
parents 831230e53067
children
line source
1 /* Kernel module to match NFMARK values. */
3 /* (C) 1999-2001 Marc Boucher <marc@mbsi.ca>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
10 #include <linux/module.h>
11 #include <linux/skbuff.h>
13 #include <linux/netfilter/xt_mark.h>
14 #include <linux/netfilter/x_tables.h>
16 MODULE_LICENSE("GPL");
17 MODULE_AUTHOR("Marc Boucher <marc@mbsi.ca>");
18 MODULE_DESCRIPTION("iptables mark matching module");
19 MODULE_ALIAS("ipt_mark");
20 MODULE_ALIAS("ip6t_mark");
22 static int
23 match(const struct sk_buff *skb,
24 const struct net_device *in,
25 const struct net_device *out,
26 const struct xt_match *match,
27 const void *matchinfo,
28 int offset,
29 unsigned int protoff,
30 int *hotdrop)
31 {
32 const struct xt_mark_info *info = matchinfo;
34 return ((skb->nfmark & info->mask) == info->mark) ^ info->invert;
35 }
37 static int
38 checkentry(const char *tablename,
39 const void *entry,
40 const struct xt_match *match,
41 void *matchinfo,
42 unsigned int matchsize,
43 unsigned int hook_mask)
44 {
45 const struct xt_mark_info *minfo = matchinfo;
47 if (minfo->mark > 0xffffffff || minfo->mask > 0xffffffff) {
48 printk(KERN_WARNING "mark: only supports 32bit mark\n");
49 return 0;
50 }
51 return 1;
52 }
54 static struct xt_match mark_match = {
55 .name = "mark",
56 .match = match,
57 .matchsize = sizeof(struct xt_mark_info),
58 .checkentry = checkentry,
59 .family = AF_INET,
60 .me = THIS_MODULE,
61 };
63 static struct xt_match mark6_match = {
64 .name = "mark",
65 .match = match,
66 .matchsize = sizeof(struct xt_mark_info),
67 .checkentry = checkentry,
68 .family = AF_INET6,
69 .me = THIS_MODULE,
70 };
72 static int __init xt_mark_init(void)
73 {
74 int ret;
75 ret = xt_register_match(&mark_match);
76 if (ret)
77 return ret;
79 ret = xt_register_match(&mark6_match);
80 if (ret)
81 xt_unregister_match(&mark_match);
83 return ret;
84 }
86 static void __exit xt_mark_fini(void)
87 {
88 xt_unregister_match(&mark_match);
89 xt_unregister_match(&mark6_match);
90 }
92 module_init(xt_mark_init);
93 module_exit(xt_mark_fini);