Bug in /usr/sbin/lfd sub connectiontracking
Posted: 29 Aug 2024, 10:11
Bug in /usr/sbin/lfd sub connectiontracking
The hex2ip function strips leading zeros.
However for the string passed to inet_ntoa it simply strips the double colons, forgetting about the leading zeros.
This e.g. results in wrong ipv4 address for ipv4 connections on tcp6 sockets.
Example that goes wrong:
"0000000000000000FFFF0000CE0ACB74" -> "0:0:0:0:0:ffff:74cb:ace" -> "7.76.186.206"
correct would have been "116.203.10.206"
You might also want to check if a similar bug is in other places in the code (I did not check that).
Edit: Same bug is in sub processtracking.
The hex2ip function strips leading zeros.
However for the string passed to inet_ntoa it simply strips the double colons, forgetting about the leading zeros.
This e.g. results in wrong ipv4 address for ipv4 connections on tcp6 sockets.
Example that goes wrong:
"0000000000000000FFFF0000CE0ACB74" -> "0:0:0:0:0:ffff:74cb:ace" -> "7.76.186.206"
correct would have been "116.203.10.206"
You might also want to check if a similar bug is in other places in the code (I did not check that).
Edit: Same bug is in sub processtracking.