misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
0b07bf3621
commit
705040e075
pwnagotchi/mesh
@ -152,7 +152,7 @@ class Advertiser(object):
|
|||||||
if self._is_broadcasted_advertisement(dot11):
|
if self._is_broadcasted_advertisement(dot11):
|
||||||
try:
|
try:
|
||||||
dot11elt = p.getlayer(Dot11Elt)
|
dot11elt = p.getlayer(Dot11Elt)
|
||||||
if dot11elt.ID == wifi.Dot11ElemID_Identity:
|
if dot11elt.ID == wifi.Dot11ElemID_Whisper:
|
||||||
self._parse_identity(p[RadioTap], dot11, dot11elt)
|
self._parse_identity(p[RadioTap], dot11, dot11elt)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
SignatureAddress = 'de:ad:be:ef:de:ad'
|
SignatureAddress = 'de:ad:be:ef:de:ad'
|
||||||
BroadcastAddress = 'ff:ff:ff:ff:ff:ff'
|
BroadcastAddress = 'ff:ff:ff:ff:ff:ff'
|
||||||
Dot11ElemID_Identity = 222
|
Dot11ElemID_Whisper = 222
|
||||||
NumChannels = 140
|
NumChannels = 140
|
||||||
|
|
||||||
def freq_to_channel(freq):
|
def freq_to_channel(freq):
|
||||||
@ -30,7 +30,7 @@ def encapsulate(payload, addr_from, addr_to=BroadcastAddress):
|
|||||||
while data_left > 0:
|
while data_left > 0:
|
||||||
sz = min(chunk_size, data_left)
|
sz = min(chunk_size, data_left)
|
||||||
chunk = payload[data_off: data_off + sz]
|
chunk = payload[data_off: data_off + sz]
|
||||||
frame /= Dot11Elt(ID=Dot11ElemID_Identity, info=chunk, len=sz)
|
frame /= Dot11Elt(ID=Dot11ElemID_Whisper, info=chunk, len=sz)
|
||||||
data_off += sz
|
data_off += sz
|
||||||
data_left -= sz
|
data_left -= sz
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user