]> git.ipfire.org Git - thirdparty/strongswan.git/commit
vici: Use unique names for CHILD_SAs in the child-updown event too
authorFelix Kaiser <felix.kaiser@fxkr.net>
Fri, 4 Oct 2019 06:18:30 +0000 (23:18 -0700)
committerTobias Brunner <tobias@strongswan.org>
Fri, 4 Oct 2019 08:11:18 +0000 (10:11 +0200)
commit7c74ce91904b0c6d76683b76c430e4c8678f2e2a
tree1152c693c974c1c0e82f0f7b67c76b5997087cfe
parentd3bd576c469a06bc1cef1be1149bf1de03ae3179
vici: Use unique names for CHILD_SAs in the child-updown event too

The unique names were introduced for the list-sas command in commit
04c0219e55d9338b6492548c073189bfd3d5431b.  However, the child-updown
event wasn't updated to match.  Even though the documentation suggests
that the section name of the CHILD_SAs are the same in both messages.

The original name is already being returned in the "name" attribute,
so it'll still be available.

Example:

    >>> import vici, json
    >>> s = vici.Session()

    # First, for comparison, the list-sas command:
    >>> print(json.dumps(list(s.list_sas()), sort_keys=True, indent=4, separators=(',', ': ')))
    [
        {
            "vti0": {
                "child-sas": {
                    "vti0-1": {
                        ...

    # A child-updown event before the change:
    >>> for x in s.listen(["child-updown"]): print(json.dumps(x, sort_keys=True, indent=4, separators=(',', ': ')))
    [
        "child-updown",
        {
            "vti0": {
                "child-sas": {
                    "vti0": {   # <-- wrong: inconsistent with list-sas
                        ...

    # A child-updown event after the change:
    >>> s = vici.Session()
    >>> for x in s.listen(["child-updown"]): print(json.dumps(x, sort_keys=True, indent=4, separators=(',', ': ')))
    [
        "child-updown",
        {
            "vti0": {
                "child-sas": {
                    "vti0-1": {  # <-- fixed

Closes strongswan/strongswan#153.
src/libcharon/plugins/vici/vici_query.c