-
Notifications
You must be signed in to change notification settings - Fork 516
Closed
Description
Hello,
I'm currently working with some Per-Stream Filtering and Policing in INET and stumbled upon the following lines of code:
inet/src/inet/queueing/base/PacketFilterBase.cc
Lines 65 to 71 in 61410b4
| bool PacketFilterBase::canPushPacket(Packet *packet, const cGate *gate) const | |
| { | |
| if (backpressure) | |
| return matchesPacket(packet) && consumer != nullptr && consumer.canPushPacket(packet); | |
| else | |
| return !matchesPacket(packet) || consumer == nullptr || consumer.canPushPacket(packet); | |
| } |
In the no-backpressure case, this code accepts all packets in case its consumer accepts all packets.
However, if the consumer does not accept packets, canPushPacket returns true iff the packet criteria does not match, meaning it accepts all packets it will immediately filter out.
I cannot think about any scenario why this implementation would be useful.
Could you please clarify why it is implemented like this?
Metadata
Metadata
Assignees
Labels
No labels