diff options
-rw-r--r-- | include/osmocom/core/bitvec.h | 1 | ||||
-rw-r--r-- | include/osmocom/gsm/abis_nm.h | 4 | ||||
-rw-r--r-- | include/osmocom/gsm/sysinfo.h | 1 | ||||
-rw-r--r-- | src/gsm/sysinfo.c | 3 | ||||
-rw-r--r-- | src/gsmtap_util.c | 3 | ||||
-rw-r--r-- | src/socket.c | 7 |
6 files changed, 12 insertions, 7 deletions
diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index bbe1641b..7cb8a873 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -23,6 +23,7 @@ * */ +#include <stdint.h> /* In GSM mac blocks, every bit can be 0 or 1, or L or H. L/H are * defined relative to the 0x2b padding pattern */ diff --git a/include/osmocom/gsm/abis_nm.h b/include/osmocom/gsm/abis_nm.h index dcc8d4bb..3f5335e2 100644 --- a/include/osmocom/gsm/abis_nm.h +++ b/include/osmocom/gsm/abis_nm.h @@ -2,8 +2,12 @@ #define _OSMO_GSM_ABIS_NM_H #include <osmocom/gsm/tlv.h> +#include <osmocom/gsm/gsm_utils.h> #include <osmocom/gsm/protocol/gsm_12_21.h> +enum abis_nm_msgtype; +enum gsm_phys_chan_config; + const enum abis_nm_msgtype abis_nm_reports[4]; const enum abis_nm_msgtype abis_nm_no_ack_nack[3]; const enum abis_nm_msgtype abis_nm_sw_load_msgs[9]; diff --git a/include/osmocom/gsm/sysinfo.h b/include/osmocom/gsm/sysinfo.h index a66f3f19..6c81134e 100644 --- a/include/osmocom/gsm/sysinfo.h +++ b/include/osmocom/gsm/sysinfo.h @@ -1,6 +1,7 @@ #ifndef _OSMO_GSM_SYSINFO_H #define _OSMO_GSM_SYSINFO_H +#include <osmocom/core/utils.h> #include <osmocom/gsm/protocol/gsm_04_08.h> enum osmo_sysinfo_type { diff --git a/src/gsm/sysinfo.c b/src/gsm/sysinfo.c index 0dbff3ae..9df18877 100644 --- a/src/gsm/sysinfo.c +++ b/src/gsm/sysinfo.c @@ -23,7 +23,6 @@ #include <errno.h> #include <string.h> #include <stdio.h> -#include <netinet/in.h> #include <osmocom/core/bitvec.h> #include <osmocom/core/utils.h> @@ -71,7 +70,7 @@ static const uint8_t sitype2rsl[_MAX_SYSINFO_TYPE] = { [SYSINFO_TYPE_5ter] = RSL_SYSTEM_INFO_5ter, }; -static const uint8_t rsl2sitype[0xff] = { +static const uint8_t rsl2sitype[256] = { [RSL_SYSTEM_INFO_1] = SYSINFO_TYPE_1, [RSL_SYSTEM_INFO_2] = SYSINFO_TYPE_2, [RSL_SYSTEM_INFO_3] = SYSINFO_TYPE_3, diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index 3d20bfc2..95458657 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -197,16 +197,13 @@ static int gsmtap_wq_w_cb(struct osmo_fd *ofd, struct msgb *msg) rc = write(ofd->fd, msg->data, msg->len); if (rc < 0) { perror("writing msgb to gsmtap fd"); - msgb_free(msg); return rc; } if (rc != msg->len) { perror("short write to gsmtap fd"); - msgb_free(msg); return -EIO; } - msgb_free(msg); return 0; } diff --git a/src/socket.c b/src/socket.c index 66907c8c..0be98b93 100644 --- a/src/socket.c +++ b/src/socket.c @@ -6,10 +6,8 @@ #include <osmocom/core/select.h> #include <osmocom/core/socket.h> -#include <arpa/inet.h> #include <sys/socket.h> #include <sys/types.h> -#include <netinet/in.h> #include <stdio.h> #include <unistd.h> @@ -33,6 +31,9 @@ int osmo_sock_init(uint16_t family, uint16_t type, uint8_t proto, hints.ai_flags = 0; hints.ai_protocol = proto; + if (connect0_bind1) + hints.ai_flags |= AI_PASSIVE; + rc = getaddrinfo(host, portbuf, &hints, &result); if (rc != 0) { perror("getaddrinfo returned NULL"); @@ -169,6 +170,8 @@ int osmo_sockaddr_is_local(struct sockaddr *addr, socklen_t addrlen) } for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { + if (!ifa->ifa_addr) + continue; if (sockaddr_equal(ifa->ifa_addr, addr, addrlen)) return 1; } |