--- fwsync/driver/fwsync_workers.c 2022/08/11 21:59:05 1.10 +++ fwsync/driver/fwsync_workers.c 2022/08/13 18:16:39 1.11 @@ -31,8 +31,22 @@ fwsync_add_state(const struct fws_proto *pkt) int fwsync_add_alias(const struct fws_proto *pkt) { + struct fws_sndpkt *p; + DTRACE(); + if (!pkt || pkt->fws_addrtype == 1) + return 0; /* skip ethernet packet */ + + p = malloc(sizeof(struct fws_sndpkt), M_FWSYNC, M_NOWAIT | M_ZERO); + if (!p) { + return ENOMEM; + } else + memcpy(&p->sp_proto, pkt, sizeof(struct fws_proto)); + + mtx_lock(&fws_mtx_n); + TAILQ_INSERT_TAIL(&fwsync_natpkt, p, sp_next); + mtx_unlock(&fws_mtx_n); return 0; }