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

Function rip6_ctlinput

freebsd/netinet6/raw_ip6.c:350–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348}
349
350void
351rip6_ctlinput(int cmd, struct sockaddr *sa, void *d)
352{
353 struct ip6ctlparam *ip6cp = NULL;
354 const struct sockaddr_in6 *sa6_src = NULL;
355 void *cmdarg;
356 struct inpcb *(*notify)(struct inpcb *, int) = in6_rtchange;
357
358 if (sa->sa_family != AF_INET6 ||
359 sa->sa_len != sizeof(struct sockaddr_in6))
360 return;
361
362 if ((unsigned)cmd >= PRC_NCMDS)
363 return;
364 if (PRC_IS_REDIRECT(cmd))
365 notify = in6_rtchange, d = NULL;
366 else if (cmd == PRC_HOSTDEAD)
367 d = NULL;
368 else if (inet6ctlerrmap[cmd] == 0)
369 return;
370
371 /*
372 * If the parameter is from icmp6, decode it.
373 */
374 if (d != NULL) {
375 ip6cp = (struct ip6ctlparam *)d;
376 cmdarg = ip6cp->ip6c_cmdarg;
377 sa6_src = ip6cp->ip6c_src;
378 } else {
379 cmdarg = NULL;
380 sa6_src = &sa6_any;
381 }
382
383 (void) in6_pcbnotify(&V_ripcbinfo, sa, 0,
384 (const struct sockaddr *)sa6_src, 0, cmd, cmdarg, notify);
385}
386
387/*
388 * Generate IPv6 header and pass packet to ip6_output. Tack on options user

Callers

nothing calls this directly

Calls 1

in6_pcbnotifyFunction · 0.85

Tested by

no test coverage detected