diff mbox series

[ovs-dev,v2,2/3] tests: fix packet data endianness

Message ID 2021102719165203980029@chinatelecom.cn
State Superseded
Headers show
Series [ovs-dev,v2,1/3] upcall: prevent from installing flows when inconsistence | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Cheng Li Oct. 27, 2021, 11:16 a.m. UTC
Without this fix, flowgen.py generates bad tcp pkts.
tcpdump reports "bad hdr length 4 - too short" with the pcap
generated by flowgen.py

This patch is to correct pkt data endianness

Signed-off-by: lic121 <lic121@chinatelecom.cn>
---
 tests/flowgen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tests/flowgen.py b/tests/flowgen.py
index 7ef32d1..9823167 100755
--- a/tests/flowgen.py
+++ b/tests/flowgen.py
@@ -135,7 +135,7 @@  def output(attrs):
                                       12893)  # urgent pointer
                     if attrs['TP_PROTO'] == 'TCP+options':
                         tcp = (tcp[:12]
-                               + struct.pack('H', (6 << 12) | 0x02 | 0x10)
+                               + struct.pack('>H', (6 << 12) | 0x02 | 0x10)
                                + tcp[14:])
                         tcp += struct.pack('>BBH', 2, 4, 1975)  # MSS option
                     tcp += b'payload'