All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Zaborowski <andrew.zaborowski@intel.com>
To: ell@lists.01.org
Subject: Re: [PATCH 1/8] dhcp-server: Add "authoritative" mode
Date: Wed, 28 Jul 2021 21:29:48 +0200	[thread overview]
Message-ID: <CAOq732LubVFda0Q30qR3_hRT694RmAuN9MRL8q4+d=ED5z6uow@mail.gmail.com> (raw)
In-Reply-To: <0672c4d6-c78e-9f32-5aa5-ee5e5d24007c@gmail.com>

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

On Wed, 28 Jul 2021 at 20:45, Denis Kenzior <denkenz@gmail.com> wrote:
> >>> @@ -640,6 +639,9 @@ static void listener_event(const void *data, size_t len, void *user_data)
> >>>                SERVER_DEBUG("Received DISCOVER, requested IP "NIPQUAD_FMT,
> >>>                                        NIPQUAD(requested_ip_opt));
> >>>
> >>> +             if (server_id_opt && server_id_opt != server->address)
> >>> +                     break;
> >>> +
> >>
> >> So strictly speaking, according to DHCPDISCOVER from the client shouldn't even
> >> have this option...
> >
> > Ok, I can make this check stricter here.  I preserved the original
> > logic where we would ignore the whole message if (erver_id_opt !=
> > server->address) but otherwise we weren't checking whether the
> > server_id was correct or absent.
> >
>
> Well, the thing is that you've introduced a small ambiguity.  Maybe it doesn't
> matter... but...
>
> The prior logic looked at the server_id option if present and compared to our
> own server id.  So the only way you get past the pre-check is if the server_id
> matched or was omitted entirely.
>
> But now, you can have server_id option from the client that is equal to '0', and
> we treat both the same.  So ideally this should be tightened up a bit.

True, if the client includes a 0 server_id we'd treat it as if the
option was omitted.  Let me replace uint32_t server_id_opt with a bool
server_id_opt and a bool server_id_match.

Best regards

      reply	other threads:[~2021-07-28 19:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 18:23 [PATCH 1/8] dhcp-server: Add "authoritative" mode Andrew Zaborowski
2021-07-23 18:23 ` [PATCH 2/8] dhcp-server: Handle DHCPDECLINE for active leases Andrew Zaborowski
2021-07-23 18:23 ` [PATCH 3/8] dhcp-server: Respect client's broadcast flag Andrew Zaborowski
2021-07-28 15:47   ` Denis Kenzior
2021-07-28 17:57     ` Andrew Zaborowski
2021-07-23 18:23 ` [PATCH 4/8] dhcp-lease: Check duplicate options in _dhcp_lease_parse_options Andrew Zaborowski
2021-07-28 15:50   ` Denis Kenzior
2021-07-23 18:23 ` [PATCH 5/8] dhcp-server: Look up leases by client identifier option Andrew Zaborowski
2021-07-23 18:23 ` [PATCH 6/8] dhcp-server: Copy client identifier from the client message Andrew Zaborowski
2021-07-23 18:23 ` [PATCH 7/8] dhcp-server: Support RFC4039 Rapid Commit Andrew Zaborowski
2021-07-23 18:23 ` [PATCH 8/8] dhcp: " Andrew Zaborowski
2021-07-28 15:42 ` [PATCH 1/8] dhcp-server: Add "authoritative" mode Denis Kenzior
2021-07-28 17:51   ` Andrew Zaborowski
2021-07-28 18:39     ` Denis Kenzior
2021-07-28 19:29       ` Andrew Zaborowski [this message]

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='CAOq732LubVFda0Q30qR3_hRT694RmAuN9MRL8q4+d=ED5z6uow@mail.gmail.com' \
    --to=andrew.zaborowski@intel.com \
    --cc=ell@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.