@@ -933,11 +933,11 @@ static inline int skb_ensure_writable(struct sk_buff *skb, int write_len)
933
933
#endif
934
934
935
935
#if LINUX_VERSION_CODE < KERNEL_VERSION (5 , 6 , 0 )
936
+ #include <linux/icmpv6.h>
937
+ #include <net/icmp.h>
936
938
#if IS_ENABLED (CONFIG_NF_NAT )
937
939
#include <linux/ip.h>
938
- #include <linux/icmpv6.h>
939
940
#include <net/ipv6.h>
940
- #include <net/icmp.h>
941
941
#include <net/netfilter/nf_conntrack.h>
942
942
#if LINUX_VERSION_CODE < KERNEL_VERSION (5 , 1 , 0 ) && !defined(ISRHEL8 )
943
943
#include <net/netfilter/nf_nat_core.h>
@@ -951,6 +951,7 @@ static inline void __compat_icmp_ndo_send(struct sk_buff *skb_in, int type, int
951
951
952
952
ct = nf_ct_get (skb_in , & ctinfo );
953
953
if (!ct || !(ct -> status & IPS_SRC_NAT )) {
954
+ memset (skb_in -> cb , 0 , sizeof (skb_in -> cb ));
954
955
icmp_send (skb_in , type , code , info );
955
956
return ;
956
957
}
@@ -966,6 +967,7 @@ static inline void __compat_icmp_ndo_send(struct sk_buff *skb_in, int type, int
966
967
967
968
orig_ip = ip_hdr (skb_in )-> saddr ;
968
969
ip_hdr (skb_in )-> saddr = ct -> tuplehash [0 ].tuple .src .u3 .ip ;
970
+ memset (skb_in -> cb , 0 , sizeof (skb_in -> cb ));
969
971
icmp_send (skb_in , type , code , info );
970
972
ip_hdr (skb_in )-> saddr = orig_ip ;
971
973
out :
@@ -980,6 +982,7 @@ static inline void __compat_icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8
980
982
981
983
ct = nf_ct_get (skb_in , & ctinfo );
982
984
if (!ct || !(ct -> status & IPS_SRC_NAT )) {
985
+ memset (skb_in -> cb , 0 , sizeof (skb_in -> cb ));
983
986
icmpv6_send (skb_in , type , code , info );
984
987
return ;
985
988
}
@@ -995,14 +998,23 @@ static inline void __compat_icmpv6_ndo_send(struct sk_buff *skb_in, u8 type, u8
995
998
996
999
orig_ip = ipv6_hdr (skb_in )-> saddr ;
997
1000
ipv6_hdr (skb_in )-> saddr = ct -> tuplehash [0 ].tuple .src .u3 .in6 ;
1001
+ memset (skb_in -> cb , 0 , sizeof (skb_in -> cb ));
998
1002
icmpv6_send (skb_in , type , code , info );
999
1003
ipv6_hdr (skb_in )-> saddr = orig_ip ;
1000
1004
out :
1001
1005
consume_skb (cloned_skb );
1002
1006
}
1003
1007
#else
1004
- #define __compat_icmp_ndo_send icmp_send
1005
- #define __compat_icmpv6_ndo_send icmpv6_send
1008
+ static inline void __compat_icmp_ndo_send (struct sk_buff * skb_in , int type , int code , __be32 info )
1009
+ {
1010
+ memset (skb_in -> cb , 0 , sizeof (skb_in -> cb ));
1011
+ icmp_send (skb_in , type , code , info );
1012
+ }
1013
+ static inline void __compat_icmpv6_ndo_send (struct sk_buff * skb_in , u8 type , u8 code , __u32 info )
1014
+ {
1015
+ memset (skb_in -> cb , 0 , sizeof (skb_in -> cb ));
1016
+ icmpv6_send (skb_in , type , code , info );
1017
+ }
1006
1018
#endif
1007
1019
#define icmp_ndo_send __compat_icmp_ndo_send
1008
1020
#define icmpv6_ndo_send __compat_icmpv6_ndo_send
0 commit comments