X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fvrrp%2Fvrrp_packet.c;h=6b0d4c96c2df68fbccd77293c7cc5bfb20068897;hb=269549491ae6c8d9c35d6b4fa9441ad15e6b82f0;hp=f624b1876c3d8cebacd47865388cb56dc5b3451e;hpb=62a7fe28933b6310b9a4e3a0fab99949587576ac;p=vpp.git diff --git a/src/plugins/vrrp/vrrp_packet.c b/src/plugins/vrrp/vrrp_packet.c index f624b1876c3..6b0d4c96c2d 100644 --- a/src/plugins/vrrp/vrrp_packet.c +++ b/src/plugins/vrrp/vrrp_packet.c @@ -282,6 +282,16 @@ vrrp_adv_send (vrrp_vr_t * vr, int shutdown) if (is_unicast) n_buffers = vec_len (vr->config.peer_addrs); + if (n_buffers < 1) + { + /* A unicast VR will not start without peers added so this should + * not happen. Just avoiding a crash if it happened somehow. + */ + clib_warning ("Unicast VR configuration corrupted for %U", + format_vrrp_vr_key, vr); + return -1; + } + vec_validate (bi, n_buffers - 1); if (vlib_buffer_alloc (vm, bi, n_buffers) != n_buffers) {