diff options
| author | liuxueli <[email protected]> | 2021-11-01 08:25:47 +0300 |
|---|---|---|
| committer | liuxueli <[email protected]> | 2021-11-01 08:25:47 +0300 |
| commit | 092aba6df71849ddf72761f0d54cafc74bcff64a (patch) | |
| tree | 857e5ce6fd1159edd7d6bf002d1fb1777c250fef | |
| parent | 72254973b6df6402cd203c1747ee59d71a732154 (diff) | |
TSG-8269: 命中监测策略镜像流量至第三方,当默认vlan_id=0时不再封装vlan头v5.4.9
| -rw-r--r-- | src/tsg_traffic_mirror.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tsg_traffic_mirror.cpp b/src/tsg_traffic_mirror.cpp index df36f16..71bc81f 100644 --- a/src/tsg_traffic_mirror.cpp +++ b/src/tsg_traffic_mirror.cpp @@ -154,7 +154,10 @@ int tsg_traffic_mirror_send_burst(struct traffic_mirror *ttm,char * pkt_ptr,int marsio_buff_t * tx_buff_ptr = tx_buff[i]; char * tx_buff_begin = marsio_buff_append(tx_buff_ptr, pkt_len); memcpy(tx_buff_begin, pkt_ptr, pkt_len); - marsio_buff_set_metadata(tx_buff_ptr,MR_BUFF_METADATA_VLAN_TCI,&vlan_id,sizeof(vlan_id)); + if(vlan_id>0) + { + marsio_buff_set_metadata(tx_buff_ptr,MR_BUFF_METADATA_VLAN_TCI,&vlan_id,sizeof(vlan_id)); + } } ret = marsio_send_burst(ttm->to_dev_sendpath, thread_seq, tx_buff, tx_buffer_num); |
