sync code with last improvements from OpenBSD
This commit is contained in:
parent
27298272ec
commit
7116a5838e
35 changed files with 509 additions and 254 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if.c,v 1.706 2023/07/07 19:45:26 bluhm Exp $ */
|
||||
/* $OpenBSD: if.c,v 1.707 2023/08/18 08:10:16 jsg Exp $ */
|
||||
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -910,7 +910,7 @@ if_output_tso(struct ifnet *ifp, struct mbuf **mp, struct sockaddr *dst,
|
|||
|
||||
/*
|
||||
* Try to send with TSO first. When forwarding LRO may set
|
||||
* maximium segment size in mbuf header. Chop TCP segment
|
||||
* maximum segment size in mbuf header. Chop TCP segment
|
||||
* even if it would fit interface MTU to preserve maximum
|
||||
* path MTU.
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: if_pfsync.c,v 1.319 2023/07/31 11:13:09 dlg Exp $ */
|
||||
/* $OpenBSD: if_pfsync.c,v 1.320 2023/08/18 08:03:57 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 Michael Shalayeff
|
||||
|
@ -1528,7 +1528,7 @@ pfsync_sendout(struct pfsync_softc *sc, struct mbuf *m)
|
|||
{
|
||||
struct ip_moptions imo;
|
||||
unsigned int len = m->m_pkthdr.len;
|
||||
#if NBPF > 0
|
||||
#if NBPFILTER > 0
|
||||
caddr_t if_bpf = sc->sc_if.if_bpf;
|
||||
if (if_bpf)
|
||||
bpf_mtap(if_bpf, m, BPF_DIRECTION_OUT);
|
||||
|
@ -2628,9 +2628,6 @@ pfsync_input(struct mbuf *m, uint8_t ttl, unsigned int hlen)
|
|||
unsigned int len;
|
||||
void (*in)(struct pfsync_softc *,
|
||||
const caddr_t, unsigned int, unsigned int);
|
||||
#if NBPF > 0
|
||||
caddr_t if_bpf;
|
||||
#endif
|
||||
|
||||
pfsyncstat_inc(pfsyncs_ipackets);
|
||||
|
||||
|
@ -2650,9 +2647,6 @@ pfsync_input(struct mbuf *m, uint8_t ttl, unsigned int hlen)
|
|||
goto leave;
|
||||
}
|
||||
|
||||
#if NBPF > 0
|
||||
#endif
|
||||
|
||||
/* verify that the IP TTL is 255. */
|
||||
if (ttl != PFSYNC_DFLTTL) {
|
||||
pfsyncstat_inc(pfsyncs_badttl);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: wg_cookie.c,v 1.4 2022/03/17 18:51:56 tb Exp $ */
|
||||
/* $OpenBSD: wg_cookie.c,v 1.5 2023/08/18 08:11:47 jsg Exp $ */
|
||||
/*
|
||||
* Copyright (C) 2015-2020 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
|
||||
* Copyright (C) 2019-2020 Matt Dunwoodie <ncon@noconroy.net>
|
||||
|
@ -385,7 +385,7 @@ ratelimit_allow(struct ratelimit *rl, struct sockaddr *sa)
|
|||
* lapsed since our last_time, adding that, ensuring that we
|
||||
* cap the tokens at TOKEN_MAX. If the endpoint has no tokens
|
||||
* left (that is tokens <= INITIATION_COST) then we block the
|
||||
* request, otherwise we subtract the INITITIATION_COST and
|
||||
* request, otherwise we subtract the INITIATION_COST and
|
||||
* return OK. */
|
||||
diff = r->r_last_time;
|
||||
getnanouptime(&r->r_last_time);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue