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

Function in6_control

freebsd/netinet6/in6.c:245–718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243#endif
244
245int
246in6_control(struct socket *so, u_long cmd, caddr_t data,
247 struct ifnet *ifp, struct thread *td)
248{
249 struct in6_ifreq *ifr = (struct in6_ifreq *)data;
250 struct in6_ifaddr *ia = NULL;
251 struct in6_aliasreq *ifra = (struct in6_aliasreq *)data;
252 struct sockaddr_in6 *sa6;
253 int carp_attached = 0;
254 int error;
255 u_long ocmd = cmd;
256
257 /*
258 * Compat to make pre-10.x ifconfig(8) operable.
259 */
260 if (cmd == OSIOCAIFADDR_IN6)
261 cmd = SIOCAIFADDR_IN6;
262
263 switch (cmd) {
264 case SIOCGETSGCNT_IN6:
265 case SIOCGETMIFCNT_IN6:
266 /*
267 * XXX mrt_ioctl has a 3rd, unused, FIB argument in route.c.
268 * We cannot see how that would be needed, so do not adjust the
269 * KPI blindly; more likely should clean up the IPv4 variant.
270 */
271 return (mrt6_ioctl ? mrt6_ioctl(cmd, data) : EOPNOTSUPP);
272 }
273
274 switch (cmd) {
275 case SIOCAADDRCTL_POLICY:
276 case SIOCDADDRCTL_POLICY:
277 if (td != NULL) {
278 error = priv_check(td, PRIV_NETINET_ADDRCTRL6);
279 if (error)
280 return (error);
281 }
282 return (in6_src_ioctl(cmd, data));
283 }
284
285 if (ifp == NULL)
286 return (EOPNOTSUPP);
287
288 switch (cmd) {
289 case SIOCSNDFLUSH_IN6:
290 case SIOCSPFXFLUSH_IN6:
291 case SIOCSRTRFLUSH_IN6:
292 case SIOCSDEFIFACE_IN6:
293 case SIOCSIFINFO_FLAGS:
294 case SIOCSIFINFO_IN6:
295 if (td != NULL) {
296 error = priv_check(td, PRIV_NETINET_ND6);
297 if (error)
298 return (error);
299 }
300 /* FALLTHROUGH */
301 case OSIOCGIFINFO_IN6:
302 case SIOCGIFINFO_IN6:

Callers

nothing calls this directly

Calls 15

in6_src_ioctlFunction · 0.85
nd6_ioctlFunction · 0.85
scope6_ioctlFunction · 0.85
sa6_embedscopeFunction · 0.85
in6_setscopeFunction · 0.85
in6ifa_ifpwithaddrFunction · 0.85
sa6_recoverscopeFunction · 0.85
in6_update_ifaFunction · 0.85
ifa_freeFunction · 0.85
bzeroFunction · 0.85
in6_mask2lenFunction · 0.85
nd6_prefix_lookupFunction · 0.85

Tested by

no test coverage detected