View | Details | Raw Unified | Return to bug 263297 | Differences between
and this patch

Collapse All | Expand All

(-)if_wg.c (+25 lines)
Lines 377-383 static void wg_queue_purge(struct wg_queue *); 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-1953 wg_queue_dequeue_parallel(struct wg_queue *parallel) Link Here
1946
	return (pkt);
1950
	return (pkt);
1947
}
1951
}
1948
1952
1953
#if __FreeBSD_version >= 1400057
1949
static void
1954
static void
1950
wg_input(struct mbuf *m, int offset, struct inpcb *inpcb,
1955
wg_input(struct mbuf *m, int offset, struct inpcb *inpcb,
1956
#else
1957
static void
1958
wg_input(struct mbuf *m, int offset, struct inpcb *inpcb,
1959
#endif
1951
    const struct sockaddr *sa, void *_sc)
1960
    const struct sockaddr *sa, void *_sc)
1952
{
1961
{
1953
	const struct sockaddr_in	*sin;
1962
	const struct sockaddr_in	*sin;
Lines 1965-1971 wg_input(struct mbuf *m, int offset, struct inpcb *inp Link Here
1965
	m = m_unshare(m, M_NOWAIT);
1974
	m = m_unshare(m, M_NOWAIT);
1966
	if (!m) {
1975
	if (!m) {
1967
		if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1);
1976
		if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1);
1977
#if __FreeBSD_version >= 1400057
1978
		return true;
1979
#else
1968
		return;
1980
		return;
1981
#endif
1969
	}
1982
	}
1970
1983
1971
	/* Caller provided us with `sa`, no need for this header. */
1984
	/* Caller provided us with `sa`, no need for this header. */
Lines 1974-1986 wg_input(struct mbuf *m, int offset, struct inpcb *inp Link Here
1974
	/* Pullup enough to read packet type */
1987
	/* Pullup enough to read packet type */
1975
	if ((m = m_pullup(m, sizeof(uint32_t))) == NULL) {
1988
	if ((m = m_pullup(m, sizeof(uint32_t))) == NULL) {
1976
		if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1);
1989
		if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1);
1990
#if __FreeBSD_version >= 1400057
1991
		return true;
1992
#else
1977
		return;
1993
		return;
1994
#endif
1978
	}
1995
	}
1979
1996
1980
	if ((pkt = wg_packet_alloc(m)) == NULL) {
1997
	if ((pkt = wg_packet_alloc(m)) == NULL) {
1981
		if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1);
1998
		if_inc_counter(sc->sc_ifp, IFCOUNTER_IQDROPS, 1);
1982
		m_freem(m);
1999
		m_freem(m);
2000
#if __FreeBSD_version >= 1400057
2001
		return true;
2002
#else
1983
		return;
2003
		return;
2004
#endif
1984
	}
2005
	}
1985
2006
1986
	/* Save send/recv address and port for later. */
2007
	/* Save send/recv address and port for later. */
Lines 2031-2037 wg_input(struct mbuf *m, int offset, struct inpcb *inp Link Here
2031
error:
2052
error:
2032
	if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1);
2053
	if_inc_counter(sc->sc_ifp, IFCOUNTER_IERRORS, 1);
2033
	wg_packet_free(pkt);
2054
	wg_packet_free(pkt);
2055
#if __FreeBSD_version >= 1400057
2056
	return true;
2057
#else
2034
	return;
2058
	return;
2059
#endif
2035
}
2060
}
2036
2061
2037
static void
2062
static void

Return to bug 263297