--- /dev/null
+From 6c4110d9f499e2170fbb36723b0a5f50a8116304 Mon Sep 17 00:00:00 2001
+From: Nikolay Aleksandrov <nikolay@nvidia.com>
+Date: Tue, 10 Aug 2021 12:21:39 +0300
+Subject: net: bridge: vlan: fix global vlan option range dumping
+
+From: Nikolay Aleksandrov <nikolay@nvidia.com>
+
+commit 6c4110d9f499e2170fbb36723b0a5f50a8116304 upstream.
+
+When global vlan options are equal sequentially we compress them in a
+range to save space and reduce processing time. In order to have the
+proper range end id we need to update range_end if the options are equal
+otherwise we get ranges with the same end vlan id as the start.
+
+Fixes: 743a53d9636a ("net: bridge: vlan: add support for dumping global vlan options")
+Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
+Link: https://lore.kernel.org/r/20210810092139.11700-1-razor@blackwall.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/bridge/br_vlan.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/net/bridge/br_vlan.c
++++ b/net/bridge/br_vlan.c
+@@ -1839,7 +1839,7 @@ static int br_vlan_dump_dev(const struct
+
+ if (dump_global) {
+ if (br_vlan_global_opts_can_enter_range(v, range_end))
+- continue;
++ goto update_end;
+ if (!br_vlan_global_opts_fill(skb, range_start->vid,
+ range_end->vid,
+ range_start)) {
+@@ -1865,6 +1865,7 @@ static int br_vlan_dump_dev(const struct
+
+ range_start = v;
+ }
++update_end:
+ range_end = v;
+ }
+
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- net/openvswitch/actions.c | 15 +++++----------
- net/openvswitch/datapath.c | 25 ++++++++++++++-----------
- net/openvswitch/datapath.h | 2 +-
- net/openvswitch/vport.c | 2 +-
+ net/openvswitch/actions.c | 15 +++++----------
+ net/openvswitch/datapath.c | 25 ++++++++++++++-----------
+ net/openvswitch/datapath.h | 2 +-
+ net/openvswitch/vport.c | 2 +-
4 files changed, 21 insertions(+), 23 deletions(-)
-diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
-index 3b3cc6ea274f8c..4995e617ca032f 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
-@@ -855,12 +855,8 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,
+@@ -855,12 +855,8 @@ static void do_output(struct datapath *d
u16 mru = OVS_CB(skb)->mru;
u32 cutlen = OVS_CB(skb)->cutlen;
if (likely(!mru ||
(skb->len <= mru + vport->dev->hard_header_len))) {
-@@ -1232,22 +1228,21 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
+@@ -1232,22 +1228,21 @@ static int do_execute_actions(struct dat
clone = skb_clone(skb, GFP_ATOMIC);
if (clone)
do_output(dp, clone, port, key);
break;
case OVS_ACTION_ATTR_HASH:
-diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
-index 5fb74fbcb2f382..b985e6696b4251 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
-@@ -240,7 +240,7 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key)
+@@ -240,7 +240,7 @@ void ovs_dp_process_packet(struct sk_buf
upcall.cmd = OVS_PACKET_CMD_MISS;
upcall.portid = ovs_vport_find_upcall_portid(p, skb);
upcall.mru = OVS_CB(skb)->mru;
switch (error) {
case 0:
case -EAGAIN:
-@@ -400,7 +400,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
+@@ -400,7 +400,8 @@ static int queue_userspace_packet(struct
struct sk_buff *nskb = NULL;
struct sk_buff *user_skb = NULL; /* to be queued to userspace */
struct nlattr *nla;
unsigned int hlen;
int err, dp_ifindex;
u64 hash;
-@@ -421,7 +422,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
+@@ -421,7 +422,8 @@ static int queue_userspace_packet(struct
skb = nskb;
}
err = -EFBIG;
goto out;
}
-@@ -436,13 +438,13 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
+@@ -436,13 +438,13 @@ static int queue_userspace_packet(struct
* padding logic. Only perform zerocopy if padding is not required.
*/
if (dp->user_features & OVS_DP_F_UNALIGNED)
if (!user_skb) {
err = -ENOMEM;
goto out;
-@@ -503,7 +505,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
+@@ -503,7 +505,7 @@ static int queue_userspace_packet(struct
}
/* Add OVS_PACKET_ATTR_LEN when packet is truncated */
nla_put_u32(user_skb, OVS_PACKET_ATTR_LEN, skb->len)) {
err = -ENOBUFS;
goto out;
-@@ -528,9 +530,9 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
+@@ -528,9 +530,9 @@ static int queue_userspace_packet(struct
err = -ENOBUFS;
goto out;
}
if (err)
goto out;
-@@ -587,6 +589,7 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
+@@ -587,6 +589,7 @@ static int ovs_packet_cmd_execute(struct
packet->ignore_df = 1;
}
OVS_CB(packet)->mru = mru;
if (a[OVS_PACKET_ATTR_HASH]) {
hash = nla_get_u64(a[OVS_PACKET_ATTR_HASH]);
-diff --git a/net/openvswitch/datapath.h b/net/openvswitch/datapath.h
-index 38f7d3e66ca613..62e7ad32f83764 100644
--- a/net/openvswitch/datapath.h
+++ b/net/openvswitch/datapath.h
@@ -96,7 +96,7 @@ struct datapath {
*/
struct ovs_skb_cb {
struct vport *input_vport;
-diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
-index da733b92ae8a76..ced707ff6dd971 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
-@@ -436,7 +436,7 @@ int ovs_vport_receive(struct vport *vport, struct sk_buff *skb,
+@@ -436,7 +436,7 @@ int ovs_vport_receive(struct vport *vpor
OVS_CB(skb)->input_vport = vport;
OVS_CB(skb)->mru = 0;
if (unlikely(dev_net(skb->dev) != ovs_dp_get_net(vport->dp))) {
u32 mark;
---
-2.53.0
-
--- /dev/null
+From 97a4d46b1516250d640c1ae0c9e7129d160d6a1c Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet@google.com>
+Date: Thu, 23 Jun 2022 19:35:40 +0000
+Subject: raw: fix a typo in raw_icmp_error()
+
+From: Eric Dumazet <edumazet@google.com>
+
+commit 97a4d46b1516250d640c1ae0c9e7129d160d6a1c upstream.
+
+I accidentally broke IPv4 traceroute, by swapping iph->saddr
+and iph->daddr.
+
+Probably because raw_icmp_error() and raw_v4_input()
+use different order for iph->saddr and iph->daddr.
+
+Fixes: ba44f8182ec2 ("raw: use more conventional iterators")
+Reported-by: John Sperbeck <jsperbeck@google.com>
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Link: https://lore.kernel.org/r/20220623193540.2851799-1-edumazet@google.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/raw.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/ipv4/raw.c
++++ b/net/ipv4/raw.c
+@@ -279,7 +279,7 @@ void raw_icmp_error(struct sk_buff *skb,
+ sk_for_each(sk, head) {
+ iph = (const struct iphdr *)skb->data;
+ if (!raw_v4_match(net, sk, iph->protocol,
+- iph->saddr, iph->daddr, dif, sdif))
++ iph->daddr, iph->saddr, dif, sdif))
+ continue;
+ raw_err(sk, skb, info);
+ }
--- /dev/null
+From c4fceb46add65481ef0dfb79cad24c3c269b4cad Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet@google.com>
+Date: Wed, 22 Jun 2022 03:23:03 +0000
+Subject: raw: remove unused variables from raw6_icmp_error()
+
+From: Eric Dumazet <edumazet@google.com>
+
+commit c4fceb46add65481ef0dfb79cad24c3c269b4cad upstream.
+
+saddr and daddr are set but not used.
+
+Fixes: ba44f8182ec2 ("raw: use more conventional iterators")
+Reported-by: kernel test robot <lkp@intel.com>
+Signed-off-by: Eric Dumazet <edumazet@google.com>
+Acked-by: Jonathan Lemon <jonathan.lemon@gmail.com>
+Link: https://lore.kernel.org/r/20220622032303.159394-1-edumazet@google.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv6/raw.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/net/ipv6/raw.c
++++ b/net/ipv6/raw.c
+@@ -335,7 +335,6 @@ static void rawv6_err(struct sock *sk, s
+ void raw6_icmp_error(struct sk_buff *skb, int nexthdr,
+ u8 type, u8 code, int inner_offset, __be32 info)
+ {
+- const struct in6_addr *saddr, *daddr;
+ struct net *net = dev_net(skb->dev);
+ struct hlist_head *head;
+ struct sock *sk;
+@@ -347,8 +346,6 @@ void raw6_icmp_error(struct sk_buff *skb
+ sk_for_each(sk, head) {
+ /* Note: ipv6_hdr(skb) != skb->data */
+ const struct ipv6hdr *ip6h = (const struct ipv6hdr *)skb->data;
+- saddr = &ip6h->saddr;
+- daddr = &ip6h->daddr;
+
+ if (!raw_v6_match(net, sk, nexthdr, &ip6h->saddr, &ip6h->daddr,
+ inet6_iif(skb), inet6_sdif(skb)))