kernel: update kernel 3.18 to version 3.18.43
[openwrt/openwrt.git] / target / linux / generic / patches-3.18 / 621-sched_act_connmark.patch
index d8ca6666b8dfee805e1562e713b05d02430058b6..72d8e5343392e9d2584a9b73749e3ca1008f39a8 100644 (file)
@@ -1,8 +1,8 @@
 --- /dev/null
 +++ b/net/sched/act_connmark.c
-@@ -0,0 +1,144 @@
+@@ -0,0 +1,126 @@
 +/*
-+ * Copyright (c) 2011 Felix Fietkau <nbd@openwrt.org>
++ * Copyright (c) 2011 Felix Fietkau <nbd@nbd.name>
 + *
 + * This program is free software; you can redistribute it and/or modify it
 + * under the terms and conditions of the GNU General Public License,
@@ -37,8 +37,6 @@
 +
 +#define CONNMARK_TAB_MASK     3
 +
-+static struct tcf_hashinfo connmark_hash_info;
-+
 +static int tcf_connmark(struct sk_buff *skb, const struct tc_action *a,
 +                     struct tcf_result *res)
 +{
 +                           struct nlattr *est, struct tc_action *a,
 +                           int ovr, int bind)
 +{
-+      struct tcf_common *pc;
 +      int ret = 0;
 +
-+      pc = tcf_hash_check(0, a, bind);
-+      if (!pc) {
-+              pc = tcf_hash_create(0, est, a, sizeof(*pc), bind);
-+              if (IS_ERR(pc))
-+                  return PTR_ERR(pc);
++      if (!tcf_hash_check(0, a, bind)) {
++              ret = tcf_hash_create(0, est, a, sizeof(struct tcf_common), bind);
++              if (ret)
++                  return ret;
 +
-+              tcf_hash_insert(pc, &connmark_hash_info);
++              tcf_hash_insert(a);
 +              ret = ACT_P_CREATED;
 +      } else {
 +              if (!ovr) {
-+                      tcf_hash_release(pc, bind, &connmark_hash_info);
++                      tcf_hash_release(a, bind);
 +                      return -EEXIST;
 +              }
 +      }
 +      return ret;
 +}
 +
-+static inline int tcf_connmark_cleanup(struct tc_action *a, int bind)
-+{
-+      if (a->priv)
-+              return tcf_hash_release(a->priv, bind, &connmark_hash_info);
-+      return 0;
-+}
-+
 +static inline int tcf_connmark_dump(struct sk_buff *skb, struct tc_action *a,
 +                              int bind, int ref)
 +{
 +
 +static struct tc_action_ops act_connmark_ops = {
 +      .kind           =       "connmark",
-+      .hinfo          =       &connmark_hash_info,
 +      .type           =       TCA_ACT_CONNMARK,
 +      .owner          =       THIS_MODULE,
 +      .act            =       tcf_connmark,
 +      .dump           =       tcf_connmark_dump,
-+      .cleanup        =       tcf_connmark_cleanup,
 +      .init           =       tcf_connmark_init,
 +};
 +
-+MODULE_AUTHOR("Felix Fietkau <nbd@openwrt.org>");
++MODULE_AUTHOR("Felix Fietkau <nbd@nbd.name>");
 +MODULE_DESCRIPTION("Connection tracking mark restoring");
 +MODULE_LICENSE("GPL");
 +
 +static int __init connmark_init_module(void)
 +{
-+      int ret;
-+
-+      ret = tcf_hashinfo_init(&connmark_hash_info, CONNMARK_TAB_MASK);
-+      if (ret)
-+              return ret;
 +
-+      return tcf_register_action(&act_connmark_ops);
++      return tcf_register_action(&act_connmark_ops, CONNMARK_TAB_MASK);
 +}
 +
 +static void __exit connmark_cleanup_module(void)
 +module_exit(connmark_cleanup_module);
 --- a/net/sched/Kconfig
 +++ b/net/sched/Kconfig
-@@ -717,6 +717,19 @@ config NET_ACT_CSUM
+@@ -686,6 +686,19 @@ config NET_ACT_CSUM
          To compile this code as a module, choose M here: the
          module will be called act_csum.