Improve protocol robustness and invoke user callbacks.
[radsecproxy.git] / lib / debug.c
index 485e29a..4544f3c 100644 (file)
 void
 rs_dump_packet (const struct rs_packet *pkt)
 {
-  const RADIUS_PACKET *p = pkt->rpkt;
-  assert(p);
+  const RADIUS_PACKET *p = NULL;
+
+  if (!pkt || !pkt->rpkt)
+    return;
+  p = pkt->rpkt;
 
   fprintf (stderr, "\tCode: %u, Identifier: %u, Lenght: %u\n",
           p->code,
@@ -32,7 +35,7 @@ rs_dump_attr (const struct rs_attr *attr)
 
 #if defined DEBUG
 int
-rs_debug (const char *fmt, ...)
+_rs_debug (const char *fmt, ...)
 {
   int n;
   va_list args;