@@ -396,25 +396,29 @@ bool MirrorOrch::activateSession(const string& name, MirrorEntry& session)
396
396
attr.value .s32 = SAI_MIRROR_SESSION_TYPE_ENHANCED_REMOTE;
397
397
attrs.push_back (attr);
398
398
399
- attr.id = SAI_MIRROR_SESSION_ATTR_VLAN_HEADER_VALID;
400
- attr.value .booldata = true ;
401
- attrs.push_back (attr);
399
+ /* Add the VLAN header when the packet is sent out from a VLAN */
400
+ if (session.neighborInfo .vlanId )
401
+ {
402
+ attr.id = SAI_MIRROR_SESSION_ATTR_VLAN_HEADER_VALID;
403
+ attr.value .booldata = true ;
404
+ attrs.push_back (attr);
402
405
403
- attr.id =SAI_MIRROR_SESSION_ATTR_VLAN_TPID;
404
- attr.value .u16 = ETH_P_8021Q;
405
- attrs.push_back (attr);
406
+ attr.id =SAI_MIRROR_SESSION_ATTR_VLAN_TPID;
407
+ attr.value .u16 = ETH_P_8021Q;
408
+ attrs.push_back (attr);
406
409
407
- attr.id =SAI_MIRROR_SESSION_ATTR_VLAN_ID;
408
- attr.value .u16 = session.neighborInfo .vlanId ;
409
- attrs.push_back (attr);
410
+ attr.id =SAI_MIRROR_SESSION_ATTR_VLAN_ID;
411
+ attr.value .u16 = session.neighborInfo .vlanId ;
412
+ attrs.push_back (attr);
410
413
411
- attr.id = SAI_MIRROR_SESSION_ATTR_VLAN_PRI;
412
- attr.value .u8 = MIRROR_SESSION_DEFAULT_VLAN_PRI;
413
- attrs.push_back (attr);
414
+ attr.id = SAI_MIRROR_SESSION_ATTR_VLAN_PRI;
415
+ attr.value .u8 = MIRROR_SESSION_DEFAULT_VLAN_PRI;
416
+ attrs.push_back (attr);
414
417
415
- attr.id = SAI_MIRROR_SESSION_ATTR_VLAN_CFI;
416
- attr.value .u8 = MIRROR_SESSION_DEFAULT_VLAN_CFI;
417
- attrs.push_back (attr);
418
+ attr.id = SAI_MIRROR_SESSION_ATTR_VLAN_CFI;
419
+ attr.value .u8 = MIRROR_SESSION_DEFAULT_VLAN_CFI;
420
+ attrs.push_back (attr);
421
+ }
418
422
419
423
attr.id = SAI_MIRROR_SESSION_ATTR_ERSPAN_ENCAPSULATION_TYPE;
420
424
attr.value .s32 = SAI_ERSPAN_ENCAPSULATION_TYPE_MIRROR_L3_GRE_TUNNEL;
0 commit comments