xtalk: allow dump_packet() without debug flags
authorOron Peled <oron.peled@xorcom.com>
Thu, 20 Sep 2012 13:38:39 +0000 (13:38 +0000)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Thu, 20 Sep 2012 13:38:39 +0000 (13:38 +0000)
xtalk: dump_packet() may now be used without debug flags by passing
mask == 0.

Origin: Xorcom xtalk (r9302)

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>

git-svn-id: http://svn.astersk.org/svn/dahdi/tools/trunk@10710 17933a7a-c749-41c5-a318-cba88f637d49

xpp/xtalk/debug.c

index eea2d82..4d7393d 100644 (file)
@@ -48,7 +48,7 @@ void dump_packet(int loglevel, int mask, const char *msg, const char *buf, int l
 {
        int     i;
 
-       if(mask & debug_mask) {
+       if(!mask || (mask & debug_mask)) {
                log_function(loglevel, ~0, "%-15s:", msg);
                for(i = 0; i < len; i++)
                        log_function(loglevel, ~0, " %02X", (uint8_t)buf[i]);