Skip to content

inet: Add Missing Gateway Parameter to Host Route Deletion Interfaces

Grant Erickson connman 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9service: Refactor 'nameserver_del_routes'.src/service.c+26 -150 replies
2/9service: Add gateway parameter to DNS host route deletion paths.src/connman.h src/gateway.c src/service.c+30 -120 replies
3/9inet: Add gateway parameter to 'connman_inet_del_{,ipv6_}host_route'.include/inet.h src/gateway.c src/inet.c +1 more+77 -220 replies
4/9inet: Document 'connman_inet_{add,del}_{,ipv6_}host_route'.src/inet.c+144 -00 replies
5/9service: Const-qualify 'add_nameserver_route'.src/service.c+1 -10 replies
6/9service: Add 'DBG' to 'add_nameserver_route'.src/service.c+3 -00 replies
7/9inet: Document '{add,del}_nameserver_route'.src/service.c+53 -00 replies
8/9inet: Document 'nameserver_{add,del}_routes'.src/service.c+50 -00 replies
9/9inet: Document '__connman_service_nameserver_{add,del}_routes'.src/service.c+44 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] inet: Add Missing Gateway Parameter to Host Route Deletion Interfaces

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(-)
Signature · 1 line
2.42.0