--- fwsync/driver/fwsync_workers.c 2022/08/13 18:16:39 1.11 +++ fwsync/driver/fwsync_workers.c 2022/08/13 18:22:55 1.12 @@ -272,3 +272,30 @@ fwsync_state_sync(const void *arg, const void *extdata free(pkt, M_FWSYNC); return 0; } + +int +fwsync_alias_sync(const void *arg, const void *extdata) +{ + struct fws_sndpkt *pkt; + + DTRACE(); + + mtx_lock(&fws_mtx_n); + pkt = TAILQ_FIRST(&fwsync_natpkt); + if (pkt) + TAILQ_REMOVE(&fwsync_natpkt, pkt, sp_next); + mtx_unlock(&fws_mtx_n); + + if (!pkt) /* update queue is empty */ + return 0; + + if (!(fws_cfg.cfg.on & CFG_SYNC_EDGE)) { + free(pkt, M_FWSYNC); + return EAGAIN; + } + + // TODO: xxx + + free(pkt, M_FWSYNC); + return 0; +}