chiark / gitweb /
site.c (we_have_priority): Fix unintended `&&'.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 19 Sep 2019 20:01:23 +0000 (20:01 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 21 Sep 2019 10:02:16 +0000 (11:02 +0100)
commit4c795bdb6d8f0a75a7a484775151e810aac3de4c
treecc2303742e2f7c3174d0ca39071c0e74b2305660
parent30ba82a584441fc730ad733081805d15fd07bd09
site.c (we_have_priority): Fix unintended `&&'.

`CAPAB_PRIORITY_MOBILE' is 0x80000000, which is nonzero, so that doesn't
change the outcome.  So the code is only checking whether the local and
remote capabilities overlap at all, which seems unhelpful.

Instead, check that both advertise `CAPAB_PRIORITY_MOBILE' here.

Spotted by Clang.

The effect is that a new secnet would always think the peer had
advertised CAPAB_PRIORITY_MOBILE.  This might (with roughly 50%
probability) mess up resolution of crossed key setup attempts
involving a mobile end and mixed secnet versions.

The consequences would be mitigated by 19074a85692b
  site: Randomise key setup retry time
so the key setup would very likely eventually succeed.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
site.c