aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-10-14 20:59:52 +0200
committerHarald Welte <laforge@gnumonks.org>2017-10-14 20:59:52 +0200
commit08d4fa1da25cf78aec56dbd688ee7960599330ef (patch)
tree90071a667446712adbb7ea142581891e3d7cdaad
parente37f48eaf9c7ed378c774ec97bd3b3d0f303e4a7 (diff)
ggsn/icmpv6: Ensure log lines have PDP context prefix
If something is logged, we want to know to which PDP context (identified by IMSI:NSAPI tuple) it belongs. Change-Id: I8d984fa89bbdc542715d2d6f544bff7fe76250f1
-rw-r--r--ggsn/icmpv6.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/ggsn/icmpv6.c b/ggsn/icmpv6.c
index 11ced24..cabe56f 100644
--- a/ggsn/icmpv6.c
+++ b/ggsn/icmpv6.c
@@ -29,6 +29,8 @@
#include "../lib/syserr.h"
#include "config.h"
+#define LOGPPDP(level, pdp, fmt, args...) LOGPDPX(DICMP6, level, pdp, fmt, ## args)
+
/* 29.061 11.2.1.3.4 IPv6 Router Configuration Variables in GGSN */
#define GGSN_MaxRtrAdvInterval 21600 /* 6 hours */
#define GGSN_MinRtrAdvInterval 16200 /* 4.5 hours */
@@ -192,29 +194,29 @@ int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const struct in6_a
OSMO_ASSERT(member);
if (len < sizeof(*ip6h)) {
- LOGP(DICMP6, LOGL_NOTICE, "Packet too short: %u bytes\n", len);
+ LOGPPDP(LOGL_NOTICE, pdp, "Packet too short: %u bytes\n", len);
return -1;
}
/* we only treat ICMPv6 here */
if (ip6h->ip6_ctlun.ip6_un1.ip6_un1_nxt != IPPROTO_ICMPV6) {
- LOGP(DICMP6, LOGL_DEBUG, "Ignoring non-ICMP to all-routers mcast\n");
+ LOGPPDP(LOGL_DEBUG, pdp, "Ignoring non-ICMP to all-routers mcast\n");
return 0;
}
if (len < sizeof(*ip6h) + sizeof(*ic6h)) {
- LOGP(DICMP6, LOGL_NOTICE, "Short ICMPv6 packet: %s\n", osmo_hexdump(pack, len));
+ LOGPPDP(LOGL_NOTICE, pdp, "Short ICMPv6 packet: %s\n", osmo_hexdump(pack, len));
return -1;
}
switch (ic6h->type) {
case 133: /* router solicitation */
if (ic6h->code != 0) {
- LOGP(DICMP6, LOGL_NOTICE, "ICMPv6 type 133 but code %d\n", ic6h->code);
+ LOGPPDP(LOGL_NOTICE, pdp, "ICMPv6 type 133 but code %d\n", ic6h->code);
return -1;
}
if (!icmpv6_validate_router_solicit(pack, len)) {
- LOGP(DICMP6, LOGL_NOTICE, "Invalid Router Solicitation: %s\n",
+ LOGPPDP(LOGL_NOTICE, pdp, "Invalid Router Solicitation: %s\n",
osmo_hexdump(pack, len));
return -1;
}
@@ -227,7 +229,7 @@ int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const struct in6_a
msgb_free(msg);
break;
default:
- LOGP(DICMP6, LOGL_DEBUG, "Unknown ICMPv6 type %u\n", ic6h->type);
+ LOGPPDP(LOGL_DEBUG, pdp, "Unknown ICMPv6 type %u\n", ic6h->type);
break;
}
return 0;