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

Function lltable_try_set_entry_addr

freebsd/net/if_llatbl.c:328–359  ·  view source on GitHub ↗

* Tries to update @lle link-level address. * Since update requires AFDATA WLOCK, function * drops @lle lock, acquires AFDATA lock and then acquires * @lle lock to maintain lock order. * * Returns 1 on success. */

Source from the content-addressed store, hash-verified

326 * Returns 1 on success.
327 */
328int
329lltable_try_set_entry_addr(struct ifnet *ifp, struct llentry *lle,
330 const char *linkhdr, size_t linkhdrsize, int lladdr_off)
331{
332
333 /* Perform real LLE update */
334 /* use afdata WLOCK to update fields */
335 LLE_WLOCK_ASSERT(lle);
336 LLE_ADDREF(lle);
337 LLE_WUNLOCK(lle);
338 IF_AFDATA_WLOCK(ifp);
339 LLE_WLOCK(lle);
340
341 /*
342 * Since we droppped LLE lock, other thread might have deleted
343 * this lle. Check and return
344 */
345 if ((lle->la_flags & LLE_DELETED) != 0) {
346 IF_AFDATA_WUNLOCK(ifp);
347 LLE_FREE_LOCKED(lle);
348 return (0);
349 }
350
351 /* Update data */
352 lltable_set_entry_addr(ifp, lle, linkhdr, linkhdrsize, lladdr_off);
353
354 IF_AFDATA_WUNLOCK(ifp);
355
356 LLE_REMREF(lle);
357
358 return (1);
359}
360
361 /*
362 * Helper function used to pre-compute full/partial link-layer

Callers 3

arp_check_update_lleFunction · 0.85
nd6_cache_lladdrFunction · 0.85
nd6_na_inputFunction · 0.85

Calls 1

lltable_set_entry_addrFunction · 0.85

Tested by

no test coverage detected