Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/in6.c
| Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | |||||||||
| #include <netinet6/ip6_var.h> | #include <netinet6/ip6_var.h> | ||||||||
| #include <netinet6/nd6.h> | #include <netinet6/nd6.h> | ||||||||
| #include <netinet6/mld6_var.h> | #include <netinet6/mld6_var.h> | ||||||||
| #include <netinet6/ip6_mroute.h> | #include <netinet6/ip6_mroute.h> | ||||||||
| #include <netinet6/in6_ifattach.h> | #include <netinet6/in6_ifattach.h> | ||||||||
| #include <netinet6/scope6_var.h> | #include <netinet6/scope6_var.h> | ||||||||
| #include <netinet6/in6_fib.h> | #include <netinet6/in6_fib.h> | ||||||||
| #include <netinet6/in6_pcb.h> | #include <netinet6/in6_pcb.h> | ||||||||
| #ifdef MAC | |||||||||
| #include <security/mac/mac_framework.h> | |||||||||
| #endif | |||||||||
| /* | /* | ||||||||
bz: Hide behind ifdef as well. | |||||||||
| * struct in6_ifreq and struct ifreq must be type punnable for common members | * struct in6_ifreq and struct ifreq must be type punnable for common members | ||||||||
| * of ifr_ifru to allow accessors to be shared. | * of ifr_ifru to allow accessors to be shared. | ||||||||
| */ | */ | ||||||||
| _Static_assert(offsetof(struct in6_ifreq, ifr_ifru) == | _Static_assert(offsetof(struct in6_ifreq, ifr_ifru) == | ||||||||
| offsetof(struct ifreq, ifr_ifru), | offsetof(struct ifreq, ifr_ifru), | ||||||||
| "struct in6_ifreq and struct ifreq are not type punnable"); | "struct in6_ifreq and struct ifreq are not type punnable"); | ||||||||
| VNET_DECLARE(int, icmp6_nodeinfo_oldmcprefix); | VNET_DECLARE(int, icmp6_nodeinfo_oldmcprefix); | ||||||||
| ▲ Show 20 Lines • Show All 435 Lines • ▼ Show 20 Lines | if (ia->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME) { | ||||||||
| retlt->ia6t_preferred = ia->ia6_updatetime + | retlt->ia6t_preferred = ia->ia6_updatetime + | ||||||||
| ia->ia6_lifetime.ia6t_pltime; | ia->ia6_lifetime.ia6t_pltime; | ||||||||
| } else | } else | ||||||||
| retlt->ia6t_preferred = maxexpire; | retlt->ia6t_preferred = maxexpire; | ||||||||
| } | } | ||||||||
| break; | break; | ||||||||
| case SIOCAIFADDR_IN6: | case SIOCAIFADDR_IN6: | ||||||||
| #ifdef MAC | |||||||||
| /* Check if a MAC policy disallows setting the IPv6 address. */ | |||||||||
| error = mac_inet6_check_add_addr(cred, &sa6->sin6_addr, ifp); | |||||||||
| if (error != 0) | |||||||||
Done Inline ActionsMove into ifdef block, properly indent the * to be underneath each other. "." at the end. bz: Move into ifdef block, properly indent the * to be underneath each other. "." at the end. | |||||||||
Done Inline Actions
melifaro: | |||||||||
| goto out; | |||||||||
| #endif | |||||||||
| error = in6_addifaddr(ifp, ifra, ia); | error = in6_addifaddr(ifp, ifra, ia); | ||||||||
Done Inline ActionsAgain { } bz: Again { } | |||||||||
| ia = NULL; | ia = NULL; | ||||||||
| break; | break; | ||||||||
| case SIOCDIFADDR_IN6: | case SIOCDIFADDR_IN6: | ||||||||
| in6_purgeifaddr(ia); | in6_purgeifaddr(ia); | ||||||||
| EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, &ia->ia_ifa, | EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, &ia->ia_ifa, | ||||||||
| IFADDR_EVENT_DEL); | IFADDR_EVENT_DEL); | ||||||||
| break; | break; | ||||||||
| ▲ Show 20 Lines • Show All 2,182 Lines • Show Last 20 Lines | |||||||||
Hide behind ifdef as well.