In PR187835 larger data couldn't be converted from BINARY to ASCII. The code does reach an hardcoded limit.
This patch allocated the necessary memory dynamically starting with a value which is sufficient for almost all normal cases.
Differential D23840
netgraph/ng_base: Allow larger BINARY2ASCII conversions donner on Feb 26 2020, 12:48 PM. Authored by Tags None Referenced Files
Details
In PR187835 larger data couldn't be converted from BINARY to ASCII. The code does reach an hardcoded limit. This patch allocated the necessary memory dynamically starting with a value which is sufficient for almost all normal cases. Try the example in the bug report. I did add some debugging output to the code to validate the resizing is working correctly: /usr/src/sys/netgraph/ng_base.c:2834: Double bufSize=1024 /usr/src/sys/netgraph/ng_base.c:2834: Double bufSize=2048 /usr/src/sys/netgraph/ng_base.c:2834: Double bufSize=4096 /usr/src/sys/netgraph/ng_base.c:2834: Double bufSize=8192 /usr/src/sys/netgraph/ng_base.c:2834: Double bufSize=16384 /usr/src/sys/netgraph/ng_base.c:2834: Double bufSize=32768 /usr/src/sys/netgraph/ng_base.c:2834: Double bufSize=65536 /usr/src/sys/netgraph/ng_base.c:2834: Double bufSize=131072 /usr/src/sys/netgraph/ng_base.c:2834: Double bufSize=262144 /usr/src/sys/netgraph/ng_base.c:2834: Double bufSize=524288 /usr/src/sys/netgraph/ng_base.c:2834: Double bufSize=1048576 Of course, to transmit the data via the ng_socket, the buffer sizes needs to be adjusted manually. net.graph.recvspace: 204800 net.graph.maxdgram: 204800 To transmit arbitary large data, it's better to change the ng_socket interface (incl. libnetgraph), but that is out of scope of this issue here.
Diff Detail
Event Timeline
Comment Actions That are the numbers for 400 CPE connecting per line for 12 lines and 900 active clients (dhclient ngethxxx). Type name Number of living nodes --------- ---------------------- car 452 patch 12 tag 13 one2many 13 bridge 2 bpf 1 tee 13 vlan_rotate 1 vlan 4865 eiface 9600 socket 2 The default 1k buffer is sufficient to setup and operate this network. |