flow: Make side 0 always be the initiating side
Each flow in the flow table has two sides, 0 and 1, representing the two interfaces between which passt/pasta will forward data for that flow. Which side is which is currently up to the protocol specific code: TCP uses side 0 for the host/"sock" side and 1 for the guest/"tap" side, except for spliced connections where it uses 0 for the initiating side and 1 for the target side. ICMP also uses 0 for the host/"sock" side and 1 for the guest/"tap" side, but in its case the latter is always also the initiating side. Make this generically consistent by always using side 0 for the initiating side and 1 for the target side. This doesn't simplify a lot for now, and arguably makes TCP slightly more complex, since we add an extra field to the connection structure to record which is the guest facing side. This is an interim change, which we'll be able to remove later. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>q Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:

committed by
Stefano Brivio

parent
0060acd11b
commit
43571852e6
5
flow.h
5
flow.h
@@ -100,6 +100,11 @@ extern const uint8_t flow_proto[];
|
||||
#define FLOW_PROTO(f) \
|
||||
((f)->type < FLOW_NUM_TYPES ? flow_proto[(f)->type] : 0)
|
||||
|
||||
#define SIDES 2
|
||||
|
||||
#define INISIDE 0 /* Initiating side */
|
||||
#define TGTSIDE 1 /* Target side */
|
||||
|
||||
/**
|
||||
* struct flow_common - Common fields for packet flows
|
||||
* @state: State of the flow table entry
|
||||
|
Reference in New Issue
Block a user