connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Daniel Wagner <wagi@monom.org>
To: Matthias Gerstner <matthias.gerstner@suse.de>
Cc: connman@lists.linux.dev
Subject: Re: dnsproxy: first round of refactoring, TCP bugfix
Date: Wed, 25 May 2022 09:01:46 +0200	[thread overview]
Message-ID: <20220525070110.xx3pfx6fo3mdfhsy@beryllium.lan> (raw)
In-Reply-To: <20220419103501.30553-1-matthias.gerstner@suse.de>

Hi Matthias,

On Tue, Apr 19, 2022 at 12:34:49PM +0200, Matthias Gerstner wrote:
> This is a first iteration of refactoring the dnsproxy codebase. It is no major
> change of the code structure yet, more a local refactoring of each function
> trying to make the existing code more readable and less redundant.
> 
> Part of this is also improved testing capability, minor fixes of bugs
> encountered during refactoring and a bugfix of the TCP protocol operation if
> domain name appending is in effect.

Nice work. A few nits from my side. The cleanup generally looks good.

Though we need set the C standard to C99 I suppose:


src/dnsproxy.c: In function ‘refresh_dns_entry’:
src/dnsproxy.c:394:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
  394 |         int age = 1;
      |         ^~~

and my compiler complained about a few things:

src/dnsproxy.c:410:25: error: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
  410 |         if (entry->hits > age)
      |                         ^
src/dnsproxy.c: In function ‘update_cached_ttl’:
src/dnsproxy.c:432:17: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
  432 |         if (len < sizeof(struct domain_question) + 1)
      |                 ^
[...]

BTW, since this contribution is major I would suggest you add your
copyright statement to the file as well.

Thanks,
Daniel

  parent reply	other threads:[~2022-05-25  7:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 10:34 dnsproxy: first round of refactoring, TCP bugfix Matthias Gerstner
2022-04-19 10:34 ` [PATCH 01/12] dnsproxy-simple-test: improve test coverage and test flexibility Matthias Gerstner
2022-04-19 10:34 ` [PATCH 02/12] dnsproxy: first bits of refactoring data types, global variables, simpler functions Matthias Gerstner
2022-05-25  6:47   ` Daniel Wagner
2022-05-25  6:48   ` Daniel Wagner
2022-04-19 10:34 ` [PATCH 03/12] dnsproxy: refactoring of update_cached_ttl() and append_data() Matthias Gerstner
2022-05-25  6:45   ` Daniel Wagner
2022-06-10 12:26     ` Matthias Gerstner
2022-04-19 10:34 ` [PATCH 04/12] dnsproxy: refactor parse_response() Matthias Gerstner
2022-04-19 10:34 ` [PATCH 05/12] dnsproxy: further refactoring of cache_update() Matthias Gerstner
2022-05-25  6:51   ` Daniel Wagner
2022-04-19 10:34 ` [PATCH 06/12] dnsproxy: strip_domains(): fix out of bounds read access Matthias Gerstner
2022-04-19 10:34 ` [PATCH 07/12] dnsproxy: refactor and document strip_domains() to make it less confusing Matthias Gerstner
2022-04-19 10:34 ` [PATCH 08/12] dnsproxy: refactor larger functions ns_resolv() and forwards_dns_reply() Matthias Gerstner
2022-04-19 10:34 ` [PATCH 09/12] dnsproxy: uncompress: replace unnecessary goto with return statements Matthias Gerstner
2022-04-19 10:34 ` [PATCH 10/12] dnsproxy: forward_dns_reply: pull out separate dns_reply_fixup_domains() Matthias Gerstner
2022-04-19 10:35 ` [PATCH 11/12] dnsproxy: finish first pass of refactoring the compilation unit Matthias Gerstner
2022-04-19 10:35 ` [PATCH 12/12] dnsproxy: fix TCP server reply handling if domain name is appended Matthias Gerstner
2022-05-25  7:01 ` Daniel Wagner [this message]
2022-06-10 12:28   ` dnsproxy: first round of refactoring, TCP bugfix Matthias Gerstner
2022-06-10 12:33 Matthias Gerstner
2022-10-18  8:47 Matthias Gerstner
2022-10-18  8:55 ` Matthias Gerstner
2022-10-24  7:40   ` Daniel Wagner
2022-10-27 10:32 Matthias Gerstner
2022-11-03  7:20 ` Daniel Wagner

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=20220525070110.xx3pfx6fo3mdfhsy@beryllium.lan \
    --to=wagi@monom.org \
    --cc=connman@lists.linux.dev \
    --cc=matthias.gerstner@suse.de \
    /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 NNTP newsgroup(s).