ia64/linux-2.6.18-xen.hg

annotate net/netfilter/xt_pkttype.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 /* (C) 1999-2001 Michal Ludvig <michal@logix.cz>
ian@0 2 *
ian@0 3 * This program is free software; you can redistribute it and/or modify
ian@0 4 * it under the terms of the GNU General Public License version 2 as
ian@0 5 * published by the Free Software Foundation.
ian@0 6 */
ian@0 7
ian@0 8 #include <linux/module.h>
ian@0 9 #include <linux/skbuff.h>
ian@0 10 #include <linux/if_ether.h>
ian@0 11 #include <linux/if_packet.h>
ian@0 12 #include <linux/in.h>
ian@0 13 #include <linux/ip.h>
ian@0 14
ian@0 15 #include <linux/netfilter/xt_pkttype.h>
ian@0 16 #include <linux/netfilter/x_tables.h>
ian@0 17
ian@0 18 MODULE_LICENSE("GPL");
ian@0 19 MODULE_AUTHOR("Michal Ludvig <michal@logix.cz>");
ian@0 20 MODULE_DESCRIPTION("IP tables match to match on linklayer packet type");
ian@0 21 MODULE_ALIAS("ipt_pkttype");
ian@0 22 MODULE_ALIAS("ip6t_pkttype");
ian@0 23
ian@0 24 static int match(const struct sk_buff *skb,
ian@0 25 const struct net_device *in,
ian@0 26 const struct net_device *out,
ian@0 27 const struct xt_match *match,
ian@0 28 const void *matchinfo,
ian@0 29 int offset,
ian@0 30 unsigned int protoff,
ian@0 31 int *hotdrop)
ian@0 32 {
ian@0 33 u_int8_t type;
ian@0 34 const struct xt_pkttype_info *info = matchinfo;
ian@0 35
ian@0 36 if (skb->pkt_type == PACKET_LOOPBACK)
ian@0 37 type = (MULTICAST(skb->nh.iph->daddr)
ian@0 38 ? PACKET_MULTICAST
ian@0 39 : PACKET_BROADCAST);
ian@0 40 else
ian@0 41 type = skb->pkt_type;
ian@0 42
ian@0 43 return (type == info->pkttype) ^ info->invert;
ian@0 44 }
ian@0 45
ian@0 46 static struct xt_match pkttype_match = {
ian@0 47 .name = "pkttype",
ian@0 48 .match = match,
ian@0 49 .matchsize = sizeof(struct xt_pkttype_info),
ian@0 50 .family = AF_INET,
ian@0 51 .me = THIS_MODULE,
ian@0 52 };
ian@0 53
ian@0 54 static struct xt_match pkttype6_match = {
ian@0 55 .name = "pkttype",
ian@0 56 .match = match,
ian@0 57 .matchsize = sizeof(struct xt_pkttype_info),
ian@0 58 .family = AF_INET6,
ian@0 59 .me = THIS_MODULE,
ian@0 60 };
ian@0 61
ian@0 62 static int __init xt_pkttype_init(void)
ian@0 63 {
ian@0 64 int ret;
ian@0 65 ret = xt_register_match(&pkttype_match);
ian@0 66 if (ret)
ian@0 67 return ret;
ian@0 68
ian@0 69 ret = xt_register_match(&pkttype6_match);
ian@0 70 if (ret)
ian@0 71 xt_unregister_match(&pkttype_match);
ian@0 72
ian@0 73 return ret;
ian@0 74 }
ian@0 75
ian@0 76 static void __exit xt_pkttype_fini(void)
ian@0 77 {
ian@0 78 xt_unregister_match(&pkttype_match);
ian@0 79 xt_unregister_match(&pkttype6_match);
ian@0 80 }
ian@0 81
ian@0 82 module_init(xt_pkttype_init);
ian@0 83 module_exit(xt_pkttype_fini);