Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: OpenVPN/openvpn
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: OpenVPN/openvpn
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ovpn-fix-async
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 3 commits
  • 6 files changed
  • 1 contributor

Commits on Jul 23, 2025

  1. dco: only pass struct context to init function

    Future DCO code will require accessing the `multi` member of the
    context object.
    
    For this reason a pointer to the context has to be stored in the
    DCO context along with the rest.
    
    At this point, rather than making the call to ovpn_dco_init()
    longer with more and more parameters, pass the struct context
    only and let the implementation extract the needed fields.
    
    Change-Id: I673a17f8c5dec66cc6c28c1ed44780a7a63927d7
    Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
    ordex committed Jul 23, 2025
    Configuration menu
    Copy the full SHA
    482409c View commit details
    Browse the repository at this point in the history
  2. dco_linux: factor out netlink notification code

    ovpn_handle_msg() is soon becoming the main entry point for parsing
    *all* incoming netlink messages. For this reason it is essential
    that this function is kept simple and slim.
    
    Move all code parsing netlink multicast notifications to their own
    helpers and then invoke them.
    
    This patch does not introduce any functional change.
    It is intended in preparation for extending ovpn_handle_msg() to
    become a genering netlink message parser.
    
    Change-Id: I7bbc40b7b66f6e0512cd2cf9791766bcc4970461
    Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
    ordex committed Jul 23, 2025
    Configuration menu
    Copy the full SHA
    684fdd6 View commit details
    Browse the repository at this point in the history
  3. dco_linux: fix async message reception

    Currently whenever we send a PEER_GET request to ovpn, we also
    set the CB that is supposed to parse the reply.
    
    However, due to the async nature of netlink messages, we could
    get an unrelated notification, sent by ovpn upon some event,
    after having set the CB, but before parsing the awaited reply.
    
    When this happens, the notification is then parsed with the
    configured CB instead of the notification parser, thus effectively
    rejecting the notification and losing the event.
    
    To fix this inconsistency, make ovpn_handle_msg() the default and
    only netlink parser CB. It is configured upon DCO initialization
    and is never removed.
    
    ovpn_handle_msg() will check the message type and will call the
    according parser. This way, no matter what message we get at
    what time, but we'll always parse it correctly.
    
    As a bonus we can also simplify the nl_sendmsg() API as we
    don't need to pass the cb and its argument anymore.
    
    The ID of the NLCTRL family is now also stored in the DCO
    context as we need it to check when we receive a mcast ID
    lookup message.
    
    Change-Id: I23ad79e14844aefde9ece34dadef0b75ff267201
    Github: #793
    Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
    ordex committed Jul 23, 2025
    Configuration menu
    Copy the full SHA
    5a3b755 View commit details
    Browse the repository at this point in the history
Loading