aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-01-30 16:04:53 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-01-30 22:50:13 +0100
commit134855c45ebb01c83f1d6abcd00e9a12fb960108 (patch)
tree9b3b56abc5279fefb3275a75d352bdb1c5f969c1
parenta4942e65660597e38405cd31b3f2cefc1260799a (diff)
ggsn.c: cb_tun_ind: log dst addr of packet without pdp ctx
-rw-r--r--ggsn/ggsn.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index c7f6376..fed8f73 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -725,6 +725,7 @@ static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len)
struct iphdr *iph = (struct iphdr *)pack;
struct ip6_hdr *ip6h = (struct ip6_hdr *)pack;
struct ippool_t *pool;
+ char straddr[INET6_ADDRSTRLEN];
switch (iph->version) {
case 4:
@@ -755,7 +756,9 @@ static int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len)
DEBUGP(DTUN, "Received packet for APN(%s) from tun %s", apn->cfg.name, tun->devname);
if (ippool_getip(pool, &ipm, &dst)) {
- DEBUGPC(DTUN, " with no PDP contex!!\n");
+ DEBUGPC(DTUN, " with no PDP contex! (%s)\n", iph->version == 4 ?
+ inet_ntop(AF_INET, &iph->saddr, straddr, sizeof(straddr)) :
+ inet_ntop(AF_INET6, &ip6h->ip6_src, straddr, sizeof(straddr)));
return 0;
}
DEBUGPC(DTUN, "\n");