Hello.
There is difference between pyroute2 and Conntrack output (mismatch)
In below code, when we get state from conntrack output , it returns TIME_WAITbut pyroute2 Conntrack, returns two different states STABLISHED,SYN_SENT.
from typing import List, Generator, Final
from pr2modules.conntrack import Conntrack
from pr2modules.conntrack import ConntrackEntry
from pr2modules.netlink.nfnetlink.nfctsocket import NFCTAttrTuple
conntrack = Conntrack()
conntrack_dumped_entries: Generator = conntrack.dump_entries(tuple_orig=NFCTAttrTuple())
conntrack_entries: List[ConntrackEntry] = list(conntrack_dumped_entries)
# Extracting my record (named `my_conntrack_entry`) ....
# my_conntrack_entry : ConntrackEntry = my_method_to_extract_my_record()
print (str(my_conntrack_entry.protoinfo.state_name))
Here is pyroute2 output:
"<bound method NFCTATcpProtoInfo.state_name of TcpInfo(state=ESTABLISHED,SYN_SENT, orig_flags=WINDOW_SCALE,SACK_PERM,CLOSE_INIT,MAXACK_SET, reply_flags=WINDOW_SCALE,SACK_PERM,MAXACK_SET)>"
Hello. There is difference between pyroute2 and Conntrack output (mismatch) In below code, when we get state from conntrack output , it returns TIME_WAIT but pyroute2 Conntrack, returns two different states STABLISHED,SYN_SENT.
Here is pyroute2 output:
conntrack -L output: