]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/bridge/netfilter/ebt_mark.c
[NETFILTER]: ebtables: mark matches, targets and watchers __read_mostly
[linux-2.6-omap-h63xx.git] / net / bridge / netfilter / ebt_mark.c
index 62d23c7b25e68e701066b7db541da24b57400549..36723f47db0a7824bad1a64e47970b8fcd86911f 100644 (file)
 #include <linux/netfilter_bridge/ebt_mark_t.h>
 #include <linux/module.h>
 
-static int ebt_target_mark(struct sk_buff **pskb, unsigned int hooknr,
+static int ebt_target_mark(struct sk_buff *skb, unsigned int hooknr,
    const struct net_device *in, const struct net_device *out,
    const void *data, unsigned int datalen)
 {
-       struct ebt_mark_t_info *info = (struct ebt_mark_t_info *)data;
+       const struct ebt_mark_t_info *info = data;
        int action = info->target & -16;
 
        if (action == MARK_SET_VALUE)
-               (*pskb)->mark = info->mark;
+               skb->mark = info->mark;
        else if (action == MARK_OR_VALUE)
-               (*pskb)->mark |= info->mark;
+               skb->mark |= info->mark;
        else if (action == MARK_AND_VALUE)
-               (*pskb)->mark &= info->mark;
+               skb->mark &= info->mark;
        else
-               (*pskb)->mark ^= info->mark;
+               skb->mark ^= info->mark;
 
        return info->target | ~EBT_VERDICT_BITS;
 }
@@ -39,7 +39,7 @@ static int ebt_target_mark(struct sk_buff **pskb, unsigned int hooknr,
 static int ebt_target_mark_check(const char *tablename, unsigned int hookmask,
    const struct ebt_entry *e, void *data, unsigned int datalen)
 {
-       struct ebt_mark_t_info *info = (struct ebt_mark_t_info *)data;
+       const struct ebt_mark_t_info *info = data;
        int tmp;
 
        if (datalen != EBT_ALIGN(sizeof(struct ebt_mark_t_info)))
@@ -57,8 +57,7 @@ static int ebt_target_mark_check(const char *tablename, unsigned int hookmask,
        return 0;
 }
 
-static struct ebt_target mark_target =
-{
+static struct ebt_target mark_target __read_mostly = {
        .name           = EBT_MARK_TARGET,
        .target         = ebt_target_mark,
        .check          = ebt_target_mark_check,
@@ -77,4 +76,5 @@ static void __exit ebt_mark_fini(void)
 
 module_init(ebt_mark_init);
 module_exit(ebt_mark_fini);
+MODULE_DESCRIPTION("Ebtables: Packet mark modification");
 MODULE_LICENSE("GPL");