]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
fix up net_sched-cls_route-disallow-handle-of-0.patch for 4.9 and 4.14
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Aug 2022 11:48:54 +0000 (13:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Aug 2022 11:48:54 +0000 (13:48 +0200)
queue-4.14/net_sched-cls_route-disallow-handle-of-0.patch
queue-4.9/net_sched-cls_route-disallow-handle-of-0.patch

index df979024298418837f2baf10b2ed8bb134ac0a82..104ba3a99913fe12cd342818352335d3e487edcc 100644 (file)
@@ -56,31 +56,27 @@ Acked-by: Stephen Hemminger <stephen@networkplumber.org>
 Signed-off-by: David S. Miller <davem@davemloft.net>
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- net/sched/cls_route.c |   10 ++++++++++
- 1 file changed, 10 insertions(+)
+ net/sched/cls_route.c |    6 ++++++
+ 1 file changed, 6 insertions(+)
 
 --- a/net/sched/cls_route.c
 +++ b/net/sched/cls_route.c
-@@ -431,6 +431,11 @@ static int route4_set_parms(struct net *
+@@ -431,6 +431,9 @@ static int route4_set_parms(struct net *
                        return -EINVAL;
        }
  
-+      if (!nhandle) {
-+              NL_SET_ERR_MSG(extack, "Replacing with handle of 0 is invalid");
++      if (!nhandle)
 +              return -EINVAL;
-+      }
 +
        h1 = to_hash(nhandle);
        b = rtnl_dereference(head->table[h1]);
        if (!b) {
-@@ -483,6 +488,11 @@ static int route4_change(struct net *net
+@@ -483,6 +486,9 @@ static int route4_change(struct net *net
        int err;
        bool new = true;
  
-+      if (!handle) {
-+              NL_SET_ERR_MSG(extack, "Creating with handle of 0 is invalid");
++      if (!handle)
 +              return -EINVAL;
-+      }
 +
        if (opt == NULL)
                return handle ? -EINVAL : 0;
index 0b2d440791549c5246a2b3c1758083448ac5f266..25bec614d4e5db0576af3874824ec338f9f85b5c 100644 (file)
@@ -56,31 +56,27 @@ Acked-by: Stephen Hemminger <stephen@networkplumber.org>
 Signed-off-by: David S. Miller <davem@davemloft.net>
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 ---
- net/sched/cls_route.c |   10 ++++++++++
- 1 file changed, 10 insertions(+)
+ net/sched/cls_route.c |    6 ++++++
+ 1 file changed, 6 insertions(+)
 
 --- a/net/sched/cls_route.c
 +++ b/net/sched/cls_route.c
-@@ -427,6 +427,11 @@ static int route4_set_parms(struct net *
+@@ -427,6 +427,9 @@ static int route4_set_parms(struct net *
                        goto errout;
        }
  
-+      if (!nhandle) {
-+              NL_SET_ERR_MSG(extack, "Replacing with handle of 0 is invalid");
++      if (!nhandle)
 +              return -EINVAL;
-+      }
 +
        h1 = to_hash(nhandle);
        b = rtnl_dereference(head->table[h1]);
        if (!b) {
-@@ -486,6 +491,11 @@ static int route4_change(struct net *net
+@@ -486,6 +489,9 @@ static int route4_change(struct net *net
        int err;
        bool new = true;
  
-+      if (!handle) {
-+              NL_SET_ERR_MSG(extack, "Creating with handle of 0 is invalid");
++      if (!handle)
 +              return -EINVAL;
-+      }
 +
        if (opt == NULL)
                return handle ? -EINVAL : 0;