Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Jan 2022 09:20:47 -0900
From:      Rob Wing <rew@freebsd.org>
To:        Mike Karels <mike@karels.net>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org,  dev-commits-src-main@freebsd.org
Subject:   Re: git: eb18708ec8c7 - main - syncache: accept packet with no SA when TCP_MD5SIG is set
Message-ID:  <CAF3%2Bn_f8Uh_ttjWQS11dLoMtA_-Mxaon6hLRkq-3V_%2B5h9kFgw@mail.gmail.com>
In-Reply-To: <202201122226.20CMQwMw007750@mail.karels.net>
References:  <CAF3%2Bn_eOVx=WwVqO4rHja_3r3sqmj94theYRgqmQaMxU9X5=JQ@mail.gmail.com> <202201122226.20CMQwMw007750@mail.karels.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000007a3ef705d58edcb7
Content-Type: text/plain; charset="UTF-8"

On Wed, Jan 12, 2022 at 1:27 PM Mike Karels <mike@karels.net> wrote:

> Rob wrote:
> > For what it's worth, this behavior is consistent with OpenBSD.
>
> That's a useful data point, thanks.
>

There is value in having the same semantics as OpenBSD for the TCP_MD5SIG
option <https://man.openbsd.org/tcp.4>.

If OpenBSD's semantics of the TCP_MD5SIG option were different, I likely
would have taken a different approach. And also given that FreeBSD and
OpenBSD's TCP_MD5SIG option had the same behavior until we diverged in 2017.

..that's how I ended up going in this direction

-Rob


