nm-l2tp / NetworkManager-l2tp

L2TP and L2TP/IPsec support for NetworkManager
GNU General Public License v2.0
486 stars 83 forks source link

Fix detecting libreswan on newer vesions #194

Closed hedayat closed 1 year ago

hedayat commented 1 year ago

Starting from libreswan 4.9, it has started to print a simplified version string; e.g. "Libreswan 4.9", so we need to modify how we detect libreswan accordingly. This change adds detecting newer versions in addition to the older ones.

Note: I've not tested the change yet :( I'll try to test it soon.

dkosovic commented 1 year ago

I haven't had a chance to test it yet with libreswan 4.9 but will hopefully on the weekend.

dkosovic commented 1 year ago

I can confirm your code works with Libreswan 4.9, but think the following which also works would be a simpler solution :

        if (strstr(output, "Libreswan") != NULL)
hedayat commented 1 year ago

Yeah, sure. If so, the condition for others can also be simplified too. However, I thought the code tries to be as specific as possible, so I tried to follow the same spirit. Anyway, I'm OK with whatever you prefer. Currently, I cannot think of any situation which can have false positives, so it should be OK.

dkosovic commented 1 year ago

Thanks for the bug report.

Fixed now with commit https://github.com/nm-l2tp/NetworkManager-l2tp/commit/3c6ccfe331e65c7af8be4df78cac67c030e96958

hedayat commented 1 year ago

Thanks