Skip to contentSkip to conversation

ipvs: change type of delta and previous_delta in ip_vs_seq.

PATCH In review zhang kai 2 participants 2 messages Aug 20, 2019

Subsystems (4)
lore
Share & tools
lore

zhang kai

author
#0 lore raw

PATCH 1/1 ipvs: change type of delta and previous_delta in ip_vs_seq.

In NAT forwarding mode, Applications may decrease the size of packets, and TCP sequences will get smaller, so both of variables will be negetive values in this case.

---
 include/net/ip_vs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/net/ip_vs.h +2 -2
index 3759167f91f5..de7e75063c7c 100644
@@ -346,8 +346,8 @@ enum ip_vs_sctp_states {
  */
 struct ip_vs_seq {
 	__u32			init_seq;	/* Add delta from this seq */
-	__u32			delta;		/* Delta in sequence numbers */
-	__u32			previous_delta;	/* Delta in sequence numbers
+	__s32			delta;		/* Delta in sequence numbers */
+	__s32			previous_delta;	/* Delta in sequence numbers
 						 * before last resized pkt */
 };
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw

Hello,

Cc list trimmed...

Quoted 3 lines · zhang kai

In NAT forwarding mode, Applications may decrease the size of packets, and TCP sequences will get smaller, so both of variables will be negetive values in this case.

As long as nobody cares about their sign, the type should not
matter. You can not solve all signed/unsigned mismatches with such small patch. Or you are seeing some problem, may be in debug?

Quoted 23 lines
---
 include/net/ip_vs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/net/ip_vs.h +2 -2
index 3759167f91f5..de7e75063c7c 100644
@@ -346,8 +346,8 @@ enum ip_vs_sctp_states {
  */
 struct ip_vs_seq {
 	__u32			init_seq;	/* Add delta from this seq */
-	__u32			delta;		/* Delta in sequence numbers */
-	__u32			previous_delta;	/* Delta in sequence numbers
+	__s32			delta;		/* Delta in sequence numbers */
+	__s32			previous_delta;	/* Delta in sequence numbers
 						 * before last resized pkt */
 };
 
Signature · 1 line
2.17.1

Regards