mirror of
https://github.com/soypat/lneto.git
synced 2026-09-11 00:59:30 +00:00
ethernet: refactor VLAN API
This commit is contained in:
+2
-4
@@ -58,11 +58,9 @@ func testMoveTCPPacket(t *testing.T, src, dst []byte) {
|
||||
*efrm2.DestinationHardwareAddr() = *efrm.DestinationHardwareAddr()
|
||||
*efrm2.SourceHardwareAddr() = *efrm.SourceHardwareAddr()
|
||||
efrm2.SetEtherType(efrm.EtherTypeOrSize())
|
||||
if efrm.EtherTypeOrSize() == ethernet.TypeVLAN {
|
||||
efrm2.SetVLANTag(efrm.VLANTag())
|
||||
efrm2.SetVLANEtherType(efrm.VLANEtherType())
|
||||
if efrm.IsVLAN() {
|
||||
efrm2.SetVLAN(efrm.VLAN())
|
||||
}
|
||||
|
||||
ifrm2, _ := ipv4.NewFrame(efrm2.Payload())
|
||||
ifrm2.SetVersionAndIHL(ifrm.VersionAndIHL())
|
||||
ifrm2.SetToS(ifrm.ToS())
|
||||
|
||||
Reference in New Issue
Block a user