Linux Test Project
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 3/4] RFC: Add rtnetlink helper library
Date: Tue, 27 Apr 2021 16:35:37 +0200	[thread overview]
Message-ID: <YIghOWTqlx3W0ol/@yuki> (raw)
In-Reply-To: <ceb5f5b5-2efd-beaf-e617-7fa0b28c0ff2@suse.cz>

Hi!
> > You are calling safe_realloc() here yet you check the return value. And
> > it's the same for safe_malloc(), safe_bind(), safe_socket() and a few
> > more in the code.
> > 
> > So either we get rid of the error checks and of the error
> > propagation or we avoid using safe_ variants.
> 
> Both rtnetlink and netdevice management functions will be called in
> cleanup() so I have to assume that the safe functions will only print a
> warning instead of terminating the program. But I still want to use the
> error reporting code in the safe functions.

Right, I've realized that too, we have to return to the caller in that
case to carry on with the cleanup.

> > Other than that the code looks sane but it's hard to review the API
> > without an example that would excersize it. What about adding something
> > simple in newlib_tests?
> 
> There are short examples for both rtnetlink and netdevice management in
> the cover letter. The netdevice library itself is also a detailed
> example for the rtnetlink API. The final patchset will include the
> SADDNS CVE test which will use most of the netdevice management
> functions in setup().

Ah I've missed that. We should add it somewhere to the doc/ directory
since the cover letter would end up burried in the mailing list history.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2021-04-27 14:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 11:19 [LTP] [PATCH 0/4] RTNetlink and network device management library Martin Doucha
2021-04-26 11:19 ` [LTP] [PATCH 1/4] Add SAFE_REALLOC() helper function to LTP library Martin Doucha
2021-04-27 13:04   ` Cyril Hrubis
2021-04-26 11:19 ` [LTP] [PATCH 2/4] Add SAFE_RECV() " Martin Doucha
2021-04-27 13:06   ` Cyril Hrubis
2021-04-26 11:19 ` [LTP] [PATCH 3/4] RFC: Add rtnetlink helper library Martin Doucha
2021-04-27 13:41   ` Cyril Hrubis
2021-04-27 14:14     ` Martin Doucha
2021-04-27 14:35       ` Cyril Hrubis [this message]
2021-04-27 15:44   ` Cyril Hrubis
2021-04-26 11:19 ` [LTP] [PATCH 4/4] RFC: Add helper functions for managing network interfaces Martin Doucha
2021-04-28 10:27   ` Cyril Hrubis
2021-04-28 13:42     ` Martin Doucha
2021-04-28 14:34       ` Cyril Hrubis

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=YIghOWTqlx3W0ol/@yuki \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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