Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pluto: xfrmi_if_id use yn_no instead of 0
using enum constant is better. Can also help we decide yn_no is UINT32_MAX
- Loading branch information
092475c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might be mixing up two things.
For the configuration part, I map UINT_MAX to "disabled" and everything else to their respective integer. This allows someone to configure ipsec-interface=0 to gain an ipsec0 device. This device will not get if_id 0
For the if_id passing, the connection will map ipsec-interface value 0 to the if_id value 16384. And the xfrmi code that maps if_id to interface name maps ipsec0 to if_id 16384 and maps all other if_id's to their respective ipsecXXX name.
So, the yn_no and yn_yes (which I had renamed to yn_dev_yes and yn_dev_no since they cannot be re-used for generic yes/no keywords, only applies to ipsec-interface= values and does not map to if_id / xfrmi_if_id values. Those values are integers only and not an enum of some kind. Specifically, the if_id of UINT_MAX is not treated special.