Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in.c
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||||||
| #include <netinet/in_var.h> | #include <netinet/in_var.h> | ||||||||
| #include <netinet/in_pcb.h> | #include <netinet/in_pcb.h> | ||||||||
| #include <netinet/ip_var.h> | #include <netinet/ip_var.h> | ||||||||
| #include <netinet/ip_carp.h> | #include <netinet/ip_carp.h> | ||||||||
| #include <netinet/igmp_var.h> | #include <netinet/igmp_var.h> | ||||||||
| #include <netinet/udp.h> | #include <netinet/udp.h> | ||||||||
| #include <netinet/udp_var.h> | #include <netinet/udp_var.h> | ||||||||
| #ifdef MAC | |||||||||
bz: We only need to include this if MAC is defined, so hiding it behind #ifdef will avoid header… | |||||||||
| #include <security/mac/mac_framework.h> | |||||||||
| #endif | |||||||||
| static int in_aifaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); | static int in_aifaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); | ||||||||
| static int in_difaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); | static int in_difaddr_ioctl(u_long, caddr_t, struct ifnet *, struct thread *); | ||||||||
| static void in_socktrim(struct sockaddr_in *); | static void in_socktrim(struct sockaddr_in *); | ||||||||
| static void in_purgemaddrs(struct ifnet *); | static void in_purgemaddrs(struct ifnet *); | ||||||||
| VNET_DEFINE_STATIC(int, nosameprefix); | VNET_DEFINE_STATIC(int, nosameprefix); | ||||||||
| #define V_nosameprefix VNET(nosameprefix) | #define V_nosameprefix VNET(nosameprefix) | ||||||||
| ▲ Show 20 Lines • Show All 284 Lines • ▼ Show 20 Lines | if ((ifp->if_flags & IFF_POINTOPOINT) && | ||||||||
| dstaddr->sin_addr.s_addr == INADDR_ANY)) | dstaddr->sin_addr.s_addr == INADDR_ANY)) | ||||||||
| return (EDESTADDRREQ); | return (EDESTADDRREQ); | ||||||||
| if (vhid > 0 && carp_attach_p == NULL) | if (vhid > 0 && carp_attach_p == NULL) | ||||||||
| return (EPROTONOSUPPORT); | return (EPROTONOSUPPORT); | ||||||||
| /* | /* | ||||||||
| * See whether address already exist. | * See whether address already exist. | ||||||||
| */ | */ | ||||||||
Done Inline Actions
melifaro: | |||||||||
| #ifdef MAC | |||||||||
| /* Check if a MAC policy disallows setting the IPv4 address. */ | |||||||||
Done Inline ActionsDo whitespace /*<space>...<space>*/ still fit on 80 chars? (also for ipv6 and the other files) bz: Do whitespace /*<space>...<space>*/ still fit on 80 chars?
(also for ipv6 and the other files) | |||||||||
| error = mac_inet_check_SIOCAIFADDR(td->td_ucred, | |||||||||
| &addr->sin_addr, ifp); | |||||||||
Done Inline ActionsComments start upper case and use punctuation. Also the comment could move inside the ifdef block. bz: Comments start upper case and use punctuation. Also the comment could move inside the ifdef… | |||||||||
| if (error) | |||||||||
| return (error); | |||||||||
Done Inline ActionsLines should wrap at latest at 80 characters. Tabs are 8 spaces in FreeBSD. Indentation by tab to the same level and four spaces. bz: Lines should wrap at latest at 80 characters. Tabs are 8 spaces in FreeBSD. Indentation by… | |||||||||
| #endif | |||||||||
Done Inline ActionsNo need for { }; removing them will save vertical space (an extra line) bz: No need for { }; removing them will save vertical space (an extra line) | |||||||||
| iaIsFirst = true; | iaIsFirst = true; | ||||||||
| ia = NULL; | ia = NULL; | ||||||||
| NET_EPOCH_ENTER(et); | NET_EPOCH_ENTER(et); | ||||||||
| CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { | CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { | ||||||||
| struct in_ifaddr *it; | struct in_ifaddr *it; | ||||||||
| if (ifa->ifa_addr->sa_family != AF_INET) | if (ifa->ifa_addr->sa_family != AF_INET) | ||||||||
| continue; | continue; | ||||||||
| ▲ Show 20 Lines • Show All 1,135 Lines • Show Last 20 Lines | |||||||||
We only need to include this if MAC is defined, so hiding it behind #ifdef will avoid header dependencies if MAC is not compiled into the kernel.