[Dnsmasq-discuss] [PATCH] Quieten DHCPv6 log when in static mode.
Geert Stappers
stappers at stappers.nl
Sat Mar 16 10:02:09 UTC 2024
On Tue, Mar 05, 2024 at 07:29:55PM +1030, Ian Dall wrote:
> On Mon, 2024-03-04 at 07:13 +0100, Geert Stappers wrote:
> > On Mon, Mar 04, 2024 at 03:53:23PM +1030, Ian Dall wrote:
> > > When a DHCP range has a mode of "static" then the pool of dynamically
> > > allocated address is configured to be of zero size. DHCPv6 will still
> > > respond with statically defined addresses. In these cirumstances, not
> > > allocating an address is expected behaviour and not an error, so allow
> > > "no addresses available" messages to be quietened.
> > >
> > > Signed-off-by: Ian Dall <ian at beware.dropbear.id.au>
> > > ---
> > > src/rfc3315.c | 6 +++++-
> > > 1 file changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/src/rfc3315.c b/src/rfc3315.c
> > > index 400d939..a40d364 100644
> > > --- a/src/rfc3315.c
> > > +++ b/src/rfc3315.c
> > > @@ -815,7 +815,11 @@ static int dhcp6_no_relay(struct state *state, int msg_type, unsigned char *inbu
> > > for (c = state->context; c; c = c->current)
> > > if (!(c->flags & CONTEXT_RA_STATELESS))
> > > {
> > > - log6_packet(state, state->lease_allocate ? "DHCPREPLY" : "DHCPADVERTISE", NULL, _("no addresses available"));
> > > + /* if "static" log6_quiet else lo6_packet */
> > + /* if "static" log6_quiet else log6_packet */
> >
> > Removing the "duplicate" would be better
> >
> >
> > > + if (c->flags & CONTEXT_STATIC)
> > > + log6_quiet(state, state->lease_allocate ? "DHCPREPLY" : "DHCPADVERTISE", NULL, _("no addresses available"));
> > > + else
> > > + log6_packet(state, state->lease_allocate ? "DHCPREPLY" : "DHCPADVERTISE", NULL, _("no addresses available"));
> > > break;
> > > }
> > > }
> >
> ACK the typo in the comment, but what do you mean by duplicate? I'm not
> sure the comment is really necessary anyway.
New version of the patch is planned.
As an attempt to express that proposed patches get human attention.
Groeten
Geert Stappers
--
Silence is hard to parse
More information about the Dnsmasq-discuss
mailing list