On Wed, 5 Jul 2017, Ilan Tayari wrote:

I figured out why pluto doesn't complain about NEWSA failure...

This line
https://github.com/libreswan/libreswan/blob/master/programs/pluto/kernel_netlink.c#L474

quiets it because the expected response is NLMSG_NOOP.

Do you know why this condition is so? If I remove the NOOP condition then
it complains properly about failure to add:

"myconn" #2: ERROR: netlink response for Add SA [email protected] 
included errno 22: Invalid argument

I checked and it seems Hugh made that change in commit id cff15f8d:


+       netlink_errno = -rsp.u.e.error;
+       if (rsp.n.nlmsg_type != expected_resp_type && rsp.n.nlmsg_type == 
NLMSG_ERROR) {
+               if (rsp.u.e.error != 0 && expected_resp_type != NLMSG_NOOP) {

Hugh: did you mean:

        if (rsp.u.e.error != 0 || expected_resp_type != NLMSG_NOOP) {

Although it seems just leaving out the 2nd condition makes more sense to
me?

Paul
_______________________________________________
Swan-dev mailing list
[email protected]
https://lists.libreswan.org/mailman/listinfo/swan-dev

Reply via email to