openziti / ziti-tunnel-sdk-c

Apache License 2.0
43 stars 16 forks source link

Wildcard services not properly mapping port in range #578

Closed dovholuknf closed 1 year ago

dovholuknf commented 1 year ago

see https://openziti.discourse.group/t/interesting-issue-with-multiple-networks/956/7

User has a wildcard service and other services defined along with a port range defined on the wildcard service. The logs very clearly show:

scareything commented 1 year ago

When matching wildcard domain addresses, we were using the address matching function from ziti-sdk-c incorrectly. The matching function returns a score where -1 is a mismatch, 0 is an exact match, and larger integers are lesser matches, but the return value was being interpreted as boolean.

This caused matches on wildcard domains to incorrectly be counted as matching when compared against plain hostname addresses.