mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-01 14:14:56 +00:00
wg: Implement if_transmit unconditionally
Commitbf454ca88b
made wg_transmit() defined only when "device netmap" is configured, as if_wg's if_transmit implementation should never be called otherwise, but this breaks a requirement that interfaces implement both or neither of if_transmit and if_qflush. Restore the old behaviour of unconditionally defining wg_transmit(). It contains an assertion that the interface is in netmap mode. Reported by: peterj MFC after: 2 weeks Fixes:bf454ca88b
("wg: Add netmap support")
This commit is contained in:
parent
46bb2dca53
commit
5515e8874a
|
@ -2196,7 +2196,6 @@ determine_af_and_pullup(struct mbuf **m, sa_family_t *af)
|
|||
return (0);
|
||||
}
|
||||
|
||||
#ifdef DEV_NETMAP
|
||||
static int
|
||||
determine_ethertype_and_pullup(struct mbuf **m, int *etp)
|
||||
{
|
||||
|
@ -2258,6 +2257,7 @@ wg_transmit(if_t ifp, struct mbuf *m)
|
|||
return (0);
|
||||
}
|
||||
|
||||
#ifdef DEV_NETMAP
|
||||
/*
|
||||
* This should only be invoked by netmap, via nm_os_send_up(), to process
|
||||
* packets from the host TX ring.
|
||||
|
@ -2921,8 +2921,8 @@ wg_clone_create(struct if_clone *ifc, char *name, size_t len,
|
|||
if_setinitfn(ifp, wg_init);
|
||||
if_setreassignfn(ifp, wg_reassign);
|
||||
if_setqflushfn(ifp, wg_qflush);
|
||||
#ifdef DEV_NETMAP
|
||||
if_settransmitfn(ifp, wg_transmit);
|
||||
#ifdef DEV_NETMAP
|
||||
if_setinputfn(ifp, wg_if_input);
|
||||
#endif
|
||||
if_setoutputfn(ifp, wg_output);
|
||||
|
|
Loading…
Reference in a new issue