Bug #6852
closedCommit 8f86722 breaks DHCPv6 leases status page
0%
Description
The commit in question changed the awk pattern used when getting DHCPv6 information from the lease file. The pattern was changed:
From: $splitpattern = "'BEGIN { RS=\"}\";} {for (i=1; i<=NF; i++) printf \"%s \", \$i; printf \"}\\n\";}'";
To: $splitpattern = "'{printf $0}; $0 ~ /^\}/ {printf \"\\n\"}'";
Commit in question: https://github.com/pfsense/pfsense/commit/8f867225f4c2d3e61863f8d87d4ddb4143d5dda6#diff-b48bdab1db8f78638fbf6c7d98a01172
See images below. Leases file is attached for reference (I don't really care about exposed information)
Files
Updated by Nick Venenga over 7 years ago
Affected version 2.3.2 (bug introduced in 2.3.2)
Updated by Jim Thompson over 7 years ago
- Category set to DHCP (IPv6)
- Assignee set to Renato Botelho
Updated by Brenton Rothchild over 7 years ago
This also just happened to me. There is more info when analyzing the stderr output from awk, or running the sed/awk command manually against the dhcpd6.leases file. For example:
awk: weird printf conversion %\000!\000\001\000\001\023\306\276\177\000\031\333\366\350\024" { input record number 1, file source line number 1 awk: not enough args in printf(ia-na "\220%\000!\000\001\000\001\023\306\276\177\000\031\333\366\350\024" {) input record number 1, file source line number 1
I'm not sure of the original intent of #6543, but it appears by using the print function instead of printf in the first part of the awk expression, this corrects the issue with "weird printf conversion". However, the awk command still wouldn't join leases into a single line for me.
As a suggestion, it appears the issue in this case is the % must be escaped before the awk printf (which is necessary to remove the trailing newline and join the lines into one). Adding an additional sed command of s,%,%%,g;
seems to help in this case and I can view the content of the attached leases file in the status page.
Updated by Jim Pingle over 7 years ago
If it breaks for you, please include the relevant portions of dhcpd6.leases that break it, or the entire file if possible. It works for many people, but given the wide variety of systems out there, plenty of edge cases exist where the format of the leases file might not parse as expected, so having the source data to fix the parser is crucial.
Updated by Michael Kellogg over 7 years ago
- File dhcpd6.leases dhcpd6.leases added
- File dhcpd6.leases~ dhcpd6.leases~ added
only ipv6 that i get to show up is static mappings so I attached requested file currently on 2.3.3-DEVELOPMENT (amd64)
built on Fri Dec 16 18:14:16 CST 2016 so I attached requested file
Updated by Michael Kellogg over 7 years ago
were the files I uploaded any help or is something more needed?
Updated by Michael Kellogg over 7 years ago
does reverting this commit in 2.3.3 with a patch (i dont know how) fix this its really annoying not having this populated
Updated by Michael Kellogg about 7 years ago
upgraded hardware due to c2000 restored config and this now works so guess somethin in my dhcp6 leases file had a problem maybe just delete file and see if it fixes problem