version 1.10, 2022/08/11 21:59:05
|
version 1.11, 2022/08/13 18:16:39
|
Line 31 fwsync_add_state(const struct fws_proto *pkt)
|
Line 31 fwsync_add_state(const struct fws_proto *pkt)
|
int |
int |
fwsync_add_alias(const struct fws_proto *pkt) |
fwsync_add_alias(const struct fws_proto *pkt) |
{ |
{ |
|
struct fws_sndpkt *p; |
|
|
DTRACE(); |
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; |
return 0; |
} |
} |
|
|