diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-07-01 18:22:01 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-07-01 18:22:01 +0200 |
commit | f15cef94f722c02b0fc401e40bcc4b7a22f9cbed (patch) | |
tree | cb9f65d2ce6144a61fdd9f4bb9153eb223248ca8 /src | |
parent | 9fa0cce100d25585f5a1baff3353cd54a5a58d5f (diff) |
fix various compiler warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/common/abis.c | 1 | ||||
-rw-r--r-- | src/common/bts.c | 3 | ||||
-rw-r--r-- | src/common/logging.c | 2 | ||||
-rw-r--r-- | src/common/measurement.c | 2 | ||||
-rw-r--r-- | src/common/rsl.c | 15 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/bts_model.c | 4 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/l1_fwd_main.c | 1 |
7 files changed, 17 insertions, 11 deletions
diff --git a/src/common/abis.c b/src/common/abis.c index 7a08e188..f9063e78 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -29,6 +29,7 @@ #include <unistd.h> #include <errno.h> #include <string.h> +#include <stdlib.h> #include <osmocom/core/select.h> #include <osmocom/core/timer.h> diff --git a/src/common/bts.c b/src/common/bts.c index e3463972..22008572 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -36,6 +36,7 @@ #include <osmo-bts/logging.h> #include <osmo-bts/abis.h> #include <osmo-bts/bts.h> +#include <osmo-bts/bts_model.h> #include <osmo-bts/rsl.h> #include <osmo-bts/oml.h> @@ -318,7 +319,6 @@ int bts_link_estab(struct gsm_bts *bts) /* All other objects start off-line until the BTS Model code says otherwise */ for (i = 0; i < bts->num_trx; i++) { struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, i); - struct ipabis_link *link = (struct ipabis_link *) trx->rsl_link; oml_tx_state_changed(&trx->mo); oml_tx_state_changed(&trx->bb_transc.mo); @@ -353,7 +353,6 @@ int trx_link_estab(struct gsm_bts_trx *trx) void bts_new_si(void *arg) { struct osmobts_trx *trx = arg; - int i; #if 0 if (osmo_timer_pending(&trx->si.timer)) diff --git a/src/common/logging.c b/src/common/logging.c index a7df2282..608b6267 100644 --- a/src/common/logging.c +++ b/src/common/logging.c @@ -30,7 +30,7 @@ #include <osmo-bts/bts.h> #include <osmo-bts/logging.h> -static const struct log_info_cat bts_log_info_cat[] = { +static struct log_info_cat bts_log_info_cat[] = { [DRSL] = { .name = "DRSL", .description = "A-bis Radio Siganlling Link (RSL)", diff --git a/src/common/measurement.c b/src/common/measurement.c index 5daa5a5e..0b2f371d 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -171,7 +171,7 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn) irssi_sub_sum = irssi_sub_sum / num_meas_sub; } - DEBUGP(DMEAS, "%s Computed TA(% 4uqb) BER-FULL(%2u.%02u%%), RSSI-FULL(-%3udBm), " + DEBUGP(DMEAS, "%s Computed TA(% 4dqb) BER-FULL(%2u.%02u%%), RSSI-FULL(-%3udBm), " "BER-SUB(%2u.%02u%%), RSSI-SUB(-%3udBm)", gsm_lchan_name(lchan), taqb_sum, ber_full_sum/100, ber_full_sum%100, irssi_full_sum, ber_sub_sum/100, ber_sub_sum%100, diff --git a/src/common/rsl.c b/src/common/rsl.c index 7fd59cc7..5aa40f4a 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -570,11 +570,12 @@ static int rsl_rx_chan_activ(struct msgb *msg) if (TLVP_PRESENT(&tp, RSL_IE_SACCH_INFO)) { uint8_t tot_len = TLVP_LEN(&tp, RSL_IE_SACCH_INFO); const uint8_t *val = TLVP_VAL(&tp, RSL_IE_SACCH_INFO); - uint8_t num_msgs = *val++; + const uint8_t *cur = val; + uint8_t num_msgs = *cur++; unsigned int i; for (i = 0; i < num_msgs; i++) { - uint8_t rsl_si = *val++; - uint8_t si_len = *val++; + uint8_t rsl_si = *cur++; + uint8_t si_len = *cur++; uint8_t osmo_si; uint8_t copy_len; @@ -594,9 +595,13 @@ static int rsl_rx_chan_activ(struct msgb *msg) lchan->si.valid |= (1 << osmo_si); lchan->si.buf[osmo_si][0] = 0x00; lchan->si.buf[osmo_si][1] = 0x03; - memcpy(lchan->si.buf[osmo_si]+2, val, copy_len); + memcpy(lchan->si.buf[osmo_si]+2, cur, copy_len); - val += si_len; + cur += si_len; + if (cur >= val + tot_len) { + LOGP(DRSL, LOGL_ERROR, "Error parsing SACCH INFO IE\n"); + return rsl_tx_error_report(msg->trx, RSL_ERR_IE_CONTENT); + } } } else { /* use standard SACCH filling of the BTS */ diff --git a/src/osmo-bts-sysmo/bts_model.c b/src/osmo-bts-sysmo/bts_model.c index ac4e2055..a1040217 100644 --- a/src/osmo-bts-sysmo/bts_model.c +++ b/src/osmo-bts-sysmo/bts_model.c @@ -27,8 +27,8 @@ int bts_model_rsl_chan_act(struct gsm_lchan *lchan, struct tlv_parsed *tp) { - uint8_t mode = *TLVP_VAL(tp, RSL_IE_CHAN_MODE); - uint8_t type = *TLVP_VAL(tp, RSL_IE_ACT_TYPE); + //uint8_t mode = *TLVP_VAL(tp, RSL_IE_CHAN_MODE); + //uint8_t type = *TLVP_VAL(tp, RSL_IE_ACT_TYPE); lchan_activate(lchan); /* FIXME: only do this in case of success */ diff --git a/src/osmo-bts-sysmo/l1_fwd_main.c b/src/osmo-bts-sysmo/l1_fwd_main.c index c7bdcdf5..2f9bf217 100644 --- a/src/osmo-bts-sysmo/l1_fwd_main.c +++ b/src/osmo-bts-sysmo/l1_fwd_main.c @@ -49,6 +49,7 @@ #include "femtobts.h" #include "l1_if.h" +#include "l1_transp.h" #include "l1_fwd.h" static const uint16_t fwd_udp_ports[_NUM_MQ_WRITE] = { |