Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 May 2024 12:06:37 -0400
From:      Warner Losh <imp@bsdimp.com>
To:        Cy Schubert <Cy.Schubert@cschubert.com>
Cc:        Warner Losh <imp@freebsd.org>, src-committers@freebsd.org,  dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: 676041c41ba5 - main - WPA: Allow CLOCK_BOOTTIME and CLOCK_MONOTONIC to #define the same
Message-ID:  <CANCZdfozpD%2BPvRAV2kWYksgsQTte16ytTp--qVD%2BvxEUrTWc4g@mail.gmail.com>
In-Reply-To: <20240531160012.2D5AE111@slippy.cwsent.com>
References:  <202405311447.44VEl06w078151@gitrepo.freebsd.org> <20240531152819.33B6597@slippy.cwsent.com> <CANCZdfpyhd=BAcF_YFCCTumYNpGUMs0bQandZnoTYjFWcM7hqg@mail.gmail.com> <20240531160012.2D5AE111@slippy.cwsent.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000c388f30619c22bf5
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, May 31, 2024 at 12:00=E2=80=AFPM Cy Schubert <Cy.Schubert@cschubert=
.com>
wrote:

> In message
> <CANCZdfpyhd=3DBAcF_YFCCTumYNpGUMs0bQandZnoTYjFWcM7hqg@mail.gmail.c
> om>
> , Warner Losh writes:
> > --00000000000056c22d0619c1eb4c
> > Content-Type: text/plain; charset=3D"UTF-8"
> > Content-Transfer-Encoding: quoted-printable
> >
> > On Fri, May 31, 2024 at 11:28=3DE2=3D80=3DAFAM Cy Schubert
> <Cy.Schubert@cschubert=3D
> > .com>
> > wrote:
> >
> > > In message <202405311447.44VEl06w078151@gitrepo.freebsd.org>, Warner
> Losh
> > > write
> > > s:
> > > > The branch main has been updated by imp:
> > > >
> > > > URL:
> > >
> https://cgit.FreeBSD.org/src/commit/?id=3D3D676041c41ba587285bb934aa2fca2=
90=3D
> > e
> > > > a7208038
> > > >
> > > > commit 676041c41ba587285bb934aa2fca290ea7208038
> > > > Author:     Warner Losh <imp@FreeBSD.org>
> > > > AuthorDate: 2024-05-31 14:44:55 +0000
> > > > Commit:     Warner Losh <imp@FreeBSD.org>
> > > > CommitDate: 2024-05-31 14:44:55 +0000
> > > >
> > > >     WPA: Allow CLOCK_BOOTTIME and CLOCK_MONOTONIC to #define the sa=
me
> > > >
> > > >     Historically, these have been differnet values, and only one wa=
s
> > > defined
> > > >     or they were defined as different values. Now that they are
> about t=3D
> > o
> > > be
> > > >     the same value, add #ifdef to cope.
> > > >
> > > >     Sponsored by:           Netflix
> > > >     Reviewed by:            olce, val_packett.cool, adrian
> > > >     Differential Revision:  https://reviews.freebsd.org/D45418
> > > > ---
> > > >  contrib/wpa/src/utils/os_unix.c | 11 ++++++++---
> > > >  1 file changed, 8 insertions(+), 3 deletions(-)
> > > >
> > > > diff --git a/contrib/wpa/src/utils/os_unix.c
> > > b/contrib/wpa/src/utils/os_unix.
> > > > c
> > > > index 315c973f3228..a856179fb3b1 100644
> > > > --- a/contrib/wpa/src/utils/os_unix.c
> > > > +++ b/contrib/wpa/src/utils/os_unix.c
> > > > @@ -72,7 +72,6 @@ int os_get_time(struct os_time *t)
> > > >       return res;
> > > >  }
> > > >
> > > > -
> > > >  int os_get_reltime(struct os_reltime *t)
> > > >  {
> > > >  #ifndef __MACH__
> > > > @@ -97,15 +96,21 @@ int os_get_reltime(struct os_reltime *t)
> > > >                       return 0;
> > > >               }
> > > >               switch (clock_id) {
> > > > -#ifdef CLOCK_BOOTTIME
> > > > +#if defined(CLOCK_BOOTTIME)
> > >
> > > Why this change? This could become a potential merge conflict next ti=
me
> > > WPA
> > > is MFVed.
> > >
> >
> > Oh, that was a mistake.
> >
> >
> > > >               case CLOCK_BOOTTIME:
> > > >                       clock_id =3D3D CLOCK_MONOTONIC;
> > > >                       break;
> > > >  #endif
> > > > -#ifdef CLOCK_MONOTONIC
> > > > +#if defined(CLOCK_MONOTONIC)
> > >
> > > Ditto.
> > >
> >
> > Ditto. I iterated on these changes and thought I'd restored them to the
> > original. I'll do a followup diff minimization diff.
> >
> > >
> > > > +/*
> > > > + * FreeBSD has both BOOTTIME and MONOTONIC defined to the same
> value,
> > > since
> > > > they
> > > > + * mean the same thing. FreeBSD 14.1 and ealier don't, so need thi=
s
> > > case.
> > > > + */
> > > > +#if !(defined(CLOCK_BOOTTIME) && CLOCK_BOOTTIME =3D3D=3D3D
> CLOCK_MONOTONIC=3D
> > )
> > >
> > > This I probably want to apply to the ports.
> > >
> >
> > Yes. I had you on the review, but I did move kinda quickly on this, and
> so
>
> That was my fault. My MH review folder is large and with all the things
> going on here I failed to cherry-pick this one out of that folder. This i=
s
> totally on me, I'm sorry.
>

