ia64/linux-2.6.18-xen.hg

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