All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: iwd@lists.01.org
Subject: Re: [PATCH 7/9] netconfig: Move loading settings to new method, refactor
Date: Wed, 25 Aug 2021 17:37:09 -0500	[thread overview]
Message-ID: <5fc5be3c-b015-6fa1-bae4-34a06ab8436f@gmail.com> (raw)
In-Reply-To: <CAOq732+DLLQqFcEzpJ+hZR1ucCXE8=iMdCU4xCproJhO96eKqw@mail.gmail.com>

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

Hi Andrew,

>>> +     l_strfreev(netconfig->dns4_overrides);
>>
>> ? shouldn't this be taken care of by netconfig_reset?
> 
> 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?  But even more reason not to 
side-effect.

>>   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.

Regards,
-Denis

  reply	other threads:[~2021-08-25 22:37 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 [this message]
2021-08-25 22:56         ` Andrew Zaborowski
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=5fc5be3c-b015-6fa1-bae4-34a06ab8436f@gmail.com \
    --to=denkenz@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.