>
>                 Mike
>
> > -Rob
>
>
> > >
> > >                 Mike
> > >
> > > On 8 Jan 2022, at 19:45, Robert Wing wrote:
> > >
> > > > The branch main has been updated by rew:
> > > >
> > > > URL:
> > >
> https://cgit.FreeBSD.org/src/commit/?id=3Deb18708ec8c7e1de6a05aba41971659=
> > 549991b10
> > > >
> > > > commit eb18708ec8c7e1de6a05aba41971659549991b10
> > > > Author:     Robert Wing <rew@FreeBSD.org>
> > > > AuthorDate: 2022-01-09 01:07:50 +0000
> > > > Commit:     Robert Wing <rew@FreeBSD.org>
> > > > CommitDate: 2022-01-09 01:32:14 +0000
> > > >
> > > >     syncache: accept packet with no SA when TCP_MD5SIG is set
> > > >
> > > >     When TCP_MD5SIG is set on a socket, all packets are dropped that
> > > don't
> > > >     contain an MD5 signature. Relax this behavior to accept a
> non-signe=
> > d
> > > >     packet when a security association doesn't exist with the peer.
> > > >
> > > >     This is useful when a listen socket set with TCP_MD5SIG wants to
> > > handle
> > > >     connections protected with and without MD5 signatures.
> > > >
> > > >     Reviewed by:    bz (previous version)
> > > >     Sponsored by:   nepustil.net
> > > >     Sponsored by:   Klara Inc.
> > > >     Differential Revision:  https://reviews.freebsd.org/D33227
> > > > ---
> > > >  share/man/man4/tcp.4       |  6 +++++-
> > > >  sys/netinet/tcp_syncache.c | 30 ++++++++++++++++++------------
> > > >  sys/netipsec/xform_tcp.c   |  5 +++++
> > > >  3 files changed, 28 insertions(+), 13 deletions(-)
> > > >
> > > > diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4
> > > > index 17138fa224ba..d103293132ba 100644
> > > > --- a/share/man/man4/tcp.4
> > > > +++ b/share/man/man4/tcp.4
> > > > @@ -34,7 +34,7 @@
> > > >  .\"     From: @(#)tcp.4      8.1 (Berkeley) 6/5/93
> > > >  .\" $FreeBSD$
> > > >  .\"
> > > > -.Dd June 27, 2021
> > > > +.Dd January 8, 2022
> > > >  .Dt TCP 4
> > > >  .Os
> > > >  .Sh NAME
> > > > @@ -339,6 +339,10 @@ This entry can only be specified on a per-host
> > > basis at this time.
> > > >  .Pp
> > > >  If an SADB entry cannot be found for the destination,
> > > >  the system does not send any outgoing segments and drops any inbound
> > > segments.
> > > > +However, during connection negotiation, a non-signed segment will be
> > > accepted if
> > > > +an SADB entry does not exist between hosts.
> > > > +When a non-signed segment is accepted, the established connection
> is n=
> > ot
> > > > +protected with MD5 digests.
> > > >  .It Dv TCP_STATS
> > > >  Manage collection of connection level statistics using the
> > > >  .Xr stats 3
> > > > diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
> > > > index 7dd8443cad65..32ca3bc2209b 100644
> > > > --- a/sys/netinet/tcp_syncache.c
> > > > +++ b/sys/netinet/tcp_syncache.c
> > > > @@ -1514,19 +1514,25 @@ syncache_add(struct in_conninfo *inc, struct
> > > tcpopt *to, struct tcphdr *th,
> > > >
> > > >  #if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE)
> > > >       /*
> > > > -      * If listening socket requested TCP digests, check that
> received
> > > > -      * SYN has signature and it is correct. If signature doesn't
> matc=
> > h
> > > > -      * or TCP_SIGNATURE support isn't enabled, drop the packet.
> > > > +      * When the socket is TCP-MD5 enabled check that,
> > > > +      *  - a signed packet is valid
> > > > +      *  - a non-signed packet does not have a security association
> > > > +      *
> > > > +      *  If a signed packet fails validation or a non-signed packet
> ha=
> > s
> > > a
> > > > +      *  security association, the packet will be dropped.
> > > >        */
> > > >       if (ltflags & TF_SIGNATURE) {
> > > > -             if ((to->to_flags & TOF_SIGNATURE) =3D=3D 0) {
> > > > -                     TCPSTAT_INC(tcps_sig_err_nosigopt);
> > > > -                     goto done;
> > > > +             if (to->to_flags & TOF_SIGNATURE) {
> > > > +                     if (!TCPMD5_ENABLED() ||
> > > > +                         TCPMD5_INPUT(m, th, to->to_signature) !=3D
> 0)
> > > > +                             goto done;
> > > > +             } else {
> > > > +                     if (TCPMD5_ENABLED() &&
> > > > +                         TCPMD5_INPUT(m, NULL, NULL) !=3D ENOENT)
> > > > +                             goto done;
> > > >               }
> > > > -             if (!TCPMD5_ENABLED() ||
> > > > -                 TCPMD5_INPUT(m, th, to->to_signature) !=3D 0)
> > > > -                     goto done;
> > > > -     }
> > > > +     } else if (to->to_flags & TOF_SIGNATURE)
> > > > +             goto done;
> > > >  #endif       /* TCP_SIGNATURE */
> > > >       /*
> > > >        * See if we already have an entry for this connection.
> > > > @@ -1724,11 +1730,11 @@ skip_alloc:
> > > >       }
> > > >  #if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE)
> > > >       /*
> > > > -      * If listening socket requested TCP digests, flag this in the
> > > > +      * If incoming packet has an MD5 signature, flag this in the
> > > >        * syncache so that syncache_respond() will do the right thing
> > > >        * with the SYN+ACK.
> > > >        */
> > > > -     if (ltflags & TF_SIGNATURE)
> > > > +     if (to->to_flags & TOF_SIGNATURE)
> > > >               sc->sc_flags |=3D SCF_SIGNATURE;
> > > >  #endif       /* TCP_SIGNATURE */
> > > >       if (to->to_flags & TOF_SACKPERM)
> > > > diff --git a/sys/netipsec/xform_tcp.c b/sys/netipsec/xform_tcp.c
> > > > index b53544cd00fb..ce2552f0a205 100644
> > > > --- a/sys/netipsec/xform_tcp.c
> > > > +++ b/sys/netipsec/xform_tcp.c
> > > > @@ -269,6 +269,11 @@ tcp_ipsec_input(struct mbuf *m, struct tcphdr
> *th,
> > > u_char *buf)
> > > >               KMOD_TCPSTAT_INC(tcps_sig_err_buildsig);
> > > >               return (ENOENT);
> > > >       }
> > > > +     if (buf =3D=3D NULL) {
> > > > +             key_freesav(&sav);
> > > > +             KMOD_TCPSTAT_INC(tcps_sig_err_nosigopt);
> > > > +             return (EACCES);
> > > > +     }
> > > >       /*
> > > >        * tcp_input() operates with TCP header fields in host
> > > >        * byte order. We expect them in network byte order.
> > >
>

--0000000000007a3ef705d58edcb7
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 Wed, Jan 12, 2022 at 1:27 PM Mike =
Karels &lt;<a href=3D"mailto:mike@karels.net">mike@karels.net</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);padding-left:1ex">Rob wrote:<br>=
&gt; For what it&#39;s worth, this behavior is consistent with OpenBSD.<br>
<br>
That&#39;s a useful data point, thanks.<br></blockquote><div><br></div><div=
>There is value in having the same semantics as OpenBSD for the <a href=3D"=
https://man.openbsd.org/tcp.4">TCP_MD5SIG option</a>.</div><div><br></div><=
div>If OpenBSD&#39;s semantics of the TCP_MD5SIG option were different, I l=
ikely would have taken a different approach. And also given that FreeBSD an=
d OpenBSD&#39;s TCP_MD5SIG option had the same behavior until we diverged i=
n 2017.<br></div><div><br></div><div>..that&#39;s how I ended up going in t=
his direction<br></div><div><br></div><div>-Rob<br></div><div>=C2=A0</div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex">
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Mike<br>
<br>
&gt; -Rob<br>
<br>
<br>
&gt; &gt;<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Mike=
<br>
&gt; &gt;<br>
&gt; &gt; On 8 Jan 2022, at 19:45, Robert Wing wrote:<br>
&gt; &gt;<br>
&gt; &gt; &gt; The branch main has been updated by rew:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; URL:<br>
&gt; &gt; <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D3Deb18708ec8=
c7e1de6a05aba41971659=3D" rel=3D"noreferrer" target=3D"_blank">https://cgit=
.FreeBSD.org/src/commit/?id=3D3Deb18708ec8c7e1de6a05aba41971659=3D</a><br>
&gt; 549991b10<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; commit eb18708ec8c7e1de6a05aba41971659549991b10<br>
&gt; &gt; &gt; Author:=C2=A0 =C2=A0 =C2=A0Robert Wing &lt;rew@FreeBSD.org&g=
t;<br>
&gt; &gt; &gt; AuthorDate: 2022-01-09 01:07:50 +0000<br>
&gt; &gt; &gt; Commit:=C2=A0 =C2=A0 =C2=A0Robert Wing &lt;rew@FreeBSD.org&g=
t;<br>
&gt; &gt; &gt; CommitDate: 2022-01-09 01:32:14 +0000<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0syncache: accept packet with no SA when T=
CP_MD5SIG is set<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0When TCP_MD5SIG is set on a socket, all p=
ackets are dropped that<br>
&gt; &gt; don&#39;t<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0contain an MD5 signature. Relax this beha=
vior to accept a non-signe=3D<br>
&gt; d<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0packet when a security association doesn&=
#39;t exist with the peer.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0This is useful when a listen socket set w=
ith TCP_MD5SIG wants to<br>
&gt; &gt; handle<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0connections protected with and without MD=
5 signatures.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 bz (previous ve=
rsion)<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0<a href=3D"http=
://nepustil.net" rel=3D"noreferrer" target=3D"_blank">nepustil.net</a><br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0Klara Inc.<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0Differential Revision:=C2=A0 <a href=3D"h=
ttps://reviews.freebsd.org/D33227" rel=3D"noreferrer" target=3D"_blank">htt=
ps://reviews.freebsd.org/D33227</a><br>
&gt; &gt; &gt; ---<br>
&gt; &gt; &gt;=C2=A0 share/man/man4/tcp.4=C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0=
 6 +++++-<br>
&gt; &gt; &gt;=C2=A0 sys/netinet/tcp_syncache.c | 30 ++++++++++++++++++----=
--------<br>
&gt; &gt; &gt;=C2=A0 sys/netipsec/xform_tcp.c=C2=A0 =C2=A0|=C2=A0 5 +++++<b=
r>
&gt; &gt; &gt;=C2=A0 3 files changed, 28 insertions(+), 13 deletions(-)<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4<br>
&gt; &gt; &gt; index 17138fa224ba..d103293132ba 100644<br>
&gt; &gt; &gt; --- a/share/man/man4/tcp.4<br>
&gt; &gt; &gt; +++ b/share/man/man4/tcp.4<br>
&gt; &gt; &gt; @@ -34,7 +34,7 @@<br>
&gt; &gt; &gt;=C2=A0 .\&quot;=C2=A0 =C2=A0 =C2=A0From: @(#)tcp.4=C2=A0 =C2=
=A0 =C2=A0 8.1 (Berkeley) 6/5/93<br>
&gt; &gt; &gt;=C2=A0 .\&quot; $FreeBSD$<br>
&gt; &gt; &gt;=C2=A0 .\&quot;<br>
&gt; &gt; &gt; -.Dd June 27, 2021<br>
&gt; &gt; &gt; +.Dd January 8, 2022<br>
&gt; &gt; &gt;=C2=A0 .Dt TCP 4<br>
&gt; &gt; &gt;=C2=A0 .Os<br>
&gt; &gt; &gt;=C2=A0 .Sh NAME<br>
&gt; &gt; &gt; @@ -339,6 +339,10 @@ This entry can only be specified on a p=
er-host<br>
&gt; &gt; basis at this time.<br>
&gt; &gt; &gt;=C2=A0 .Pp<br>
&gt; &gt; &gt;=C2=A0 If an SADB entry cannot be found for the destination,<=
br>
&gt; &gt; &gt;=C2=A0 the system does not send any outgoing segments and dro=
ps any inbound<br>
&gt; &gt; segments.<br>
&gt; &gt; &gt; +However, during connection negotiation, a non-signed segmen=
t will be<br>
&gt; &gt; accepted if<br>
&gt; &gt; &gt; +an SADB entry does not exist between hosts.<br>
&gt; &gt; &gt; +When a non-signed segment is accepted, the established conn=
ection is n=3D<br>
&gt; ot<br>
&gt; &gt; &gt; +protected with MD5 digests.<br>
&gt; &gt; &gt;=C2=A0 .It Dv TCP_STATS<br>
&gt; &gt; &gt;=C2=A0 Manage collection of connection level statistics using=
 the<br>
&gt; &gt; &gt;=C2=A0 .Xr stats 3<br>
&gt; &gt; &gt; diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_sy=
ncache.c<br>
&gt; &gt; &gt; index 7dd8443cad65..32ca3bc2209b 100644<br>
&gt; &gt; &gt; --- a/sys/netinet/tcp_syncache.c<br>
&gt; &gt; &gt; +++ b/sys/netinet/tcp_syncache.c<br>
&gt; &gt; &gt; @@ -1514,19 +1514,25 @@ syncache_add(struct in_conninfo *inc=
, struct<br>
&gt; &gt; tcpopt *to, struct tcphdr *th,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;=C2=A0 #if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE)<b=
r>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0/*<br>
&gt; &gt; &gt; -=C2=A0 =C2=A0 =C2=A0 * If listening socket requested TCP di=
gests, check that received<br>
&gt; &gt; &gt; -=C2=A0 =C2=A0 =C2=A0 * SYN has signature and it is correct.=
 If signature doesn&#39;t matc=3D<br>
&gt; h<br>
&gt; &gt; &gt; -=C2=A0 =C2=A0 =C2=A0 * or TCP_SIGNATURE support isn&#39;t e=
nabled, drop the packet.<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 * When the socket is TCP-MD5 enabled c=
heck that,<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 *=C2=A0 - a signed packet is valid<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 *=C2=A0 - a non-signed packet does not=
 have a security association<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 *<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 *=C2=A0 If a signed packet fails valid=
ation or a non-signed packet ha=3D<br>
&gt; s<br>
&gt; &gt; a<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 *=C2=A0 security association, the pack=
et will be dropped.<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 */<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (ltflags &amp; TF_SIGNATURE) {<=
br>
&gt; &gt; &gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if ((to-&gt=
;to_flags &amp; TOF_SIGNATURE) =3D3D=3D3D 0) {<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=A0TCPSTAT_INC(tcps_sig_err_nosigopt);<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=A0goto done;<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (to-&gt;=
to_flags &amp; TOF_SIGNATURE) {<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=A0if (!TCPMD5_ENABLED() ||<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=A0 =C2=A0TCPMD5_INPUT(m, th, to-&gt;to_signature) !=
=3D3D 0)<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=A0 =C2=A0 =C2=A0 =C2=A0goto done;<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0} else {<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=A0if (TCPMD5_ENABLED() &amp;&amp;<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=A0 =C2=A0TCPMD5_INPUT(m, NULL, NULL) !=3D3D ENOENT)<b=
r>
&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=A0 =C2=A0 =C2=A0 =C2=A0goto done;<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=A0if (!TCPMD5=
_ENABLED() ||<br>
&gt; &gt; &gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0TCPMD5_INPUT(m, th, to-&gt;to_signature) !=3D3D 0)<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=A0goto done;<br>
&gt; &gt; &gt; -=C2=A0 =C2=A0 =C2=A0}<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0} else if (to-&gt;to_flags &amp; TOF_SI=
GNATURE)<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0goto done;<=
br>
&gt; &gt; &gt;=C2=A0 #endif=C2=A0 =C2=A0 =C2=A0 =C2=A0/* TCP_SIGNATURE */<b=
r>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0/*<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 * See if we already have an entry=
 for this connection.<br>
&gt; &gt; &gt; @@ -1724,11 +1730,11 @@ skip_alloc:<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt; &gt; &gt;=C2=A0 #if defined(IPSEC_SUPPORT) || defined(TCP_SIGNATURE)<b=
r>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0/*<br>
&gt; &gt; &gt; -=C2=A0 =C2=A0 =C2=A0 * If listening socket requested TCP di=
gests, flag this in the<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 * If incoming packet has an MD5 signat=
ure, flag this in the<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 * syncache so that syncache_respo=
nd() will do the right thing<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 * with the SYN+ACK.<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 */<br>
&gt; &gt; &gt; -=C2=A0 =C2=A0 =C2=A0if (ltflags &amp; TF_SIGNATURE)<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0if (to-&gt;to_flags &amp; TOF_SIGNATURE=
)<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sc-&gt=
;sc_flags |=3D3D SCF_SIGNATURE;<br>
&gt; &gt; &gt;=C2=A0 #endif=C2=A0 =C2=A0 =C2=A0 =C2=A0/* TCP_SIGNATURE */<b=
r>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0if (to-&gt;to_flags &amp; TOF_SACK=
PERM)<br>
&gt; &gt; &gt; diff --git a/sys/netipsec/xform_tcp.c b/sys/netipsec/xform_t=
cp.c<br>
&gt; &gt; &gt; index b53544cd00fb..ce2552f0a205 100644<br>
&gt; &gt; &gt; --- a/sys/netipsec/xform_tcp.c<br>
&gt; &gt; &gt; +++ b/sys/netipsec/xform_tcp.c<br>
&gt; &gt; &gt; @@ -269,6 +269,11 @@ tcp_ipsec_input(struct mbuf *m, struct =
tcphdr *th,<br>
&gt; &gt; u_char *buf)<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0KMOD_T=
CPSTAT_INC(tcps_sig_err_buildsig);<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return=
 (ENOENT);<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0}<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0if (buf =3D3D=3D3D NULL) {<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0key_freesav=
(&amp;sav);<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0KMOD_TCPSTA=
T_INC(tcps_sig_err_nosigopt);<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (EAC=
CES);<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0}<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0/*<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 * tcp_input() operates with TCP h=
eader fields in host<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 * byte order. We expect them in n=
etwork byte order.<br>
&gt; &gt;<br>
</blockquote></div></div>

--0000000000007a3ef705d58edcb7--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF3%2Bn_f8Uh_ttjWQS11dLoMtA_-Mxaon6hLRkq-3V_%2B5h9kFgw>