fake-gateway: fix path hop mac
The hop is added to the slice by value, so the MAC needs to be
set before adding it to the slice.
GitOrigin-RevId:
@@ -255,12 +255,12 @@ func parsePath(rawPath rawPath, creationTime time.Time) (snet.Path, error) {
ConsEgress: rawHF.Egress,
ExpTime: rawHF.ExpTime,
}
- sp.HopFields = append(sp.HopFields, hf)
macGen, err := scrypto.HFMacFactory(rawHF.Key)
if err != nil {
return nil, err
}
hf.Mac = path.MAC(macGen(), sp.InfoFields[0], hf, nil)
+ sp.HopFields = append(sp.HopFields, hf)
sp.InfoFields[0].UpdateSegID(hf.Mac)
}
sp.InfoFields[0].SegID = initialSegID
