Skip to content
Snippets Groups Projects
Commit 9472bc8a authored by Tomáš Čejka's avatar Tomáš Čejka
Browse files

Forbid ICMP in combination with ports

parent 0d7f6211
No related branches found
No related tags found
No related merge requests found
...@@ -165,6 +165,9 @@ class RouteForm(forms.ModelForm): ...@@ -165,6 +165,9 @@ class RouteForm(forms.ModelForm):
existing_routes = existing_routes.filter(pk__in=route_pk_list) existing_routes = existing_routes.filter(pk__in=route_pk_list)
else: else:
existing_routes = existing_routes.filter(protocol=None) existing_routes = existing_routes.filter(protocol=None)
if "icmp" in [str(i) for i in protocols] and (destinationports or sourceports or port):
raise forms.ValidationError(_('It is not allowed to specify ICMP protocol and source/destination ports at the same time.'))
else: else:
existing_routes = existing_routes.filter(protocol=None) existing_routes = existing_routes.filter(protocol=None)
if sourceports: if sourceports:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment