Skip to content

Commit

Permalink
drop bad interests
Browse files Browse the repository at this point in the history
  • Loading branch information
tianyuan129 committed Dec 20, 2024
1 parent 8244525 commit e6a4f10
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ndn_python_repo/utils/passive_svs.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ def sync_handler(self, name: FormalName, _param: InterestParam, _app_param: Bina
if len(name) != len(self.base_prefix) + 2:
logging.error(f'Received invalid Sync Interest: {Name.to_str(name)}')
return
logging.info(f'Received Sync Interest: {Name.to_str(name)}')
_, _, _, sig_ptrs = parse_interest(raw_packet)
sig_info = sig_ptrs.signature_info
if sig_info and sig_info.key_locator and sig_info.key_locator.name:
logging.info(f'Received Sync Interest: {Name.to_str(sig_info.key_locator.name)}')
else:
logging.info(f'Drop unsigned or improperly signed Sync Snterests')
return
try:
remote_sv_pkt = StateVecWrapper.parse(name[-2]).val
except (DecodeError, IndexError) as e:
Expand Down

0 comments on commit e6a4f10

Please sign in to comment.