Skip to content

Commit

Permalink
ns: Reject unexpected RekeyInd
Browse files Browse the repository at this point in the history
  • Loading branch information
adriansmares committed Oct 16, 2023
1 parent 658b840 commit 18a44f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/networkserver/mac/rekey.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ func HandleRekeyInd(ctx context.Context, dev *ttnpb.EndDevice, pld *ttnpb.MACCom
evs := events.Builders{
EvtReceiveRekeyIndication.With(events.WithData(pld)),
}
if !dev.SupportsJoin {
if !dev.SupportsJoin || !macspec.UseRekeyInd(dev.LorawanVersion) {
return evs, nil
}
if dev.PendingSession != nil && dev.MacState.PendingJoinRequest != nil && types.MustDevAddr(dev.PendingSession.DevAddr).OrZero().Equal(devAddr) {
if dev.PendingSession != nil &&
dev.MacState.PendingJoinRequest != nil &&
types.MustDevAddr(dev.PendingSession.DevAddr).OrZero().Equal(devAddr) {
dev.Ids.DevAddr = dev.PendingSession.DevAddr
dev.Session = dev.PendingSession
}
Expand Down

0 comments on commit 18a44f1

Please sign in to comment.