Changes between Version 1 and Version 2 of Ticket #1155, comment 2


Ignore:
Timestamp:
01/20/19 00:34:06 (5 years ago)
Author:
Selva Nair
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1155, comment 2

    v1 v2  
    1 The purpose of this version arg is to indicate the version of the argument structs passed around in the {{{openvpn_plugin_open_v3}}} and {{{openvpn_plugin_func_v3}}} calls, so I think the code in {{{plugin.c}}} is correct. But the documentation in the header file is not. So the caller should check this version argument against {{{OPENVPN_PLUGINv3_STRUCTVER}}}.
    2 
    3 It would be better to rename this argument in both {{{.._open_v3()}}} and {{{..func_v3()}}} signatures from {{{version}}} to {{{structver}}} and document it as the version of the argument struct of plugin v3 structures, not that of the plugin API. In case of {{{openvpn_plugin_open_v3}}}, the doc string already states it should be matched against {{{OPENVPN_PLUGINv3_STRUCTVER}}}. The same wording should apply to {{{openvpn_plugin_func_v3}}} as well.
    4 
    5 That said, instead of requiring an exact match, checking that its >= certain value should be enough and that would ease the burden of keeping plugins up to date. That's how we use it in the auth-pam plugin (though only openv_v3 used there, not func_v3). If we can guarantee that structs will only be extended (offset of old members preserved), we could document it like that.
    6 
    7 David is the authority on this, so the rest I defer to him.