forked from cilium/cilium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
policy: Fix Unspecified Protocol Type
[ upstream commit 58b67dc ] [ backporter's note: merge conflict in mergeIngress and mergeEgress due to the missing auth parameter to mergeIngressPortProto and mergeEgressPortProto. Resolved by using the upstream commit's version and removing the non-existent auth parameter in the calls. According to the policy API documentation, if a protocol is not specified in a PortProtocol type its protocol is supposed to be presumed as "ANY". The policy package inconsistently enforces this logic. As a result, empty Protocol fields are validated as "ANY", but, in the actual rule logic that splits the "ANY" protocol into the supported protocol types, the comparison was made only to the actual "ANY" protocol constant. This is fixed with an L4Proto method `IsAny` that does both the constant and empty string comparison. Signed-off-by: Nate Sweet <[email protected]> Signed-off-by: Tobias Klauser <[email protected]>
- Loading branch information
1 parent
49b39a0
commit 7b9b6d5
Showing
2 changed files
with
18 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters