diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index 423f00942..2792f002c 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -300,6 +300,7 @@ uint32_t bsc_mgcp_extract_ci(const char *resp); int bsc_write(struct bsc_connection *bsc, struct msgb *msg, int id); int bsc_do_write(struct write_queue *queue, struct msgb *msg, int id); +int bsc_write_msg(struct write_queue *queue, struct msgb *msg); int bsc_write_cb(struct bsc_fd *bfd, struct msgb *msg); /* IMSI allow/deny handling */ diff --git a/openbsc/src/nat/bsc_nat_utils.c b/openbsc/src/nat/bsc_nat_utils.c index a458afdaa..b295f3512 100644 --- a/openbsc/src/nat/bsc_nat_utils.c +++ b/openbsc/src/nat/bsc_nat_utils.c @@ -273,7 +273,11 @@ int bsc_do_write(struct write_queue *queue, struct msgb *msg, int proto) { /* prepend the header */ ipaccess_prepend_header(msg, proto); + return bsc_write_msg(queue, msg); +} +int bsc_write_msg(struct write_queue *queue, struct msgb *msg) +{ if (write_queue_enqueue(queue, msg) != 0) { LOGP(DINP, LOGL_ERROR, "Failed to enqueue the write.\n"); msgb_free(msg);