mirror of https://gerrit.osmocom.org/libosmocore
libcommon: socket: extend make_sock() prototype
This patch extends the make_sock() prototype so you can fully set the fields priv_nr and data of the bsc_fd structure. This is the first step to get rid of the internal make_sock() implementation that ipaccess-proxy uses. This patch includes a minor cleanup to pass INADDR_ANY instead of zero, if you do not want to bind the socket to one specific address.
This commit is contained in:
parent
167281ec50
commit
c0d04310f3
|
@ -946,7 +946,7 @@ int gprs_ns_nsip_listen(struct gprs_ns_inst *nsi)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = make_sock(&nsi->nsip.fd, IPPROTO_UDP, nsi->nsip.local_ip,
|
ret = make_sock(&nsi->nsip.fd, IPPROTO_UDP, nsi->nsip.local_ip,
|
||||||
nsi->nsip.local_port, nsip_fd_cb);
|
nsi->nsip.local_port, 0, nsip_fd_cb, NULL);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
|
@ -292,7 +292,7 @@ int gprs_ns_frgre_listen(struct gprs_ns_inst *nsi)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
rc = make_sock(&nsi->frgre.fd, IPPROTO_GRE, nsi->frgre.local_ip,
|
rc = make_sock(&nsi->frgre.fd, IPPROTO_GRE, nsi->frgre.local_ip,
|
||||||
0, nsfrgre_fd_cb);
|
0, 0, nsfrgre_fd_cb, NULL);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
LOGP(DNS, LOGL_ERROR, "Error creating GRE socket (%s)\n",
|
LOGP(DNS, LOGL_ERROR, "Error creating GRE socket (%s)\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
|
Loading…
Reference in New Issue