On Mon, Jul 24, 2017 at 03:39:12PM +0200, Martin Pieuchot wrote: > On 23/07/17(Sun) 17:23, Florian Obser wrote: > > On Sat, Jul 22, 2017 at 02:05:27PM -0000, Christian Weisgerber wrote: > > > On 2017-07-22, Florian Obser <flor...@openbsd.org> wrote: > > [...] > > # ifconfig vio0 > > vio0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 > > lladdr 52:54:00:c7:09:1b > > llprio 3 > > groups: egress > > media: Ethernet autoselect > > status: active > > inet 192.168.178.178 netmask 0xffffff00 broadcast 192.168.178.255 > > inet6 fe80::5054:ff:fec7:91b%vio0 prefixlen 64 scopeid 0x1 > > inet6 2001:db8::1 prefixlen 64 > > inet6 2001:db8::2 prefixlen 64 > > > > As a work around you could put in inet6 -autoconfprivacy into the > > hostname.if since the privacy address is in the same /64 > > > > Btw. with kernel based slaac this used to work since the > > kernel didn't go through the ioctl path but just fiddled directly with > > the interface and skipped rt_ifa_add() which is failing here. > > Because the kernel based slaac was inserting a single prefix. This was > a limitation of the code. > > The correct fix is to enable MPATH on ramdisk. This is mostly a matter > of changing all the "#ifdef ART" into "#ifndef RADIX" and deal with the > ramdisk grow. >
this probably survived make release on amd64, not 100% sure, I'm going to do the full clean everything and rebuild everything song and dance. seems to fix naddy's problems for me. We can bikeshed over the ifdef change I guess, it was supposed to be mechanical... diff --git arch/alpha/conf/RAMDISKBIG arch/alpha/conf/RAMDISKBIG index 5796dfea8c8..93f0420f21f 100644 --- arch/alpha/conf/RAMDISKBIG +++ arch/alpha/conf/RAMDISKBIG @@ -19,6 +19,7 @@ option TCVERBOSE option FFS option FFS2 option CD9660 +option ART # Allotment Routing Table option INET6 option DEC_3000_500 # Flamingo etc: 3000/[4-9]00* diff --git arch/amd64/conf/RAMDISK_CD arch/amd64/conf/RAMDISK_CD index fac53c56ad2..86db67fd3f9 100644 --- arch/amd64/conf/RAMDISK_CD +++ arch/amd64/conf/RAMDISK_CD @@ -19,6 +19,7 @@ option NFSCLIENT option CD9660 option UDF option MSDOSFS +option ART # Allotment Routing Table option INET6 option CRYPTO diff --git arch/arm64/conf/RAMDISK arch/arm64/conf/RAMDISK index 2a098a94383..56a23e2d285 100644 --- arch/arm64/conf/RAMDISK +++ arch/arm64/conf/RAMDISK @@ -35,6 +35,7 @@ option MINIROOTSIZE=15360 option FFS option FFS2 option MSDOSFS +option ART # Allotment Routing Table option INET6 option EXT2FS option NFSCLIENT diff --git arch/armv7/conf/RAMDISK arch/armv7/conf/RAMDISK index 263c6418b38..73cada972f0 100644 --- arch/armv7/conf/RAMDISK +++ arch/armv7/conf/RAMDISK @@ -19,6 +19,7 @@ option RAMDISK_HOOKS option FFS option FFS2 option MSDOSFS +option ART # Allotment Routing Table option INET6 option EXT2FS option NFSCLIENT diff --git arch/hppa/conf/RAMDISK arch/hppa/conf/RAMDISK index a1c6a439b65..ebb77278717 100644 --- arch/hppa/conf/RAMDISK +++ arch/hppa/conf/RAMDISK @@ -20,6 +20,7 @@ option FFS2 option NFSCLIENT option CD9660 option MSDOSFS +option ART # Allotment Routing Table option INET6 # Support for various CPU types diff --git arch/i386/conf/RAMDISK_CD arch/i386/conf/RAMDISK_CD index a1f1df9377e..69c497abdb6 100644 --- arch/i386/conf/RAMDISK_CD +++ arch/i386/conf/RAMDISK_CD @@ -22,6 +22,7 @@ option NFSCLIENT option CD9660 option UDF option MSDOSFS +option ART # Allotment Routing Table option INET6 option CRYPTO diff --git arch/landisk/conf/RAMDISK arch/landisk/conf/RAMDISK index aec7abdc541..31f408a0e5e 100644 --- arch/landisk/conf/RAMDISK +++ arch/landisk/conf/RAMDISK @@ -19,6 +19,7 @@ option FFS option CD9660 option MSDOSFS option EXT2FS +option ART # Allotment Routing Table option INET6 config bsd root on rd0a swap on rd0b diff --git arch/loongson/conf/RAMDISK arch/loongson/conf/RAMDISK index 887db8ce183..67e4adf82ed 100644 --- arch/loongson/conf/RAMDISK +++ arch/loongson/conf/RAMDISK @@ -22,6 +22,7 @@ option CD9660 option UDF option EXT2FS option MSDOSFS +option ART # Allotment Routing Table option INET6 option CPU_LOONGSON2 diff --git arch/luna88k/conf/RAMDISK arch/luna88k/conf/RAMDISK index be53ca8c2fa..3f4d1d45ba6 100644 --- arch/luna88k/conf/RAMDISK +++ arch/luna88k/conf/RAMDISK @@ -15,6 +15,7 @@ option RAMDISK_HOOKS option SCSITERSE option FFS +option ART # Allotment Routing Table option INET6 config bsd root rd0a swap on rd0b diff --git arch/macppc/conf/RAMDISK arch/macppc/conf/RAMDISK index dbf46ae7f64..752f42b0471 100644 --- arch/macppc/conf/RAMDISK +++ arch/macppc/conf/RAMDISK @@ -20,6 +20,7 @@ option NFSCLIENT option CD9660 option UDF option MSDOSFS +option ART # Allotment Routing Table option INET6 option CRYPTO diff --git arch/octeon/conf/RAMDISK arch/octeon/conf/RAMDISK index e1d0a45e2b8..598cc210a3f 100644 --- arch/octeon/conf/RAMDISK +++ arch/octeon/conf/RAMDISK @@ -22,6 +22,7 @@ option UDF option EXT2FS option MSDOSFS option NFSCLIENT +option ART # Allotment Routing Table option INET6 option CPU_MIPS64R2 diff --git arch/sgi/conf/RAMDISK-IP22 arch/sgi/conf/RAMDISK-IP22 index c44b6163c4c..d659e4f28fa 100644 --- arch/sgi/conf/RAMDISK-IP22 +++ arch/sgi/conf/RAMDISK-IP22 @@ -20,6 +20,7 @@ option PCIVERBOSE option FFS option CD9660 option NFSCLIENT +option ART # Allotment Routing Table option INET6 makeoption LINK_ADDRESS="0xffffffff88800000" diff --git arch/sgi/conf/RAMDISK-IP26 arch/sgi/conf/RAMDISK-IP26 index 492f76366ae..109b324288c 100644 --- arch/sgi/conf/RAMDISK-IP26 +++ arch/sgi/conf/RAMDISK-IP26 @@ -20,6 +20,7 @@ option PCIVERBOSE option FFS option CD9660 option NFSCLIENT +option ART # Allotment Routing Table option INET6 makeoption LINK_ADDRESS="0xa800000008010000" diff --git arch/sgi/conf/RAMDISK-IP27 arch/sgi/conf/RAMDISK-IP27 index 9cba5b5e901..2e24f242bd2 100644 --- arch/sgi/conf/RAMDISK-IP27 +++ arch/sgi/conf/RAMDISK-IP27 @@ -21,6 +21,7 @@ option ONEWIREVERBOSE option FFS option CD9660 option NFSCLIENT +option ART # Allotment Routing Table option INET6 makeoption LINK_ADDRESS="0xa800000000040000" diff --git arch/sgi/conf/RAMDISK-IP28 arch/sgi/conf/RAMDISK-IP28 index a38683752cc..f75558e5367 100644 --- arch/sgi/conf/RAMDISK-IP28 +++ arch/sgi/conf/RAMDISK-IP28 @@ -20,6 +20,7 @@ option EISAVERBOSE option FFS option CD9660 option NFSCLIENT +option ART # Allotment Routing Table option INET6 makeoption LINK_ADDRESS="0xa800000020020000" diff --git arch/sgi/conf/RAMDISK-IP30 arch/sgi/conf/RAMDISK-IP30 index 09c3cebe728..b53aed5d1b7 100644 --- arch/sgi/conf/RAMDISK-IP30 +++ arch/sgi/conf/RAMDISK-IP30 @@ -21,6 +21,7 @@ option ONEWIREVERBOSE option FFS option CD9660 option NFSCLIENT +option ART # Allotment Routing Table option INET6 makeoption LINK_ADDRESS="0xa800000020020000" diff --git arch/sgi/conf/RAMDISK-IP32 arch/sgi/conf/RAMDISK-IP32 index 05760eeee46..1b9496b2bdd 100644 --- arch/sgi/conf/RAMDISK-IP32 +++ arch/sgi/conf/RAMDISK-IP32 @@ -24,6 +24,7 @@ option CD9660 option FFS option FFS2 option NFSCLIENT +option ART # Allotment Routing Table option INET6 option TGT_O2 # O2, O2+ diff --git arch/socppc/conf/RAMDISK arch/socppc/conf/RAMDISK index 74ecaadfca6..6a2a0fa0e8e 100644 --- arch/socppc/conf/RAMDISK +++ arch/socppc/conf/RAMDISK @@ -21,6 +21,7 @@ option NFSCLIENT option CD9660 option UDF option MSDOSFS +option ART # Allotment Routing Table option INET6 config bsd root on rd0a swap on rd0b diff --git arch/sparc64/conf/RAMDISK arch/sparc64/conf/RAMDISK index ac2c87382a6..cebe5af8e4a 100644 --- arch/sparc64/conf/RAMDISK +++ arch/sparc64/conf/RAMDISK @@ -20,6 +20,7 @@ option NFSCLIENT option CD9660 option MSDOSFS option UDF +option ART # Allotment Routing Table option INET6 option CRYPTO diff --git net/route.c net/route.c index f172223e81c..370e4352a23 100644 --- net/route.c +++ net/route.c @@ -269,7 +269,7 @@ rt_match(struct sockaddr *dst, uint32_t *src, int flags, unsigned int tableid) return (rt); } -#ifndef SMALL_KERNEL +#ifdef ART /* * Originated from bridge_hash() in if_bridge.c */ @@ -351,7 +351,7 @@ rtalloc_mpath(struct sockaddr *dst, uint32_t *src, unsigned int rtableid) { return (rt_match(dst, src, RT_RESOLVE, rtableid)); } -#endif /* SMALL_KERNEL */ +#endif /* ART */ /* * Look in the routing table for the best matching entry for @@ -728,7 +728,7 @@ rtrequest_delete(struct rt_addrinfo *info, u_int8_t prio, struct ifnet *ifp, return (ESRCH); } -#ifndef SMALL_KERNEL +#ifdef ART /* * If we got multipath routes, we require users to specify * a matching gateway. @@ -846,7 +846,7 @@ rtrequest(int req, struct rt_addrinfo *info, u_int8_t prio, rt->rt_priority = prio; /* init routing priority */ LIST_INIT(&rt->rt_timer); -#ifndef SMALL_KERNEL +#ifdef ART /* Check the link state if the table supports it. */ if (rtable_mpath_capable(tableid, ndst->sa_family) && !ISSET(rt->rt_flags, RTF_LOCAL) && diff --git net/route.h net/route.h index c7236855315..159bd4655f3 100644 --- net/route.h +++ net/route.h @@ -441,7 +441,7 @@ void rt_timer_timer(void *); int rtisvalid(struct rtentry *); int rt_hash(struct rtentry *, struct sockaddr *, uint32_t *); -#ifdef SMALL_KERNEL +#ifndef ART #define rtalloc_mpath(dst, s, rid) rtalloc((dst), RT_RESOLVE, (rid)) #else struct rtentry *rtalloc_mpath(struct sockaddr *, uint32_t *, u_int); diff --git net/rtable.c net/rtable.c index 07e5f31c5cb..02677ffdd3f 100644 --- net/rtable.c +++ net/rtable.c @@ -483,9 +483,7 @@ int an_match(struct art_node *, struct sockaddr *, int); void rtentry_ref(void *, void *); void rtentry_unref(void *, void *); -#ifndef SMALL_KERNEL void rtable_mpath_insert(struct art_node *, struct rtentry *); -#endif struct srpl_rc rt_rc = SRPL_RC_INITIALIZER(rtentry_ref, rtentry_unref, NULL); @@ -535,9 +533,6 @@ rtable_lookup(unsigned int rtableid, struct sockaddr *dst, goto out; } -#ifdef SMALL_KERNEL - rt = SRPL_FIRST(&sr, &an->an_rtlist); -#else SRPL_FOREACH(rt, &sr, &an->an_rtlist, rt_next) { if (prio != RTP_ANY && (rt->rt_priority & RTP_MASK) != (prio & RTP_MASK)) @@ -550,7 +545,6 @@ rtable_lookup(unsigned int rtableid, struct sockaddr *dst, memcmp(rt->rt_gateway, gateway, gateway->sa_len) == 0) break; } -#endif /* SMALL_KERNEL */ if (rt != NULL) rtref(rt); @@ -569,9 +563,7 @@ rtable_match(unsigned int rtableid, struct sockaddr *dst, uint32_t *src) struct rtentry *rt = NULL; struct srp_ref sr, nsr; uint8_t *addr; -#ifndef SMALL_KERNEL int hash; -#endif /* SMALL_KERNEL */ ar = rtable_get(rtableid, dst->sa_family); if (ar == NULL) @@ -587,7 +579,6 @@ rtable_match(unsigned int rtableid, struct sockaddr *dst, uint32_t *src) rtref(rt); SRPL_LEAVE(&sr); -#ifndef SMALL_KERNEL /* Gateway selection by Hash-Threshold (RFC 2992) */ if ((hash = rt_hash(rt, dst, src)) != -1) { struct rtentry *mrt; @@ -628,7 +619,6 @@ rtable_match(unsigned int rtableid, struct sockaddr *dst, uint32_t *src) } SRPL_LEAVE(&sr); } -#endif /* SMALL_KERNEL */ out: srp_leave(&nsr); return (rt); @@ -639,10 +629,8 @@ rtable_insert(unsigned int rtableid, struct sockaddr *dst, struct sockaddr *mask, struct sockaddr *gateway, uint8_t prio, struct rtentry *rt) { -#ifndef SMALL_KERNEL struct rtentry *mrt; struct srp_ref sr; -#endif /* SMALL_KERNEL */ struct art_root *ar; struct art_node *an, *prev; uint8_t *addr; @@ -662,7 +650,6 @@ rtable_insert(unsigned int rtableid, struct sockaddr *dst, rtref(rt); /* guarantee rtfree won't do anything during insert */ rw_enter_write(&ar->ar_lock); -#ifndef SMALL_KERNEL /* Do not permit exactly the same dst/mask/gw pair. */ an = art_lookup(ar, addr, plen, &sr); srp_leave(&sr); /* an can't go away while we have the lock */ @@ -683,7 +670,6 @@ rtable_insert(unsigned int rtableid, struct sockaddr *dst, } } } -#endif /* SMALL_KERNEL */ an = art_get(dst, plen); if (an == NULL) { @@ -710,7 +696,6 @@ rtable_insert(unsigned int rtableid, struct sockaddr *dst, goto leave; } -#ifndef SMALL_KERNEL an = prev; mrt = SRPL_FIRST_LOCKED(&an->an_rtlist); @@ -737,9 +722,6 @@ rtable_insert(unsigned int rtableid, struct sockaddr *dst, /* Put newly inserted entry at the right place. */ rtable_mpath_insert(an, rt); -#else - error = EEXIST; -#endif /* SMALL_KERNEL */ } leave: rw_exit_write(&ar->ar_lock); @@ -756,10 +738,8 @@ rtable_delete(unsigned int rtableid, struct sockaddr *dst, struct srp_ref sr; uint8_t *addr; int plen; -#ifndef SMALL_KERNEL struct rtentry *mrt; int npaths = 0; -#endif /* SMALL_KERNEL */ int error = 0; ar = rtable_get(rtableid, dst->sa_family); @@ -780,7 +760,6 @@ rtable_delete(unsigned int rtableid, struct sockaddr *dst, goto leave; } -#ifndef SMALL_KERNEL /* * If other multipath route entries are still attached to * this ART node we only have to unlink it. @@ -799,7 +778,6 @@ rtable_delete(unsigned int rtableid, struct sockaddr *dst, goto leave; } -#endif /* SMALL_KERNEL */ if (art_delete(ar, an, addr, plen) == NULL) panic("art_delete failed to find node %p", an); @@ -867,19 +845,16 @@ struct rtentry * rtable_iterate(struct rtentry *rt0) { struct rtentry *rt = NULL; -#ifndef SMALL_KERNEL struct srp_ref sr; rt = SRPL_NEXT(&sr, rt0, rt_next); if (rt != NULL) rtref(rt); SRPL_LEAVE(&sr); -#endif /* SMALL_KERNEL */ rtfree(rt0); return (rt); } -#ifndef SMALL_KERNEL int rtable_mpath_capable(unsigned int rtableid, sa_family_t af) { @@ -969,7 +944,6 @@ rtable_mpath_insert(struct art_node *an, struct rtentry *rt) SRPL_INSERT_HEAD_LOCKED(&rt_rc, &an->an_rtlist, rt, rt_next); } } -#endif /* SMALL_KERNEL */ /* * Returns 1 if ``an'' perfectly matches (``dst'', ``plen''), 0 otherwise. diff --git net/rtsock.c net/rtsock.c index f1fc135f374..09e4531bc7f 100644 --- net/rtsock.c +++ net/rtsock.c @@ -827,7 +827,7 @@ rtm_output(struct rt_msghdr *rtm, struct rtentry **prt, rt = rtable_lookup(tableid, info->rti_info[RTAX_DST], info->rti_info[RTAX_NETMASK], info->rti_info[RTAX_GATEWAY], prio); -#ifndef SMALL_KERNEL +#ifdef ART /* * If we got multipath routes, we require users to specify * a matching gateway. @@ -846,7 +846,7 @@ rtm_output(struct rt_msghdr *rtm, struct rtentry **prt, (rtm->rtm_type == RTM_CHANGE)) { rt = rtable_lookup(tableid, info->rti_info[RTAX_DST], info->rti_info[RTAX_NETMASK], NULL, prio); -#ifndef SMALL_KERNEL +#ifdef ART /* Ensure we don't pick a multipath one. */ if ((rt != NULL) && ISSET(rt->rt_flags, RTF_MPATH)) { rtfree(rt); -- I'm not entirely sure you are real.