The cloned skb does not have a socket information recorded of
the original skb. The original skb is never submitted. This means the
requested timestamp information gets lost.
Assign the socket of the original skb to the clone so the timestamp is
forwarded to the user.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
net/hsr/hsr_forward.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c
index 0f708ef598ded..f2e1e7ab9c9e6 100644
--- a/net/hsr/hsr_forward.c
+++ b/net/hsr/hsr_forward.c
@@ -12,6 +12,7 @@
#include <linux/skbuff.h>
#include <linux/etherdevice.h>
#include <linux/if_vlan.h>
+#include <net/sock.h>
#include "hsr_main.h"
#include "hsr_framereg.h"
@@ -348,6 +349,9 @@ struct sk_buff *hsr_create_tagged_frame(struct hsr_frame_info *frame,
if (!skb)
return NULL;
+ if (frame->req_tx_port != HSR_PT_NONE && frame->skb_std->sk)
+ skb_set_owner_w(skb, frame->skb_std->sk);
+
if (port->dev->features & NETIF_F_HW_HSR_TAG_INS)
return skb;
@@ -584,6 +588,8 @@ static void hsr_forward_do(struct hsr_frame_info *frame)
*/
if (frame->has_foreign_header && frame->skb_std) {
skb = skb_clone(frame->skb_std, GFP_ATOMIC);
+ if (skb && frame->skb_std->sk)
+ skb_set_owner_w(skb, frame->skb_std->sk);
goto inject_into_stack;
}
--
2.55.0