iwd.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Andrew Zaborowski <andrew.zaborowski@intel.com>
To: iwd@lists.01.org
Subject: Re: [PATCH 7/9] netconfig: Move loading settings to new method, refactor
Date: Thu, 26 Aug 2021 00:56:45 +0200	[thread overview]
Message-ID: <CAOq732Lfd_x6d9AY5B0+bLLnV_Un3AbMwdHF0n4_Y9OLfTFxdg@mail.gmail.com> (raw)
In-Reply-To: <5fc5be3c-b015-6fa1-bae4-34a06ab8436f@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1477 bytes --]

On Thu, 26 Aug 2021 at 00:43, Denis Kenzior <denkenz@gmail.com> wrote:
> > I thought we might have a future use case for calling
> > netconfig_load_settings() multiple times without netconfig_reset
> > between, but no strong motivation for that.
> >
>
> Can you elaborate on why we would want that?

When implementing a protocol similar to the FILS or P2P early IP
allocation, we might want to first load only the user l_settings to
find out whether the user even wants automatic netconfig.  Then
calling load_settings() would be one way, not necessarily the best
way, to pass the newly received network configuration to netconfig.c.

But even then calling netconfig_reset() in between is an option.

> But even more reason not to
> side-effect.

True.

>
> >>   We generally don't like
> >> side-effects in our APIs.
> >
> > I wouldn't call avoiding a leak a side effect ;)
> >
>
> My point is, you shouldn't be setting anything inside netconfig until you know
> the operation will succeed completely.  Doing otherwise makes error handling a
> nightmare.
>
> netconfig_configure would never fail since it would ignore invalid input.  In
> fact, I'm not sure why it had a bool return in the first place.
>
> In this patch you're changing the contract such that netconfig_load_settings
> checks up-front if the networking settings are correct or not.  Side-effecting
> is not desirable in this case.

Agreed, I'll fix this.

Best regards

  reply	other threads:[~2021-08-25 22:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-23 14:14 [PATCH 1/9] handshake: Add HANDSHAKE_EVENT_P2P_IP_REQUEST Andrew Zaborowski
2021-08-23 14:14 ` [PATCH 2/9] ap: Implement P2P GO-side 4-way handshake IP Allocation Andrew Zaborowski
2021-08-23 14:14 ` [PATCH 3/9] autotests: Test GO-side IP Allocation in testP2P Andrew Zaborowski
2021-08-23 14:14 ` [PATCH 4/9] ap: Expire client's leases on disconnect Andrew Zaborowski
2021-08-23 14:14 ` [PATCH 5/9] ie: Add FILS IP Address Assignment parsers and builders Andrew Zaborowski
2021-08-25 13:47   ` Denis Kenzior
2021-08-25 21:34     ` Andrew Zaborowski
2021-08-23 14:14 ` [PATCH 6/9] ap: Support FILS IP Address Assignment IE Andrew Zaborowski
2021-08-23 14:14 ` [PATCH 7/9] netconfig: Move loading settings to new method, refactor Andrew Zaborowski
2021-08-25 13:50   ` Denis Kenzior
2021-08-25 22:17     ` Andrew Zaborowski
2021-08-25 22:37       ` Denis Kenzior
2021-08-25 22:56         ` Andrew Zaborowski [this message]
2021-08-23 14:14 ` [PATCH 8/9] netconfig: FILS IP assigment API Andrew Zaborowski
2021-08-23 14:14 ` [PATCH 9/9] station, netdev: Enable FILS IP Address Assignment Andrew Zaborowski

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=CAOq732Lfd_x6d9AY5B0+bLLnV_Un3AbMwdHF0n4_Y9OLfTFxdg@mail.gmail.com \
    --to=andrew.zaborowski@intel.com \
    --cc=iwd@lists.01.org \
    /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).