summaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-28 16:12:57 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-28 16:12:57 +0200
commitf15497c1a3befd350f4e40be8d47bc62e49069fe (patch)
tree24b9ae8be90035e7793828bce6c93ae03c8b15cc /openbsc
parent57a9cf279731633f88614eb0b7be8c81bfe8777c (diff)
[GPRS] NS: Don't hand Frame Relay LMI packets into the NS code
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/gprs/gprs_ns_frgre.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/openbsc/src/gprs/gprs_ns_frgre.c b/openbsc/src/gprs/gprs_ns_frgre.c
index e22b0c72..326bd70f 100644
--- a/openbsc/src/gprs/gprs_ns_frgre.c
+++ b/openbsc/src/gprs/gprs_ns_frgre.c
@@ -206,19 +206,29 @@ int gprs_ns_rcvmsg(struct gprs_ns_inst *nsi, struct msgb *msg,
static int handle_nsfrgre_read(struct bsc_fd *bfd)
{
- int error;
+ int rc;
struct sockaddr_in saddr;
struct gprs_ns_inst *nsi = bfd->data;
- struct msgb *msg = read_nsfrgre_msg(bfd, &error, &saddr);
+ struct msgb *msg;
+ uint16_t dlci;
+ msg = read_nsfrgre_msg(bfd, &rc, &saddr);
if (!msg)
- return error;
+ return rc;
- error = gprs_ns_rcvmsg(nsi, msg, &saddr, GPRS_NS_LL_FR_GRE);
+ dlci = ntohs(saddr.sin_port);
+ if (dlci == 0 || dlci == 1023) {
+ LOGP(DNS, LOGL_INFO, "Received FR on LMI DLCI %u - ignoring\n",
+ dlci);
+ rc = 0;
+ goto out;
+ }
+ rc = gprs_ns_rcvmsg(nsi, msg, &saddr, GPRS_NS_LL_FR_GRE);
+out:
msgb_free(msg);
- return error;
+ return rc;
}
static int handle_nsfrgre_write(struct bsc_fd *bfd)