anchor.diff:          [D] ->
               case aes_cmac:aes_cmac(D#device.appkey, Msg, 4) of
                   MIC ->
  -                    handle_join(D, DevNonce);
  +                    handle_join(MAC, D, DevNonce);
                   _MIC2 ->
                       {error, {device, DevEUI}, bad_mic}
               end
  
positive.code:                 [] ->
                      {error, {device, DevEUI}, {unknown_group, GroupName}, aggregated};
                  [#group{can_join=false}] ->
                      lager:debug("Join ignored from DevEUI ~s", [binary_to_hex(DevEUI)]),
                      ignore;
                  [#group{network=NetName, subid=SubID}] ->
                      case mnesia:read(network, NetName, read) of
  
negative.code:     ingest_data_frame(MAC, MType, Msg, FOpts, FRMPayload, MIC,
          #frame{conf=Confirm, devaddr=DevAddr, adr=ADR, adr_ack_req=ADRACKReq, ack=ACK, fcnt=FCnt, port=Port});
  ingest_frame0(MAC, MType, Msg, _MIC) ->
      lager:warning("~s bad frame (mtype ~.2B): ~p", [binary_to_hex(MAC), MType, Msg]),
      ignore.
  
  ingest_data_frame(_MAC, MType, Msg, FOpts, FRMPayload, MIC,
  