Closed dungru closed 2 years ago
I would invite @lekoOwO for reviewing.
What's the pro of storing AP info?
The main purpose of generating bssid from hash(ssid)
is to make it stateless, so we do not need to store it.
If we're going to store it into a hash table, the bssid can be generated from a random number instead of hash(ssid)
.
What's the pro of storing AP info?
The main purpose of generating bssid from
hash(ssid)
is to make it stateless, so we do not need to store it. If we're going to store it into a hash table, the bssid can be generated from a random number instead ofhash(ssid)
.
Actually, if you don't change SSID, the murmurhash result will always same.
The AP info always get update when module_param
has changed and trigger STA scan.
The hash table provides a more efficient way to get AP info with O(1).
On the other hand, this table could extend other AP information fields (i.e. security type) not just store the bssid.
The original method iterate every SSID string, it cost O(n).
What's the pro of storing AP info? The main purpose of generating bssid from
hash(ssid)
is to make it stateless, so we do not need to store it. If we're going to store it into a hash table, the bssid can be generated from a random number instead ofhash(ssid)
.Actually, if you don't change SSID, the murmurhash result will always same. The AP info always get update when
module_param
has changed and trigger STA scan. The hash table provides a more efficient way to get AP info with O(1). On the other hand, this table could extend other AP information fields (i.e. security type) not just store the bssid. The original method iterate every SSID string, it cost O(n).
I see.
Then we'd need a limit for stored AP Infos. Also the bssid can now be generated randomly instead of hashing ssid.
It might help understanding the code if we comment that the field in AP info is extendable.
What's the pro of storing AP info? The main purpose of generating bssid from
hash(ssid)
is to make it stateless, so we do not need to store it. If we're going to store it into a hash table, the bssid can be generated from a random number instead ofhash(ssid)
.Actually, if you don't change SSID, the murmurhash result will always same. The AP info always get update when
module_param
has changed and trigger STA scan. The hash table provides a more efficient way to get AP info with O(1). On the other hand, this table could extend other AP information fields (i.e. security type) not just store the bssid. The original method iterate every SSID string, it cost O(n).I see.
Then we'd need a limit for stored AP Infos. Also the bssid can now be generated randomly instead of hashing ssid.
It might help understanding the code if we comment that the field in AP info is extendable.
If we generate the BSSID such as eth_random_addr()
in every scan stage for same SSID, how could we make sure same SSID will not mapping to different BSSID. When BSSID is changed during STA which is under following probe/associate/4-way hand shake/port secured staged or even AP and STA are connected. The WPA supplicant will found the SSID and BSSID is not match and abort the state machine.
Correct me if I am wrong.
What's the pro of storing AP info? The main purpose of generating bssid from
hash(ssid)
is to make it stateless, so we do not need to store it. If we're going to store it into a hash table, the bssid can be generated from a random number instead ofhash(ssid)
.Actually, if you don't change SSID, the murmurhash result will always same. The AP info always get update when
module_param
has changed and trigger STA scan. The hash table provides a more efficient way to get AP info with O(1). On the other hand, this table could extend other AP information fields (i.e. security type) not just store the bssid. The original method iterate every SSID string, it cost O(n).I see. Then we'd need a limit for stored AP Infos. Also the bssid can now be generated randomly instead of hashing ssid. It might help understanding the code if we comment that the field in AP info is extendable.
If we generate the BSSID such as
eth_random_addr()
in every scan stage for same SSID, how could we make sure same SSID will not mapping to different BSSID. When BSSID is changed during STA which is under following probe/associate/4-way hand shake/port secured staged or even AP and STA are connected. The WPA supplicant will found the SSID and BSSID is not match and abort the state machine.Correct me if I am wrong.
We should not generate BSSID in every stage since we have a database now 🤔
strspn
andstrcspn
to parsing the parameter.ap_info_hash