ConnMan network manager
 help / color / mirror / Atom feed
From: Grant Erickson <gerickson@nuovations.com>
To: connman@lists.linux.dev
Subject: [PATCH 0/9] inet: Add Missing Gateway Parameter to Host Route Deletion Interfaces
Date: Sat, 16 Dec 2023 00:27:55 -0800	[thread overview]
Message-ID: <20231216082805.2221938-1-gerickson@nuovations.com> (raw)

Routing table manipulation, host routes among them, should be
fundamentally symmetric. The routing table entry parameters used to
add a route should be identical to those used to delete the same
route. Otherwise, an 'ESRCH' error may occur which, at present, are
suppressed due to commit e03a01d3182d ("inet: Fix error handling when
adding/removing routes") that is masking route deletion errors where
this gateway parameter asymmetry is occurring.

This adds a previously-missing gateway address parameter to the
'connman_inet_del_{,ipv6_}host_route' functions. In addition, call
sites to 'connman_inet_del_{,ipv6_}host_route' are updated to pass the
gateway parameter.

In addition, in the process, this refactors 'nameserver_del_routes'
into a second, helper function 'del_nameserver_route' such that host
route deletion is separated from DNS server iteration. This structure
now mirrors that of 'nameserver_add_routes' and 'add_nameserver_route'
since, again, route addition and deletion should be symmetric.

NOTE: This is only the first half of the necessary change. The second
half is revising the actual implementation of
'connman_inet_del_{,ipv6_}host_route' to take advantage of the
newly-added gateway parameter. Implementation notes in each of
'connman_inet_del_{,ipv6_}host_route' have been added toward that end.

Grant Erickson (9):
  service: Refactor 'nameserver_del_routes'.
  service: Add gateway parameter to DNS host route deletion paths.
  inet: Add gateway parameter to 'connman_inet_del_{,ipv6_}host_route'.
  inet: Document 'connman_inet_{add,del}_{,ipv6_}host_route'.
  service: Const-qualify 'add_nameserver_route'.
  service: Add 'DBG' to 'add_nameserver_route'.
  inet: Document '{add,del}_nameserver_route'.
  inet: Document 'nameserver_{add,del}_routes'.
  inet: Document '__connman_service_nameserver_{add,del}_routes'.

 include/inet.h |  17 ++--
 src/connman.h  |   1 +
 src/gateway.c  |  33 +++++---
 src/inet.c     | 184 ++++++++++++++++++++++++++++++++++++++--
 src/service.c  | 225 ++++++++++++++++++++++++++++++++++++++++++++-----
 5 files changed, 419 insertions(+), 41 deletions(-)

-- 
2.42.0


             reply	other threads:[~2023-12-16  8:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-16  8:27 Grant Erickson [this message]
2023-12-16  8:27 ` [PATCH 1/9] service: Refactor 'nameserver_del_routes' Grant Erickson
2023-12-16  8:27 ` [PATCH 2/9] service: Add gateway parameter to DNS host route deletion paths Grant Erickson
2023-12-16  8:27 ` [PATCH 3/9] inet: Add gateway parameter to 'connman_inet_del_{,ipv6_}host_route' Grant Erickson
2023-12-16  8:27 ` [PATCH 4/9] inet: Document 'connman_inet_{add,del}_{,ipv6_}host_route' Grant Erickson
2023-12-16  8:28 ` [PATCH 5/9] service: Const-qualify 'add_nameserver_route' Grant Erickson
2023-12-16  8:28 ` [PATCH 6/9] service: Add 'DBG' to 'add_nameserver_route' Grant Erickson
2023-12-16  8:28 ` [PATCH 7/9] inet: Document '{add,del}_nameserver_route' Grant Erickson
2023-12-16  8:28 ` [PATCH 8/9] inet: Document 'nameserver_{add,del}_routes' Grant Erickson
2023-12-16  8:28 ` [PATCH 9/9] inet: Document '__connman_service_nameserver_{add,del}_routes' Grant Erickson
2023-12-16 18:47 ` [PATCH 0/9] inet: Add Missing Gateway Parameter to Host Route Deletion Interfaces Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231216082805.2221938-1-gerickson@nuovations.com \
    --to=gerickson@nuovations.com \
    --cc=connman@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).