Message ID | 20240105135742.21174-1-steffan@karger.me |
---|---|
State | Accepted |
Headers | show |
Series | [Openvpn-devel] Fix IPv6 route add/delete message log level | expand |
Hi, On Fri, Jan 05, 2024 at 02:57:42PM +0100, Steffan Karger wrote: > We have D_ROUTE for route addition/deletion messages, which prints at > loglevel 3. Use that for IPv6, like we do for IPv4 to reduce terminal > spam for non-legacy-networking setups. Prvious code would print the > messages at --verb 1. Good catch, and a happy new year :-) Acked-By: Gert Doering <gert@greenie.muc.de> gert
Patch looks good, makes sense, thanks for that. Interesting enough, the old code had weird formatting ("msg( M_INFO") which led to weird indenting of the *next* lines - this patch changed the msg() call to have no leading blank, and uncrustify complained that now the successive lines had whitespace errors... fixed on the fly. Not tested beyond "looks reasonable, compiles, and add_route() indeed uses D_ROUTE for informational msg() calls". Your patch has been applied to the master and release/2.6 branch. commit b959b02b4f607628896b4092f7ddfa675e87d929 (master) commit 9abf74c92c1c13de089523babc1dfeda7bb7255f (release/2.6) Author: Steffan Karger Date: Fri Jan 5 14:57:42 2024 +0100 Fix IPv6 route add/delete message log level Signed-off-by: Steffan Karger <steffan@karger.me> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20240105135742.21174-1-steffan@karger.me> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27954.html Signed-off-by: Gert Doering <gert@greenie.muc.de> -- kind regards, Gert Doering
Hi, On Fri, Jan 05, 2024 at 11:14:58PM +0100, Gert Doering wrote: > Patch looks good, makes sense, thanks for that. > > Interesting enough, the old code had weird formatting ("msg( M_INFO") > which led to weird indenting of the *next* lines - this patch changed > the msg() call to have no leading blank, and uncrustify complained that > now the successive lines had whitespace errors... fixed on the fly. > > Not tested beyond "looks reasonable, compiles, and add_route() indeed > uses D_ROUTE for informational msg() calls". > > Your patch has been applied to the master and release/2.6 branch. > > commit b959b02b4f607628896b4092f7ddfa675e87d929 (master) > commit 9abf74c92c1c13de089523babc1dfeda7bb7255f (release/2.6) Unfortunately I fat-fingered cherrypicking and commit-id'ing - "master" has commit 7268e14dba61254b04a0b2db37c12c8ab58423ea (master) and the ID referenced above is "the patch without the whitespace fixes" - which only exists in my local repo, not pushed anywhere. Doubly unfortunate, I also cherry-picked b959b0, so release/2.6 ended up with a commit that was uncrustify-broken. I'm not going to fix this with a force-push, so we have a new commit in 2.6 now... commit 9fb62e2b32fd4e63ae323ccfbc79dfaba6ce4d91 (HEAD -> release/2.6) Author: Gert Doering <gert@greenie.muc.de> Date: Sat Jan 6 09:38:41 2024 +0100 fix uncrustify complaints about previous patch ... which contains the diff b959b0..7268e1: --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -1939,11 +1939,11 @@ add_route_ipv6(struct route_ipv6 *r6, const struct tuntap *tt, #ifndef _WIN32 msg(D_ROUTE, "add_route_ipv6(%s/%d -> %s metric %d) dev %s", - network, r6->netbits, gateway, r6->metric, device ); + network, r6->netbits, gateway, r6->metric, device ); #else msg(D_ROUTE, "add_route_ipv6(%s/%d -> %s metric %d) IF %lu", - network, r6->netbits, gateway, r6->metric, - r6->adapter_index ? r6->adapter_index : tt->adapter_index); + network, r6->netbits, gateway, r6->metric, + r6->adapter_index ? r6->adapter_index : tt->adapter_index); #endif apologies for that. gert
diff --git a/src/openvpn/route.c b/src/openvpn/route.c index 2f472a1f..e784782b 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -1940,10 +1940,10 @@ add_route_ipv6(struct route_ipv6 *r6, const struct tuntap *tt, #endif #ifndef _WIN32 - msg( M_INFO, "add_route_ipv6(%s/%d -> %s metric %d) dev %s", + msg(D_ROUTE, "add_route_ipv6(%s/%d -> %s metric %d) dev %s", network, r6->netbits, gateway, r6->metric, device ); #else - msg( M_INFO, "add_route_ipv6(%s/%d -> %s metric %d) IF %lu", + msg(D_ROUTE, "add_route_ipv6(%s/%d -> %s metric %d) IF %lu", network, r6->netbits, gateway, r6->metric, r6->adapter_index ? r6->adapter_index : tt->adapter_index); #endif @@ -2394,7 +2394,7 @@ delete_route_ipv6(const struct route_ipv6 *r6, const struct tuntap *tt, } #endif - msg( M_INFO, "delete_route_ipv6(%s/%d)", network, r6->netbits ); + msg(D_ROUTE, "delete_route_ipv6(%s/%d)", network, r6->netbits ); #if defined(TARGET_LINUX) int metric = -1;
We have D_ROUTE for route addition/deletion messages, which prints at loglevel 3. Use that for IPv6, like we do for IPv4 to reduce terminal spam for non-legacy-networking setups. Prvious code would print the messages at --verb 1. Signed-off-by: Steffan Karger <steffan@karger.me> --- src/openvpn/route.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)