@@ -28,8 +28,8 @@ static inline Route__RouteConfiguration *map_lookup_route_config(const char *rou
2828 return kmesh_map_lookup_elem (& map_of_router_config , route_name );
2929}
3030
31- static inline int virtual_host_match_check (
32- Route__VirtualHost * virt_host , char * addr , ctx_buff_t * ctx , char * host_key , int host_key_len )
31+ static inline int
32+ virtual_host_match_check ( Route__VirtualHost * virt_host , char * addr , ctx_buff_t * ctx , char * host_key , int host_key_len )
3333{
3434 int i ;
3535 void * domains = NULL ;
@@ -56,7 +56,7 @@ static inline int virtual_host_match_check(
5656 if (((char * )domain )[0 ] == '*' && ((char * )domain )[1 ] == '\0' )
5757 return 1 ;
5858
59- if (bpf_km_header_strnstr (ctx , host_key , host_key_len , domain , BPF_DATA_MAX_LEN ) != 0 ) {
59+ if (bpf_km_header_strnstr (ctx , host_key , host_key_len , domain , BPF_DATA_MAX_LEN )) {
6060 return 1 ;
6161 } else {
6262 if (bpf__strncmp (addr , BPF_DATA_MAX_LEN , domain ) == 0 ) {
@@ -222,7 +222,7 @@ virtual_host_route_match_check(Route__Route *route, address_t *addr, ctx_buff_t
222222 if (!prefix )
223223 return 0 ;
224224
225- if (bpf_km_header_strnstr (ctx , uri , uri_len , prefix , BPF_DATA_MAX_LEN ) == 0 ) {
225+ if (! bpf_km_header_strnstr (ctx , uri , uri_len , prefix , BPF_DATA_MAX_LEN )) {
226226 return 0 ;
227227 }
228228
0 commit comments