Gotcha. No worries.


> > those ports
> > are likely broken by the change in FreeBSD. My apologies.
>
> No apologies necessary. As long as I know what can be kept and what can b=
e
> overwritten next time WPA is MFVed.
>

I've pushed a fix to avoid the gratuitous differences. It should be clear
now that you
know about it and the diffs are minimized.

Warner


> --
> Cheers,
> Cy Schubert <Cy.Schubert@cschubert.com>
> FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  https://FreeBSD.org
> NTP:           <cy@nwtime.org>    Web:  https://nwtime.org
>
>                         e^(i*pi)+1=3D0
>
>
>

--000000000000c388f30619c22bf5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, May 31, 2024 at 12:00=E2=80=
=AFPM Cy Schubert &lt;<a href=3D"mailto:Cy.Schubert@cschubert.com">Cy.Schub=
ert@cschubert.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);p=
adding-left:1ex">In message &lt;CANCZdfpyhd=3DBAcF_YFCCTumYNpGUMs0bQandZnoT=
YjFWcM7hqg@mail.gmail.c<br>
om&gt;<br>
, Warner Losh writes:<br>
&gt; --00000000000056c22d0619c1eb4c<br>
&gt; Content-Type: text/plain; charset=3D&quot;UTF-8&quot;<br>
&gt; Content-Transfer-Encoding: quoted-printable<br>
&gt;<br>
&gt; On Fri, May 31, 2024 at 11:28=3DE2=3D80=3DAFAM Cy Schubert &lt;Cy.Schu=
bert@cschubert=3D<br>
&gt; .com&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt; &gt; In message &lt;<a href=3D"mailto:202405311447.44VEl06w078151@gitr=
epo.freebsd.org" target=3D"_blank">202405311447.44VEl06w078151@gitrepo.free=
bsd.org</a>&gt;, Warner Losh<br>
&gt; &gt; write<br>
&gt; &gt; s:<br>
&gt; &gt; &gt; The branch main has been updated by imp:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; URL:<br>
&gt; &gt; <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D3D676041c41b=
a587285bb934aa2fca290=3D" rel=3D"noreferrer" target=3D"_blank">https://cgit=
.FreeBSD.org/src/commit/?id=3D3D676041c41ba587285bb934aa2fca290=3D</a><br>
&gt; e<br>
&gt; &gt; &gt; a7208038<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; commit 676041c41ba587285bb934aa2fca290ea7208038<br>
&gt; &gt; &gt; Author:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&g=
t;<br>
&gt; &gt; &gt; AuthorDate: 2024-05-31 14:44:55 +0000<br>
&gt; &gt; &gt; Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&g=
t;<br>
&gt; &gt; &gt; CommitDate: 2024-05-31 14:44:55 +0000<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0WPA: Allow CLOCK_BOOTTIME and CLOCK_MONOT=
ONIC to #define the same<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0Historically, these have been differnet v=
alues, and only one was<br>
&gt; &gt; defined<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0or they were defined as different values.=
 Now that they are about t=3D<br>
