]> git.puffer.fish Git - matthieu/frr.git/commit
pimd: Create pimreg interface when we start any interface config
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 18 Nov 2019 16:43:52 +0000 (11:43 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 18 Nov 2019 20:01:24 +0000 (15:01 -0500)
commita77bc2368bd62501c4a04cfa014f3c2a44f9c196
tree021c0547ae02ca017573badfda8742944d9ec0e9
parent71533999cb8daed43ed01baa92d6b45510203751
pimd: Create pimreg interface when we start any interface config

When you configure interface configuration without explicitly
configuring pim on that interface, we were not creating the pimreg
interface and as such we would crash in an attempted register
since the pimreg device is non-existent.

The crash is this:
==8823== Invalid read of size 8
==8823==    at 0x468614: pim_channel_add_oif (pim_oil.c:392)
==8823==    by 0x46D0F1: pim_register_join (pim_register.c:61)
==8823==    by 0x449AB3: pim_mroute_msg_nocache (pim_mroute.c:242)
==8823==    by 0x449AB3: pim_mroute_msg (pim_mroute.c:661)
==8823==    by 0x449AB3: mroute_read (pim_mroute.c:707)
==8823==    by 0x4FC0676: thread_call (thread.c:1549)
==8823==    by 0x4EF3A2F: frr_run (libfrr.c:1064)
==8823==    by 0x40DCB5: main (pim_main.c:162)
==8823==  Address 0xc8 is not stack'd, malloc'd or (recently) free'd

pim_register_join calls pim_channel_add_oif with:

pim_channel_add_oif(up->channel_oil, pim->regiface,
    PIM_OIF_FLAG_PROTO_PIM);

We just need to make srue pim->regiface exists once we start configuring
pim.

Fixes: #5358
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_cmd.c