MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ref_nhgrp_nhops

Function ref_nhgrp_nhops

freebsd/net/route/nhgrp_ctl.c:398–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396}
397
398static bool
399ref_nhgrp_nhops(struct nhgrp_priv *nhg_priv)
400{
401
402 for (int i = 0; i < nhg_priv->nhg_nh_count; i++) {
403 if (nhop_try_ref_object(nhg_priv->nhg_nh_weights[i].nh) != 0)
404 continue;
405
406 /*
407 * Failed to ref the nexthop, b/c it's deleted.
408 * Need to rollback references back.
409 */
410 for (int j = 0; j < i; j++)
411 nhop_free(nhg_priv->nhg_nh_weights[j].nh);
412 return (false);
413 }
414
415 return (true);
416}
417
418static void
419free_nhgrp_nhops(struct nhgrp_priv *nhg_priv)

Callers 1

get_nhgrpFunction · 0.85

Calls 2

nhop_try_ref_objectFunction · 0.85
nhop_freeFunction · 0.85

Tested by

no test coverage detected