Skip to content

Commit aa066d4

Browse files
committed
warn if invalid routing-lookup is performed
1 parent 34e7640 commit aa066d4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/firewall_test/simulator/routes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from plugins.translate.abstract import StaticRouteRule, StaticRoute
55

66
from simulator.packet import PACKET_KINDS
7-
from utils.logger import log_debug
7+
from utils.logger import log_debug, log_warn
88

99

1010
class Router:
@@ -78,6 +78,10 @@ def _get_matching_routes(self, packet: PACKET_KINDS, matching_rules: list[Static
7878
if src_route:
7979
route_for = packet.src
8080

81+
if route_for is None:
82+
log_warn('Router', 'Got bad routing-lookup request - this might hint to a plugin-issue!')
83+
return []
84+
8185
routes = []
8286
if len(matching_rules) > 0:
8387
for rule in matching_rules:

0 commit comments

Comments
 (0)