mirror of
https://github.com/openwrt/packages.git
synced 2026-06-17 14:50:07 +04:00
net-snmp: add early return when IPMask is unset
snmpd_access_HostIP_add would write unintended output to the config file if the IPMask option is not specified. Add an early return to prevent writing in that case. This is a breaking change for configs where IPMask is unset. Previously, an empty IPMask option would result in a malformed directive containing a trailing slash with no guaranteed newline, the exact form of which depended on the values of other options. Now, no directive is written. Signed-off-by: Eric McDonald <librick-openwrt@proton.me>
This commit is contained in:
committed by
Florian Eckert
parent
1215e7e87a
commit
b6ff8c79b1
@@ -160,6 +160,7 @@ snmpd_access_HostIP_add() {
|
||||
config_get host_ip "$cfg" HostIP
|
||||
[ -n "$host_ip" ] || return 0
|
||||
config_get ip_mask "$cfg" IPMask
|
||||
[ -n "$ip_mask" ] || return 0
|
||||
config_get mode "$cfg" Mode
|
||||
[ -n "$mode" ] || return 0
|
||||
config_get community "$cfg" CommunityName
|
||||
|
||||
Reference in New Issue
Block a user