Bandwidthd advanced filter syntax error
-
Hi.
Having a problem with how pfsense writes out the config file when you enter an advanced filter.
Without putting in an advanced filter everything works, but bandwidthd includes local non internet traffic.
So I put this in the advanced filter:
ip and not ((src net 192.168.5) and (dst net 192.168.5))
This causes bandwidthd to subsequently not start:
# /usr/local/etc/rc.d/bandwidthd.sh start Syntax Error "syntax error" on line 57
Line 57 in the config is:
filter 'ip and not ((src net 192.168.5) and (dst net 192.168.5))'
Changing the single quotes to double quotes seems to solve it:
filter "ip and not ((src net 192.168.5) and (dst net 192.168.5))"
#/usr/local/etc/rc.d/bandwidthd.sh start #ps afx|grep bandwidthd 42952 0 S 0:00.00 /usr/pbi/bandwidthd-amd64/local/bandwidthd/bandwidthd 43060 0 S 0:00.00 /usr/pbi/bandwidthd-amd64/local/bandwidthd/bandwidthd 43234 0 S 0:00.00 /usr/pbi/bandwidthd-amd64/local/bandwidthd/bandwidthd 43444 0 S 0:00.00 /usr/pbi/bandwidthd-amd64/local/bandwidthd/bandwidthd 44127 0 S+ 0:00.00 grep bandwidthd
Is this a problem with how pfsense writes out the config, or with bandwidthd's parsing of the config?
This is on pfsense 2.2.4 amd64 full install (not nanobsd), and bandwidthd 0.6.1.
Thanks.
-
This is done with escapeshellarg(); I tested it with the simple example shown in the GUI and it had no issues with that. As noted in the GUI, you are on your own with this. Replaced this with double quotes, don't think this will ever get fixed in the dead upstream code.
https://github.com/pfsense/pfsense-packages/pull/1034
-
Hello I have the same problem. Im running: 2.2.4-RELEASE (i386)
I’m trying not to account internal traffic, only traffic going to the internet.
When I try in the “Advanced Filter” Field any of the following options I get an error: “Syntax Error "syntax error" on line 57
Options I have tried:
filter ip and not dst net 192.168.0.0 mask 255.255.0.0
ip and not dst net 192.168.0.0 mask 255.255.0.0The example provided in the GUI also don't work (ip and host 192.0.2.1) same error.
If someone can help I will appreciate a lot. Thanks.
-
The example in the GUI is what it was tested with and certainly does not produce any syntax error here… That assumes you are using the latest package versions. Otherwise, you are welcome to provide a patch that works for you. Otherwise, the field can go to /dev/null as well.