aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/ipaccess
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-06-10 15:56:26 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-10 15:59:45 +0800
commit21e1c0d01c11bdfba2d69a0579745ddabc843035 (patch)
treef84322fe44b51be7ab496367c520eaa7275219c1 /openbsc/src/ipaccess
parente98c635391752ab615efcc0369d200887d953829 (diff)
ipa-proxy: Fix the send routine.. convert port to network order
Diffstat (limited to 'openbsc/src/ipaccess')
-rw-r--r--openbsc/src/ipaccess/ipaccess-proxy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/openbsc/src/ipaccess/ipaccess-proxy.c
index 59895c47c..3f1005c92 100644
--- a/openbsc/src/ipaccess/ipaccess-proxy.c
+++ b/openbsc/src/ipaccess/ipaccess-proxy.c
@@ -1029,7 +1029,7 @@ static void send_ns(int fd, const char *buf, int size, struct in_addr ip, int po
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
- addr.sin_port = port;
+ addr.sin_port = htons(port);
addr.sin_addr = ip;
ret = sendto(fd, buf, size, 0, (struct sockaddr *) &addr, len);
@@ -1062,6 +1062,8 @@ static int gprs_ns_cb(struct bsc_fd *bfd, unsigned int what)
} else if (memcmp(&sock.sin_addr, &bts->bts_addr, sizeof(sock.sin_addr)) == 0) {
LOGP(DINP, LOGL_DEBUG, "GPRS NS msg from BTS.\n");
send_ns(bfd->fd, buf, ret, ipp->gprs_addr, 23000);
+ } else {
+ LOGP(DINP, LOGL_ERROR, "Unknown GPRS source: %s\n", inet_ntoa(sock.sin_addr));
}
return 0;