diff options
| author | fumingwei <[email protected]> | 2022-02-08 16:14:10 +0800 |
|---|---|---|
| committer | fumingwei <[email protected]> | 2022-02-08 16:14:10 +0800 |
| commit | d1df1bd8a68e48e434ffae00e83a05c0635cf5f4 (patch) | |
| tree | 8ac14c6426f9ace16ed2c46b0319380643f54622 /entry/src/kni_entry.cpp | |
| parent | cc234d4a1c6a224fcb8f192af1d53ded48822323 (diff) | |
feature:TSG-9539:kni新增cmsg字段支持4级或以上定位库v22.02.02
Diffstat (limited to 'entry/src/kni_entry.cpp')
| -rw-r--r-- | entry/src/kni_entry.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/entry/src/kni_entry.cpp b/entry/src/kni_entry.cpp index 773cf95..729e1ff 100644 --- a/entry/src/kni_entry.cpp +++ b/entry/src/kni_entry.cpp @@ -378,6 +378,8 @@ static int session_attribute_cmsg_set(struct kni_cmsg *cmsg, struct pme_info *pm if(ret < 0) break; ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_SRC_IP_LOCATION_CITY, (const unsigned char*)empty_arr, strlen(empty_arr), pmeinfo); if(ret < 0) break; + ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_SRC_IP_LOCATION_SUBDIVISION, (const unsigned char*)empty_arr, strlen(empty_arr), pmeinfo); + if(ret < 0) break; } else { @@ -399,6 +401,12 @@ static int session_attribute_cmsg_set(struct kni_cmsg *cmsg, struct pme_info *pm ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_SRC_IP_LOCATION_CITY, (const unsigned char*)session_attribute->client_location->city_full, strlen(session_attribute->client_location->city_full), pmeinfo); } if(ret < 0) break; + if(session_attribute->client_location->subdivision_addr == NULL){ + ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_SRC_IP_LOCATION_SUBDIVISION, (const unsigned char*)empty_arr, strlen(empty_arr), pmeinfo); + }else{ + ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_SRC_IP_LOCATION_SUBDIVISION, (const unsigned char*)session_attribute->client_location->subdivision_addr, strlen(session_attribute->client_location->subdivision_addr), pmeinfo); + } + if(ret < 0) break; } if(session_attribute->server_location == NULL) @@ -409,6 +417,8 @@ static int session_attribute_cmsg_set(struct kni_cmsg *cmsg, struct pme_info *pm if(ret < 0) break; ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_DST_IP_LOCATION_CITY, (const unsigned char*)empty_arr, strlen(empty_arr), pmeinfo); if(ret < 0) break; + ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_DST_IP_LOCATION_SUBDIVISION, (const unsigned char*)empty_arr, strlen(empty_arr), pmeinfo); + if(ret < 0) break; } else { @@ -430,6 +440,12 @@ static int session_attribute_cmsg_set(struct kni_cmsg *cmsg, struct pme_info *pm ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_DST_IP_LOCATION_CITY, (const unsigned char*)session_attribute->server_location->city_full, strlen(session_attribute->server_location->city_full), pmeinfo); } if(ret < 0) break; + if(session_attribute->server_location->subdivision_addr == NULL){ + ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_DST_IP_LOCATION_SUBDIVISION, (const unsigned char*)empty_arr, strlen(empty_arr), pmeinfo); + }else{ + ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_DST_IP_LOCATION_SUBDIVISION, (const unsigned char*)session_attribute->server_location->subdivision_addr, strlen(session_attribute->server_location->subdivision_addr), pmeinfo); + } + if(ret < 0) break; } if(session_attribute->ja3_fingerprint == NULL) ret = wrapped_kni_cmsg_set(cmsg,TFE_CMSG_SSL_CLIENT_JA3_FINGERPRINT, (const unsigned char*)empty_arr, strlen(empty_arr), pmeinfo); |
