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

Function scope6_addr2default

freebsd/netinet6/scope6.c:287–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287u_int32_t
288scope6_addr2default(struct in6_addr *addr)
289{
290 u_int32_t id;
291
292 /*
293 * special case: The loopback address should be considered as
294 * link-local, but there's no ambiguity in the syntax.
295 */
296 if (IN6_IS_ADDR_LOOPBACK(addr))
297 return (0);
298
299 /*
300 * XXX: 32-bit read is atomic on all our platforms, is it OK
301 * not to lock here?
302 */
303 SCOPE6_LOCK();
304 id = V_sid_default.s6id_list[in6_addrscope(addr)];
305 SCOPE6_UNLOCK();
306 return (id);
307}
308
309/*
310 * Validate the specified scope zone ID in the sin6_scope_id field. If the ID

Callers 1

sa6_embedscopeFunction · 0.85

Calls 1

in6_addrscopeFunction · 0.85

Tested by

no test coverage detected