]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Fix crash with debug and ifp changes
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 30 Oct 2017 23:41:28 +0000 (19:41 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 30 Oct 2017 23:59:18 +0000 (19:59 -0400)
Certain interface flapping events can cause a lookup
that does not find any ifp pointer.  This is only causing
a crash in the `debug pim zebra` command due to only needing
to lookup the interface for it's name.

Modify code to ensure we have a valid pointer.  Follow other
debug statements lead in the same function for what to display
when an interface does not currently exist.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_zebra.c

index bee6521b6c48cb64571a0bd9d2c73b97645f4305..04466258bb3cccc2c71731832db21966a0b050c1 100644 (file)
@@ -599,7 +599,9 @@ void pim_scan_individual_oil(struct channel_oil *c_oil, int in_vif_index)
                zlog_debug(
                        "%s %s: (S,G)=(%s,%s) input interface changed from %s vif_index=%d to %s vif_index=%d",
                        __FILE__, __PRETTY_FUNCTION__, source_str, group_str,
-                       old_iif->name, c_oil->oil.mfcc_parent, new_iif->name,
+                       (old_iif) ? old_iif->name : "<old_iif?>",
+                       c_oil->oil.mfcc_parent,
+                       (new_iif) ? new_iif->name : "<new_iif?>",
                        input_iface_vif_index);
        }
 
@@ -618,7 +620,8 @@ void pim_scan_individual_oil(struct channel_oil *c_oil, int in_vif_index)
                        zlog_debug(
                                "%s %s: (S,G)=(%s,%s) new iif loops to existing oif: %s vif_index=%d",
                                __FILE__, __PRETTY_FUNCTION__, source_str,
-                               group_str, new_iif->name,
+                               group_str,
+                               (new_iif) ? new_iif->name : "<new_iif?>",
                                input_iface_vif_index);
                }
        }