Now MAC filter deny is supported. (Only accept was supported.)#43
Now MAC filter deny is supported. (Only accept was supported.)#43zaibaq wants to merge 1 commit intogarywill:masterfrom
Conversation
02a153b to
ee858a8
Compare
|
Any updates regarding this? @garywill |
|
Hi, @zaibaq . Your commit has 300+ lines changes, which is too hard for us to review. You can use some GUI tool to choose lines to put into a commit, like |
lnxrouter
Outdated
| WIFI_IFACE= | ||
| CHANNEL=default | ||
| WPA_VERSION=2 | ||
| MAC_FILTER=0 |
There was a problem hiding this comment.
Since we're changing the meaning of this variable (from "enable mac filter or not" to "macaddr_acl in hostapd.conf" ),
we should use a new variable name MACADDR_ACL
| CHANNEL=default | ||
| WPA_VERSION=2 | ||
| MAC_FILTER=0 | ||
| MAC_FILTER=3 # 3 is not valid |
There was a problem hiding this comment.
Leave it blank (or use -1 or -99) is better. hostapd may add 3 as a valid value in the future
| shift | ||
| if [ "$MAC_FILTER_TYPE" == "deny" ] | ||
| then | ||
| printf "ERROR: Can't use --mac-filter-accept and --mac-filter-deny together.\n" |
| --mac-filter-deny) | ||
| shift | ||
| MAC_FILTER_ACCEPT="$1" | ||
| if [ "$MAC_FILTER_TYPE" == "accept" ] |
There was a problem hiding this comment.
This variable MAC_FILTER_TYPE would be unnecessary. Use that MACADDR_ACL
| if [[ $MAC_FILTER -eq 0 ]]; then | ||
| cat <<- EOF >> "$CONFDIR/hostapd.conf" | ||
| macaddr_acl=0 | ||
| deny_mac_file=${MAC_FILTER_FILE} |
There was a problem hiding this comment.
I'm thinking ...
maybe we can make the script option like this:
--mac-filter-accept <accept_file>
--mac-filter-deny <deny_file>
then variable MAC_FILTER_FILE and option --mac-filter-file would be unnecessary .
--mac-filter-accept - will apply the default path /etc/hostapd/hostapd.accept.
--mac-filter-deny - similar to above
What do you think?
This is to support
--mac-filter-denyafter only--mac-filter-acceptwas supported.Use:
If you want to use deny acl, use the option
--mac-filter-deny. Similarly for accept acl, use--mac-filter-accept.Obviously, you cannot use both options at the same time.
If you want to set a specific path for the mac addresses file, whether you're using deny or accept, you need to set the option
--mac-filter-file <MAC_ADDRESSES_FILE>.