兼容双臂模式下没有原始mac
This commit is contained in:
@@ -554,6 +554,8 @@ static unsigned char* kni_cmsg_serialize_header_new(struct pme_info *pmeinfo, st
|
||||
uint16_t server_mss = htons(pmeinfo->server_tcpopt.mss);
|
||||
uint16_t client_window = htons(pmeinfo->client_window);
|
||||
uint16_t server_window = htons(pmeinfo->server_window);
|
||||
char src_mac[6] = {0};
|
||||
char dst_mac[6] = {0};
|
||||
//seq
|
||||
int ret = wrapped_kni_cmsg_set(cmsg, TFE_CMSG_TCP_RESTORE_SEQ, (const unsigned char*)&seq, 4, pmeinfo);
|
||||
if(ret < 0) goto error_out;
|
||||
@@ -606,22 +608,18 @@ static unsigned char* kni_cmsg_serialize_header_new(struct pme_info *pmeinfo, st
|
||||
strnlen(pmeinfo->stream_traceid, sizeof(pmeinfo->stream_traceid)), pmeinfo);
|
||||
if(ret < 0) goto error_out;
|
||||
//src mac
|
||||
char src_mac[6];
|
||||
ret = get_rawpkt_opt_from_streaminfo(stream, RAW_PKT_GET_VXLAN_OUTER_GDEV_MAC, src_mac);
|
||||
if(ret < 0){
|
||||
KNI_LOG_ERROR(logger, "Failed at get src mac from rawpkt, ret = %d", ret);
|
||||
goto error_out;
|
||||
KNI_LOG_DEBUG(logger, "Failed at get src mac from rawpkt, ret = %d, maybe two-arm mode", ret);
|
||||
}
|
||||
KNI_LOG_DEBUG(logger, "Succeed at get src mac from rawpkt, addr = %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx",
|
||||
src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5]);
|
||||
ret = wrapped_kni_cmsg_set(cmsg, TFE_CMSG_SRC_MAC, (const unsigned char*)src_mac, sizeof(src_mac), pmeinfo);
|
||||
if(ret < 0) goto error_out;
|
||||
//dst mac
|
||||
char dst_mac[6];
|
||||
ret = get_rawpkt_opt_from_streaminfo(stream, RAW_PKT_GET_VXLAN_OUTER_LOCAL_MAC, dst_mac);
|
||||
if(ret < 0){
|
||||
KNI_LOG_ERROR(logger, "Failed at get dst mac from rawpkt, ret = %d", ret);
|
||||
goto error_out;
|
||||
KNI_LOG_DEBUG(logger, "Failed at get dst mac from rawpkt, ret = %d, maybe two-arm mode", ret);
|
||||
}
|
||||
KNI_LOG_DEBUG(logger, "Succeed at get dst mac from rawpkt, addr = %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx",
|
||||
dst_mac[0], dst_mac[1], dst_mac[2], dst_mac[3], dst_mac[4], dst_mac[5]);
|
||||
|
||||
Reference in New Issue
Block a user