Lines 377-383
Link Here
|
377 |
static int wg_queue_both(struct wg_queue *, struct wg_queue *, struct wg_packet *); |
377 |
static int wg_queue_both(struct wg_queue *, struct wg_queue *, struct wg_packet *); |
378 |
static struct wg_packet *wg_queue_dequeue_serial(struct wg_queue *); |
378 |
static struct wg_packet *wg_queue_dequeue_serial(struct wg_queue *); |
379 |
static struct wg_packet *wg_queue_dequeue_parallel(struct wg_queue *); |
379 |
static struct wg_packet *wg_queue_dequeue_parallel(struct wg_queue *); |
|
|
380 |
#if __FreeBSD_version >= 1400057 |
381 |
static bool wg_input(struct mbuf *, int, struct inpcb *, const struct sockaddr *, void *); |
382 |
#else |
380 |
static void wg_input(struct mbuf *, int, struct inpcb *, const struct sockaddr *, void *); |
383 |
static void wg_input(struct mbuf *, int, struct inpcb *, const struct sockaddr *, void *); |
|
|
384 |
#endif |
381 |
static void wg_peer_send_staged(struct wg_peer *); |
385 |
static void wg_peer_send_staged(struct wg_peer *); |
382 |
static int wg_clone_create(struct if_clone *, int, caddr_t); |
386 |
static int wg_clone_create(struct if_clone *, int, caddr_t); |
383 |
static void wg_qflush(struct ifnet *); |
387 |
static void wg_qflush(struct ifnet *); |
Lines 1946-1954
Link Here
|
1946 |
return (pkt); |
1950 |
return (pkt); |
1947 |
} |
1951 |
} |
1948 |
|
1952 |
|
|
|
1953 |
#if __FreeBSD_version >= 1400057 |
1954 |
static bool |
1955 |
wg_input(struct mbuf *m, int offset, struct inpcb *inpcb, |
1956 |
const struct sockaddr *sa, void *_sc) |
1957 |
#else |
1949 |
static void |
1958 |
static void |
1950 |
wg_input(struct mbuf *m, int offset, struct inpcb *inpcb, |
1959 |
wg_input(struct mbuf *m, int offset, struct inpcb *inpcb, |
1951 |
const struct sockaddr *sa, void *_sc) |
1960 |
const struct sockaddr *sa, void *_sc) |
|
|
1961 |
#endif |
1952 |
{ |
1962 |
{ |
1953 |
const struct sockaddr_in *sin; |
1963 |
const struct sockaddr_in *sin; |
1954 |
const struct sockaddr_in6 *sin6; |
1964 |
const struct sockaddr_in6 *sin6; |
Lines 1965-1971
Link Here
|
1965 |
m = m_unshare(m, M_NOWAIT); |
1975 |
m = m_unshare(m, M_NOWAIT); |
1966 |
if (!m) { |
1976 |
if (!m) { |
1967 |
if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1); |
1977 |
if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1); |
|
|
1978 |
#if __FreeBSD_version >= 1400057 |
1979 |
return true; |
1980 |
#else |
1968 |
return; |
1981 |
return; |
|
|
1982 |
#endif |
1969 |
} |
1983 |
} |
1970 |
|
1984 |
|
1971 |
/* Caller provided us with `sa`, no need for this header. */ |
1985 |
/* Caller provided us with `sa`, no need for this header. */ |
Lines 1974-1986
Link Here
|
1974 |
/* Pullup enough to read packet type */ |
1988 |
/* Pullup enough to read packet type */ |
1975 |
if ((m = m_pullup(m, sizeof(uint32_t))) == NULL) { |
1989 |
if ((m = m_pullup(m, sizeof(uint32_t))) == NULL) { |
1976 |
if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1); |
1990 |
if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1); |
|
|
1991 |
#if __FreeBSD_version >= 1400057 |
1992 |
return true; |
1993 |
#else |
1977 |
return; |
1994 |
return; |
|
|
1995 |
#endif |
1978 |
} |
1996 |
} |
1979 |
|
1997 |
|
1980 |
if ((pkt = wg_packet_alloc(m)) == NULL) { |
1998 |
if ((pkt = wg_packet_alloc(m)) == NULL) { |
1981 |
if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1); |
1999 |
if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1); |
1982 |
m_freem(m); |
2000 |
m_freem(m); |
|
|
2001 |
#if __FreeBSD_version >= 1400057 |
2002 |
return true; |
2003 |
#else |
1983 |
return; |
2004 |
return; |
|
|
2005 |
#endif |
1984 |
} |
2006 |
} |
1985 |
|
2007 |
|
1986 |
/* Save send/recv address and port for later. */ |
2008 |
/* Save send/recv address and port for later. */ |
Lines 2027-2037
Link Here
|
2027 |
} else { |
2049 |
} else { |
2028 |
goto error; |
2050 |
goto error; |
2029 |
} |
2051 |
} |
|
|
2052 |
#if __FreeBSD_version >= 1400057 |
2053 |
return true; |
2054 |
#else |
2030 |
return; |
2055 |
return; |
|
|
2056 |
#endif |
2031 |
error: |
2057 |
error: |
2032 |
if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); |
2058 |
if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1); |
2033 |
wg_packet_free(pkt); |
2059 |
wg_packet_free(pkt); |
|
|
2060 |
#if __FreeBSD_version >= 1400057 |
2061 |
return true; |
2062 |
#else |
2034 |
return; |
2063 |
return; |
|
|
2064 |
#endif |
2035 |
} |
2065 |
} |
2036 |
|
2066 |
|
2037 |
static void |
2067 |
static void |