Skip to content

TR181: Segmentation Fault with add_object Device.NAT.PortMapping.

Feten Besbes requested to merge gnx24827 into devel

The add function of Device.NAT.PortMapping. when it is called add new redirect section in firewall configuration with dest and src hardcoded values. After checking Openwrt firewall documentation https://openwrt.org/docs/guide-user/firewall/firewall_configuration , we find out that dest option can be removed and it will be replaced by dest_ip set through parameter https://cwmp-data-models.broadband-forum.org/tr-181-2-11-0.html#D.Device:2.Device.NAT.PortMapping.{i} For src option it will be set by Device.NAT.PortMApping.{i}.Interface.

When add request is called the section redirect will be created as follow

config redirect 'cfg1c3837' option name 'port_map_1' option target 'DNAT' option enabled '0'

Edited by Sukru Senli

Merge request reports