Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
gajim
gajim
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 196
    • Issues 196
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 20
    • Merge Requests 20
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • gajim
  • gajimgajim
  • Issues
  • #10382

Closed
Open
Opened Jan 07, 2021 by Martin@Martin

Gajim react strangely on VPN state changes

Versions

  • OS: Debian 11 (testing, bullseye)
  • Gajim version: 1.3.0~beta1-1
  • GTK version: 3.24.24-1
  • Python-nbxmpp version: 2.0.0-1

Steps to reproduce the problem

  1. Start Gajim and connect to your account
  2. Start a VPN, all traffic is routed via the VPN

Expected behavior

Account still works, somehow.

Actual behavior

Account is in a strange state, even disconnecting works only forcefully.

Assumption

Gajim should react on starting and stopping a VPN.

Example code

#!/usr/bin/python3

import dbus
import dbus.mainloop.glib
import gi.repository.GLib


NM_ACTIVE_CONNECTION_STATE_ACTIVATING = 1
NM_ACTIVE_CONNECTION_STATE_ACTIVATED = 2
NM_ACTIVE_CONNECTION_STATE_DEACTIVATING = 3
NM_ACTIVE_CONNECTION_STATE_DEACTIVATED = 4


def vpn_connection_propertychanged_handler(properties):
    state = properties.get("State")
    if not state:
        return
    if state in [
        NM_ACTIVE_CONNECTION_STATE_ACTIVATING,
        NM_ACTIVE_CONNECTION_STATE_DEACTIVATING,
    ]:
        print("disconnect")
    elif state in [
        NM_ACTIVE_CONNECTION_STATE_ACTIVATED,
        NM_ACTIVE_CONNECTION_STATE_DEACTIVATED,
    ]:
        print("reconnect")


if __name__ == "__main__":
    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
    bus = dbus.SystemBus()
    bus.add_signal_receiver(
        vpn_connection_propertychanged_handler,
        dbus_interface="org.freedesktop.NetworkManager.VPN.Connection",
        signal_name="PropertiesChanged",
    )
    loop = gi.repository.GLib.MainLoop()
    loop.run()
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: gajim/gajim#10382