-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Labels
Description
opte/lib/opte/src/engine/layer.rs
Lines 224 to 242 in 3ff6a21
| fn expire_flows(&mut self, now: Moment) { | |
| // XXX The two sides can have different traffic patterns and | |
| // thus one side could be considered expired while the other | |
| // is active. You could have one side seeing packets while the | |
| // other side is idle; so what do we do? Currently this impl | |
| // bases expiration on the outgoing side only, but expires | |
| // both entries (just like it's imperative to add an entry as | |
| // a pair, it's also imperative to remove an entry as a pair). | |
| // Perhaps the two sides should share a single moment (though | |
| // that would required mutex or atomic). Or perhaps both sides | |
| // should be checked, and if either side is expired the pair | |
| // is considered expired (or active). Maybe this should be | |
| // configurable? | |
| let to_expire = | |
| self.ft_out.expire_flows(now, LftOutEntry::extract_pair); | |
| for flow in to_expire { | |
| self.ft_in.expire(&flow); | |
| } | |
| self.count = self.ft_out.num_flows(); |
Inbound flow hit times are not used in any way for expiry. As the comment here outlines, these need to be held on a shared atomic Moment or the expiry logic should inspect both halves.