diff options
-rw-r--r-- | sys/conf/GENERIC | 3 | ||||
-rw-r--r-- | sys/conf/files | 4 | ||||
-rw-r--r-- | sys/net/route.c | 6 | ||||
-rw-r--r-- | sys/net/route.h | 6 | ||||
-rw-r--r-- | sys/net/rtable.c | 154 | ||||
-rw-r--r-- | sys/net/rtable.h | 8 | ||||
-rw-r--r-- | sys/net/rtsock.c | 4 | ||||
-rw-r--r-- | sys/netinet/if_ether.c | 4 |
8 files changed, 14 insertions, 175 deletions
diff --git a/sys/conf/GENERIC b/sys/conf/GENERIC index ba9d79bb6a1..bc01cc9b7dc 100644 --- a/sys/conf/GENERIC +++ b/sys/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.244 2017/05/27 08:02:40 claudio Exp $ +# $OpenBSD: GENERIC,v 1.245 2017/07/30 18:16:14 florian Exp $ # # Machine-independent option; used by all architectures for their # GENERIC kernel @@ -51,7 +51,6 @@ option TCP_ECN # Explicit Congestion Notification for TCP option TCP_SIGNATURE # TCP MD5 Signatures, for BGP routing sessions #option TCP_FACK # Forward Acknowledgements for TCP -option ART # Allotment Routing Table option INET6 # IPv6 option IPSEC # IPsec option PPP_BSDCOMP # PPP BSD compression diff --git a/sys/conf/files b/sys/conf/files index a335c67ef70..feb48595945 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1,4 +1,4 @@ -# $OpenBSD: files,v 1.648 2017/06/28 18:24:02 mikeb Exp $ +# $OpenBSD: files,v 1.649 2017/07/30 18:16:14 florian Exp $ # $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $ # @(#)files.newconf 7.5 (Berkeley) 5/10/93 @@ -761,7 +761,7 @@ file tmpfs/tmpfs_vfsops.c tmpfs file tmpfs/tmpfs_vnops.c tmpfs file tmpfs/tmpfs_specops.c tmpfs file tmpfs/tmpfs_fifoops.c tmpfs & fifo -file net/art.c art +file net/art.c file net/bpf.c bpfilter needs-count file net/bpf_filter.c bpfilter file net/if.c diff --git a/sys/net/route.c b/sys/net/route.c index f0b87a4272e..c4b8a25d87e 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -1,4 +1,4 @@ -/* $OpenBSD: route.c,v 1.362 2017/07/28 09:01:09 mpi Exp $ */ +/* $OpenBSD: route.c,v 1.363 2017/07/30 18:16:14 florian Exp $ */ /* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */ /* @@ -1652,11 +1652,7 @@ rt_plentosa(sa_family_t af, int plen, struct sockaddr_in6 *sa_mask) struct sockaddr * rt_plen2mask(struct rtentry *rt, struct sockaddr_in6 *sa_mask) { -#ifndef ART - return (rt_mask(rt)); -#else return (rt_plentosa(rt_key(rt)->sa_family, rt_plen(rt), sa_mask)); -#endif /* ART */ } #ifdef DDB diff --git a/sys/net/route.h b/sys/net/route.h index fa51f97f41c..29cd5b0c85b 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -1,4 +1,4 @@ -/* $OpenBSD: route.h,v 1.164 2017/07/28 09:01:09 mpi Exp $ */ +/* $OpenBSD: route.h,v 1.165 2017/07/30 18:16:14 florian Exp $ */ /* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */ /* @@ -93,7 +93,7 @@ struct rt_metrics { */ struct rtentry { -#ifndef ART +#ifndef _KERNEL struct radix_node rt_nodes[2]; /* tree glue, and other values */ #else struct sockaddr *rt_dest; /* destination */ @@ -115,7 +115,7 @@ struct rtentry { unsigned int rt_ifidx; /* the answer: interface to use */ unsigned int rt_flags; /* up/down?, host/net */ int rt_refcnt; /* # held references */ -#ifdef ART +#ifdef _KERNEL int rt_plen; /* prefix length */ #endif uint16_t rt_labelid; /* route label ID */ diff --git a/sys/net/rtable.c b/sys/net/rtable.c index 07e5f31c5cb..0f69dbfc62e 100644 --- a/sys/net/rtable.c +++ b/sys/net/rtable.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtable.c,v 1.59 2017/05/11 14:03:19 mpi Exp $ */ +/* $OpenBSD: rtable.c,v 1.60 2017/07/30 18:16:14 florian Exp $ */ /* * Copyright (c) 2014-2016 Martin Pieuchot @@ -325,157 +325,6 @@ rtable_l2set(unsigned int rtableid, unsigned int rdomain, unsigned int loifidx) dmm->value[rtableid] = value; } -#ifndef ART -void -rtable_init_backend(unsigned int keylen) -{ - rn_init(keylen); /* initialize all zeroes, all ones, mask table */ -} - -void * -rtable_alloc(unsigned int rtableid, unsigned int alen, unsigned int off) -{ - struct radix_node_head *rnh = NULL; - - if (rn_inithead((void **)&rnh, off)) { - rnh->rnh_rtableid = rtableid; - } - - return (rnh); -} - -struct rtentry * -rtable_lookup(unsigned int rtableid, struct sockaddr *dst, - struct sockaddr *mask, struct sockaddr *gateway, uint8_t prio) -{ - struct radix_node_head *rnh; - struct radix_node *rn; - struct rtentry *rt; - - rnh = rtable_get(rtableid, dst->sa_family); - if (rnh == NULL) - return (NULL); - - rn = rn_lookup(dst, mask, rnh); - if (rn == NULL || (rn->rn_flags & RNF_ROOT) != 0) - return (NULL); - - rt = ((struct rtentry *)rn); - - rtref(rt); - return (rt); -} - -struct rtentry * -rtable_match(unsigned int rtableid, struct sockaddr *dst, uint32_t *src) -{ - struct radix_node_head *rnh; - struct radix_node *rn; - struct rtentry *rt = NULL; - - rnh = rtable_get(rtableid, dst->sa_family); - if (rnh == NULL) - return (NULL); - - KERNEL_LOCK(); - rn = rn_match(dst, rnh); - if (rn == NULL || (rn->rn_flags & RNF_ROOT) != 0) - goto out; - - rt = ((struct rtentry *)rn); - rtref(rt); -out: - KERNEL_UNLOCK(); - return (rt); -} - -int -rtable_insert(unsigned int rtableid, struct sockaddr *dst, - struct sockaddr *mask, struct sockaddr *gateway, uint8_t prio, - struct rtentry *rt) -{ - struct radix_node_head *rnh; - struct radix_node *rn = (struct radix_node *)rt; - - rnh = rtable_get(rtableid, dst->sa_family); - if (rnh == NULL) - return (EAFNOSUPPORT); - - rn = rn_addroute(dst, mask, rnh, rn, prio); - if (rn == NULL) - return (ESRCH); - - rt = ((struct rtentry *)rn); - rtref(rt); - - return (0); -} - -int -rtable_delete(unsigned int rtableid, struct sockaddr *dst, - struct sockaddr *mask, struct rtentry *rt) -{ - struct radix_node_head *rnh; - struct radix_node *rn = (struct radix_node *)rt; - - rnh = rtable_get(rtableid, dst->sa_family); - if (rnh == NULL) - return (EAFNOSUPPORT); - - rn = rn_delete(dst, mask, rnh, rn); - if (rn == NULL) - return (ESRCH); - - if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT)) - panic("active node flags=%x", rn->rn_flags); - - rt = ((struct rtentry *)rn); - rtfree(rt); - - return (0); -} - -int -rtable_walk(unsigned int rtableid, sa_family_t af, - int (*func)(struct rtentry *, void *, unsigned int), void *arg) -{ - struct radix_node_head *rnh; - int (*f)(struct radix_node *, void *, unsigned int) = (void *)func; - int error; - - rnh = rtable_get(rtableid, af); - if (rnh == NULL) - return (EAFNOSUPPORT); - - while ((error = rn_walktree(rnh, f, arg)) == EAGAIN) - continue; - - return (error); -} - -struct rtentry * -rtable_iterate(struct rtentry *rt0) -{ - rtfree(rt0); - return (NULL); -} - -#ifndef SMALL_KERNEL -int -rtable_mpath_capable(unsigned int rtableid, sa_family_t af) -{ - return (0); -} - -int -rtable_mpath_reprio(unsigned int rtableid, struct sockaddr *dst, - struct sockaddr *mask, uint8_t prio, struct rtentry *rt) -{ - return (0); -} -#endif /* SMALL_KERNEL */ - -#else /* ART */ static inline uint8_t *satoaddr(struct art_root *, struct sockaddr *); @@ -1017,7 +866,6 @@ satoaddr(struct art_root *at, struct sockaddr *sa) { return (((uint8_t *)sa) + at->ar_off); } -#endif /* ART */ /* * Return the prefix length of a mask. diff --git a/sys/net/rtable.h b/sys/net/rtable.h index 0653d348f61..dac6fd2f190 100644 --- a/sys/net/rtable.h +++ b/sys/net/rtable.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rtable.h,v 1.18 2016/11/14 10:32:46 mpi Exp $ */ +/* $OpenBSD: rtable.h,v 1.19 2017/07/30 18:16:14 florian Exp $ */ /* * Copyright (c) 2014-2016 Martin Pieuchot @@ -19,7 +19,7 @@ #ifndef _NET_RTABLE_H_ #define _NET_RTABLE_H_ -#ifndef ART +#ifndef _KERNEL /* * Traditional BSD routing table implementation based on a radix tree. @@ -31,7 +31,7 @@ #define rt_plen(rt) (rtable_satoplen(rt_key(rt)->sa_family, rt_mask(rt))) #define RT_ROOT(rt) ((rt)->rt_nodes[0].rn_flags & RNF_ROOT) -#else /* ART */ +#else /* _KERNEL */ /* * Newer routing table implementation based on ART (Allotment Routing @@ -43,7 +43,7 @@ #define rt_plen(rt) ((rt)->rt_plen) #define RT_ROOT(rt) (0) -#endif /* ART */ +#endif /* _KERNEL */ int rtable_satoplen(sa_family_t, struct sockaddr *); diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 0472366c566..942663381c8 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.243 2017/07/28 09:01:09 mpi Exp $ */ +/* $OpenBSD: rtsock.c,v 1.244 2017/07/30 18:16:14 florian Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -1152,7 +1152,6 @@ route_cleargateway(struct rtentry *rt, void *arg, unsigned int rtableid) int route_arp_conflict(struct rtentry *rt, struct rt_addrinfo *info) { -#ifdef ART int proxy = (info->rti_flags & RTF_ANNOUNCE); if ((info->rti_flags & RTF_LLINFO) == 0 || @@ -1176,7 +1175,6 @@ route_arp_conflict(struct rtentry *rt, struct rt_addrinfo *info) /* No conflict but an entry exist so we need to force mpath. */ info->rti_flags |= RTF_MPATH; -#endif /* ART */ return (0); } diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 49e5d84f525..9625c1fbb52 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ether.c,v 1.229 2017/07/28 09:01:09 mpi Exp $ */ +/* $OpenBSD: if_ether.c,v 1.230 2017/07/30 18:16:14 florian Exp $ */ /* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */ /* @@ -730,13 +730,11 @@ arplookup(struct in_addr *inp, int create, int proxy, u_int tableid) } if (proxy && !ISSET(rt->rt_flags, RTF_ANNOUNCE)) { -#ifdef ART while ((rt = rtable_iterate(rt)) != NULL) { if (ISSET(rt->rt_flags, RTF_ANNOUNCE)) { break; } } -#endif /* ART */ } return (rt); |