&gt; o<br>
&gt; &gt; be<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0the same value, add #ifdef to cope.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0Netflix<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 olce, val_packett.cool, adrian<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0Differential Revision:=C2=A0 <a href=3D"h=
ttps://reviews.freebsd.org/D45418" rel=3D"noreferrer" target=3D"_blank">htt=
ps://reviews.freebsd.org/D45418</a><br>
&gt; &gt; &gt; ---<br>
&gt; &gt; &gt;=C2=A0 contrib/wpa/src/utils/os_unix.c | 11 ++++++++---<br>
&gt; &gt; &gt;=C2=A0 1 file changed, 8 insertions(+), 3 deletions(-)<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; diff --git a/contrib/wpa/src/utils/os_unix.c<br>
&gt; &gt; b/contrib/wpa/src/utils/os_unix.<br>
&gt; &gt; &gt; c<br>
&gt; &gt; &gt; index 315c973f3228..a856179fb3b1 100644<br>
&gt; &gt; &gt; --- a/contrib/wpa/src/utils/os_unix.c<br>
&gt; &gt; &gt; +++ b/contrib/wpa/src/utils/os_unix.c<br>
&gt; &gt; &gt; @@ -72,7 +72,6 @@ int os_get_time(struct os_time *t)<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0return res;<br>
&gt; &gt; &gt;=C2=A0 }<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; -<br>
&gt; &gt; &gt;=C2=A0 int os_get_reltime(struct os_reltime *t)<br>
&gt; &gt; &gt;=C2=A0 {<br>
&gt; &gt; &gt;=C2=A0 #ifndef __MACH__<br>
&gt; &gt; &gt; @@ -97,15 +96,21 @@ int os_get_reltime(struct os_reltime *t)=
<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0return 0;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0switch=
 (clock_id) {<br>
&gt; &gt; &gt; -#ifdef CLOCK_BOOTTIME<br>
&gt; &gt; &gt; +#if defined(CLOCK_BOOTTIME)<br>
&gt; &gt;<br>
&gt; &gt; Why this change? This could become a potential merge conflict nex=
t time<br>
&gt; &gt; WPA<br>
&gt; &gt; is MFVed.<br>
&gt; &gt;<br>
&gt;<br>
&gt; Oh, that was a mistake.<br>
&gt;<br>
&gt;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case C=
LOCK_BOOTTIME:<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0clock_id =3D3D CLOCK_MONOTONIC;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0break;<br>
&gt; &gt; &gt;=C2=A0 #endif<br>
&gt; &gt; &gt; -#ifdef CLOCK_MONOTONIC<br>
&gt; &gt; &gt; +#if defined(CLOCK_MONOTONIC)<br>
&gt; &gt;<br>
&gt; &gt; Ditto.<br>
&gt; &gt;<br>
&gt;<br>
&gt; Ditto. I iterated on these changes and thought I&#39;d restored them t=
o the<br>
&gt; original. I&#39;ll do a followup diff minimization diff.<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; &gt; +/*<br>
&gt; &gt; &gt; + * FreeBSD has both BOOTTIME and MONOTONIC defined to the s=
ame value,<br>
&gt; &gt; since<br>
&gt; &gt; &gt; they<br>
&gt; &gt; &gt; + * mean the same thing. FreeBSD 14.1 and ealier don&#39;t, =
so need this<br>
&gt; &gt; case.<br>
&gt; &gt; &gt; + */<br>
&gt; &gt; &gt; +#if !(defined(CLOCK_BOOTTIME) &amp;&amp; CLOCK_BOOTTIME =3D=
3D=3D3D CLOCK_MONOTONIC=3D<br>
&gt; )<br>
&gt; &gt;<br>
&gt; &gt; This I probably want to apply to the ports.<br>
&gt; &gt;<br>
&gt;<br>
&gt; Yes. I had you on the review, but I did move kinda quickly on this, an=
d so<br>
<br>
That was my fault. My MH review folder is large and with all the things <br=
>
going on here I failed to cherry-pick this one out of that folder. This is =
<br>
totally on me, I&#39;m sorry.<br></blockquote><div><br></div><div>Gotcha. N=
o worries.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex">
&gt; those ports<br>
&gt; are likely broken by the change in FreeBSD. My apologies.<br>
<br>
No apologies necessary. As long as I know what can be kept and what can be =
<br>
overwritten next time WPA is MFVed.<br></blockquote><div><br></div><div>I&#=
39;ve pushed a fix to avoid the gratuitous differences. It should be clear =
now that you</div><div>know about it and the diffs are minimized.</div><div=
><br></div><div>Warner</div><div>=C2=A0</div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex">
-- <br>
Cheers,<br>
Cy Schubert &lt;<a href=3D"mailto:Cy.Schubert@cschubert.com" target=3D"_bla=
nk">Cy.Schubert@cschubert.com</a>&gt;<br>
FreeBSD UNIX:=C2=A0 &lt;cy@FreeBSD.org&gt;=C2=A0 =C2=A0Web:=C2=A0 <a href=
=3D"https://FreeBSD.org" rel=3D"noreferrer" target=3D"_blank">https://FreeB=
SD.org</a><br>
NTP:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&lt;<a href=3D"mailto:cy@nwtim=
e.org" target=3D"_blank">cy@nwtime.org</a>&gt;=C2=A0 =C2=A0 Web:=C2=A0 <a h=
ref=3D"https://nwtime.org" rel=3D"noreferrer" target=3D"_blank">https://nwt=
ime.org</a><br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 e^(i*pi)+1=3D0<br>
<br>
<br>
</blockquote></div></div>

--000000000000c388f30619c22bf5--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfozpD%2BPvRAV2kWYksgsQTte16ytTp--qVD%2BvxEUrTWc4g>