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 aa240953d7669f..6d6d82ed5bd172 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
-@@ -856,12 +856,8 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,
+@@ -856,12 +856,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))) {
-@@ -1242,22 +1238,21 @@ static int do_execute_actions(struct datapath *dp, struct sk_buff *skb,
+@@ -1242,22 +1238,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 0202111cda3531..e9ff6b87af7010 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
-@@ -250,7 +250,7 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key)
+@@ -250,7 +250,7 @@ void ovs_dp_process_packet(struct sk_buf
upcall.portid = ovs_vport_find_upcall_portid(p, skb);
upcall.mru = OVS_CB(skb)->mru;
switch (error) {
case 0:
case -EAGAIN:
-@@ -413,7 +413,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
+@@ -413,7 +413,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;
-@@ -434,7 +435,8 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
+@@ -434,7 +435,8 @@ static int queue_userspace_packet(struct
skb = nskb;
}
err = -EFBIG;
goto out;
}
-@@ -449,13 +451,13 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
+@@ -449,13 +451,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;
-@@ -516,7 +518,7 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
+@@ -516,7 +518,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;
-@@ -541,9 +543,9 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
+@@ -541,9 +543,9 @@ static int queue_userspace_packet(struct
err = -ENOBUFS;
goto out;
}
if (err)
goto out;
-@@ -600,6 +602,7 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
+@@ -600,6 +602,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 fcfe6cb464417e..86a47998a359a6 100644
--- a/net/openvswitch/datapath.h
+++ b/net/openvswitch/datapath.h
@@ -114,7 +114,7 @@ struct datapath {
*/
struct ovs_skb_cb {
struct vport *input_vport;
-diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c
-index 25197e14c123bd..a2a9a602dd254d 100644
--- a/net/openvswitch/vport.c
+++ b/net/openvswitch/vport.c
-@@ -438,7 +438,7 @@ int ovs_vport_receive(struct vport *vport, struct sk_buff *skb,
+@@ -438,7 +438,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)))