Calling this dm_strword with an emtpy 'str' can cause invalid memory
access. This commit checks for an empty string.
NOTE: This function is insecure and can cause segfaults
when 'str' is larger than 'source'
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
For the changes done in branch, some changes in dmcommon were overwritten
accidentally, reverting the same. Only leaves snooping mode related
changes in the branch now.
Added support for MLD configuration using the new proposed data
model.
Resolve bug in IGMP to be able to delete child objects when
parents are deleted from the dmmap_mcast file.
Remove the hard coded value of Filter.Enable and added configuration
support for the same.
Note: With this, I think I am ready to raise merge request for this,
I will finalise the mcastmngr changes now and then raise a merge request
once that is in iopsys devel
Changes done are:
1. Interfaces in the proxy uci section are called upstream_interface
and downstream_interface as against proxy_interface and snooping_interface
earlier.
2. The interface now bears the value of the actual linux interface, so,
the upstream interface for example is now eth4.1 instead of wan.
3. A bug in the determining of bridging instance was identified and fixed.
The UCI looks as follows now:
root@iopsys:~# cat /etc/config/mcast
config proxy 'mproxy_1'
option enable '0'
option proto 'igmp'
option version '2'
option robustness '2'
option aggregation '0'
option last_member_query_interval '10'
option query_interval '120'
option query_response_interval '10'
list downstream_interface 'br-wan100'
list upstream_interface 'eth4.1'
config snooping 'msnoop_1'
option enable '0'
option proto 'igmp'
option version '2'
option robustness '2'
option aggregation '0'
option interface 'br-wan100'
- Fixed issue in Ethernet Link deletion.
- Fixed deletion of untagged interfaces section from UCI.
- Fixed in setting lower layers for Ethernet link in case of untagged management interface.
- Fixed issue of adding same ports with different vlan id under different bridge.
- don't export symbols that are not used ouside of dhcpv4.c
- make read only values const
- remove uneceessary memory allocations and duplications
- avoid "router.network" calls for compatibitliy with generic openwrt builds
- move redundand code to functions
- remove tab indents on empty lines
- avoid opening and parsing DHCP_LEASE_FILE multiple times
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
There is not always an "ifname" option in the wifi-iface section.
This commit uses ubus to resolve the right interface for the SSID.
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
This function was only used to query interface statistics,
which are now read direclty from sysfs.
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
- use sysfs instread of ubus and ifconfig command execution for Inteface stats.
This reduces uneccessary memory and cpu overhead and speeds up the query time for
IP.Interface queries by a multiple.
- move redundant code to static functions
- fix rx/tx multicast/broadcast stats can never be obtained from ifconfig
- fix invalid stats for unknownprotopackets.
- fix stats not correclty reported when counters exceed 32bit int values.
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
- use sysfs instread of ubus and ifconfig command execution for Inteface stats.
This reduces uneccessary memory and cpu overhead and speeds up the query time for
IP.Interface queries by a multiple.
- move redundant code to static functions
- fix rx/tx multicast/broadcast stats can never be obtained from ifconfig
- fix invalid stats for unknownprotopackets.
- fix stats not correclty reported when counters exceed 32bit int values.
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
- avoid uneccessary memory allocations
- move {read,write}FileContent functions to usb source file where they are used exclusively and make them static
- fix bad logic in readFileContent
- move redundant code to static functions
- fix get_USBUSBHostsHostDevice_MaxChildren never returning any value
- fix no interface instances being created
- make some functions that are not exported static
- fix segfault on get_USBInterface_Enable when the interface is down
- fix segfault on get_USBInterface_Status when the interface is down.
- fix segfault on missing format character in get_USBInterface_LowerLayers.
- fix segfault and double frees on recrusive browseUSBUSBHostsHostInst() calls.
- reduce overall memory usage
- use const on read-only values
- fix invalid comparision on strstr return value
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
Update fsize by the actual read bytes from fread,
because ftell will always return 4k on sysfs files.
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>