A few weeks, I noticed a bug in AREDN mesh V3.22.6.0 when I wanted to change some settings from the "Port Forwarding, DHCP, and Services" section. Reverting to V3.22.1.0 made everything functional again.
It took sometimes to figure out was exactly was the bug. When I narrowed it to the port ranges inside the port forwarding section, it has been indicated inside the original ticket.
Time past and it was causing more and more troubles to our setup. So this morning I took an hour to look at the code. Not being a LUA dev, I wanted this bug fixed and if I may be of any help, better help out!
Starting at V3.22.1.0 to understand the logic behind the scene, I found out how it works. I took time to concentrate on the validate_port_range
function.
Between V3.22.1.0 and V3.22.6.0, the code has been rewritten in LUA, so I got the intuition that this rewrite might a brought in some problems.
Moving to main branch (V3.22.12.0 (Latest)) , to ensure not working on obsolete code, I found out the validate_port_range
function and read the code. So I found out a first mistake while evaluation if the range is properly indicated (ex: 1000-2000 = Valid / 2000-1000 = Invalid). Simple and easy to fix.
Made the changes on my lab device and still no joy! So what is the worst thing (IMHO) to convert from one language to another... ? REGEX! So I made a quick search to 'learn' how REGEX are working in LUA to get some answer. Opened up a JDoodle tab and started to play with the REGEX line until the various tests with valid and invalid ranges returns proper results.
Pushed the new REGEX in the lab device and Bingo! It is now working properly.
Arranged a PR (First PR on the project), submitted it and now waiting for it to be reviewed and merged. In the hope I didn't break something else!
Once included into nightly
, our 2 gateways requiring port ranges will be back to normal operations and so will be our VoIP servers behind them!
#AmateurRadio #AREDN #AREDNMesh #LUA #Bugs #VoIP #Scriptkiddy #OpenSource #FirstPullRequest
#amateurradio #aredn #arednmesh #lua #bugs #voip #scriptkiddy #opensource #FirstPullRequest
Oh right my #FirstPullRequest on Github was switching Diaspora to an actual markdown parser, mainly so I could use Diaspora for the kind of posts I wanted to make.
https://github.com/diaspora/diaspora/pull/1779
Can look for yours at https://firstpr.me/