Skip to content

Commit

Permalink
Disallow 0x0000 as a PAN ID
Browse files Browse the repository at this point in the history
The probability of it being randomly picked is about 0.002%
  • Loading branch information
puddly committed Nov 1, 2021
1 parent 31f1573 commit c5a2ec5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zigpy_znp/zigbee/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ async def form_network(self):
network_key = self.config[conf.CONF_NWK][conf.CONF_NWK_KEY]

if pan_id is None:
pan_id = random.SystemRandom().randint(0x0000, 0xFFFE + 1)
pan_id = random.SystemRandom().randint(0x0001, 0xFFFE + 1)

if extended_pan_id is None:
extended_pan_id = ExtendedPanId(os.urandom(8))
Expand Down

0 comments on commit c5a2ec5

Please sign in to comment.