diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-04-04 09:36:57 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-04-04 14:46:23 +0200 |
commit | de8a76da2f374792594ce03a203b3f30e4889f6f (patch) | |
tree | 12b5e1e59358005c3c522955c08aee4795e4829c /freebsd/sys/net/if.c | |
parent | Enable bridging by default (diff) | |
download | rtems-libbsd-de8a76da2f374792594ce03a203b3f30e4889f6f.tar.bz2 |
Update to FreeBSD head 2017-04-04
Git mirror commit 642b174daddbd0efd9bb5f242c43f4ab4db6869f.
Diffstat (limited to 'freebsd/sys/net/if.c')
-rw-r--r-- | freebsd/sys/net/if.c | 65 |
1 files changed, 49 insertions, 16 deletions
diff --git a/freebsd/sys/net/if.c b/freebsd/sys/net/if.c index 882eee5c..9c98366a 100644 --- a/freebsd/sys/net/if.c +++ b/freebsd/sys/net/if.c @@ -12,7 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -146,7 +146,7 @@ int (*carp_output_p)(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *sa); int (*carp_ioctl_p)(struct ifreq *, u_long, struct thread *); int (*carp_attach_p)(struct ifaddr *, int); -void (*carp_detach_p)(struct ifaddr *); +void (*carp_detach_p)(struct ifaddr *, bool); #endif #ifdef INET int (*carp_iamatch_p)(struct ifaddr *, uint8_t **); @@ -2220,6 +2220,7 @@ void if_down(struct ifnet *ifp) { + EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_DOWN); if_unroute(ifp, IFF_UP, AF_UNSPEC); } @@ -2232,6 +2233,7 @@ if_up(struct ifnet *ifp) { if_route(ifp, IFF_UP, AF_UNSPEC); + EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_UP); } /* @@ -2703,9 +2705,6 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td) return (error); } -/* COMPAT_SVR4 */ -#define OSIOCGIFCONF _IOWR('i', 20, struct ifconf) - #ifdef COMPAT_FREEBSD32 struct ifconf32 { int32_t ifc_len; @@ -2745,7 +2744,6 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) switch (cmd) { case SIOCGIFCONF: - case OSIOCGIFCONF: /* COMPAT_SVR4 */ error = ifconf(cmd, data); CURVNET_RESTORE(); return (error); @@ -3017,15 +3015,6 @@ again: if (prison_if(curthread->td_ucred, sa) != 0) continue; addrs++; - /* COMPAT_SVR4 */ - if (cmd == OSIOCGIFCONF) { - struct osockaddr *osa = - (struct osockaddr *)&ifr.ifr_addr; - ifr.ifr_addr = *sa; - osa->sa_family = sa->sa_family; - sbuf_bcat(sb, &ifr, sizeof(ifr)); - max_len += sizeof(ifr); - } else if (sa->sa_len <= sizeof(*sa)) { ifr.ifr_addr = *sa; sbuf_bcat(sb, &ifr, sizeof(ifr)); @@ -3530,7 +3519,6 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, int len) case IFT_BRIDGE: case IFT_ARCNET: case IFT_IEEE8023ADLAG: - case IFT_IEEE80211: bcopy(lladdr, LLADDR(sdl), len); ifa_free(ifa); break; @@ -4104,6 +4092,51 @@ if_vlancap(if_t ifh) VLAN_CAPABILITIES(ifp); } +int +if_sethwtsomax(if_t ifp, u_int if_hw_tsomax) +{ + + ((struct ifnet *)ifp)->if_hw_tsomax = if_hw_tsomax; + return (0); +} + +int +if_sethwtsomaxsegcount(if_t ifp, u_int if_hw_tsomaxsegcount) +{ + + ((struct ifnet *)ifp)->if_hw_tsomaxsegcount = if_hw_tsomaxsegcount; + return (0); +} + +int +if_sethwtsomaxsegsize(if_t ifp, u_int if_hw_tsomaxsegsize) +{ + + ((struct ifnet *)ifp)->if_hw_tsomaxsegsize = if_hw_tsomaxsegsize; + return (0); +} + +u_int +if_gethwtsomax(if_t ifp) +{ + + return (((struct ifnet *)ifp)->if_hw_tsomax); +} + +u_int +if_gethwtsomaxsegcount(if_t ifp) +{ + + return (((struct ifnet *)ifp)->if_hw_tsomaxsegcount); +} + +u_int +if_gethwtsomaxsegsize(if_t ifp) +{ + + return (((struct ifnet *)ifp)->if_hw_tsomaxsegsize); +} + void if_setinitfn(if_t ifp, void (*init_fn)(void *)) { |