NetBSD/sys/sys
ozaki-r 6ea8c2e666 Pull out route lookups from L2 output routines
Route lookups for routes of RTF_GATEWAY were done in L2 output
routines such as ether_output, but they should be done in L3
i.e., before L2 output routines. This change places the lookups
between L3 output routines (say ip_output) and the L2 output
routines.

The change is based on dyoung's patch submitted in the thread:
https://mail-index.netbsd.org/tech-net/2013/02/01/msg003847.html
You can find out detailed investigations by dyoung about the
issue in there.

Note that the change introduces a workaround for MPLS. ether_output
knew that it needs to fill the ethertype of a frame as MPLS,
based on a tag of an original route (rtentry), but now we don't
pass it to ehter_output. So we have to tell that in another way.
We use mtag to do so for now, which introduces some overhead.
We should fix it somehow in the future.

Discussed on tech-kern and tech-net.
2015-06-04 09:19:59 +00:00
..
Makefile Oops -- install <sys/rndio.h> now that ioctls live there. 2015-04-13 21:55:52 +00:00
acct.h
agpio.h
aio.h According to TOG, <aio.h> is a standalone header. 2012-01-07 19:48:19 +00:00
ansi.h Retire varargs.h support. Move machine/stdarg.h logic into MI 2011-07-17 20:54:30 +00:00
aout_mids.h fix mistake in previous, leave spaces for gaps. 2014-12-08 20:51:02 +00:00
ataio.h Rework struct ata_command to support LBA28 and LBA48-protocol commands. 2012-01-24 20:04:07 +00:00
atomic.h Introduce membar_datadep_consumer. 2015-01-08 22:27:17 +00:00
audioio.h Add AUDIO_ENCODING_AC3 encoding type. 2011-09-06 01:16:43 +00:00
bitops.h add __BITMAP_TYPE 2012-12-07 02:27:58 +00:00
blist.h Fix typo ("then" instead of "than") 2013-12-09 09:35:16 +00:00
boot_flag.h
bootblock.h Avoid data abort at src/sys/dev/dkwedge/dkwedge_apple.c:swap_apple_drvr_descriptor() on zaurus. 2014-09-14 17:39:06 +00:00
bswap.h Remove __OPTIMIZE__ requirement to expand the byte swap macros. Back in 2015-03-12 15:28:16 +00:00
buf.h Remove the 'cred' argument from bread(). Remove a now unused var in 2015-03-28 19:24:04 +00:00
bufq.h
bufq_impl.h buf_inorder: 2011-11-02 13:52:34 +00:00
bus.h Add dummy bus_dma(9) typedefs (enabled by __HAVE_NO_BUS_DMA) in <sys/bus.h> 2012-05-07 18:16:38 +00:00
bus_proto.h add BUS_DMA_PREFETCHABLE flag for bus_dmamem_map(), analog to 2013-02-04 13:18:35 +00:00
callback.h
callout.h Add an FMT macro to snprintb the callout flags. 2015-02-07 19:36:42 +00:00
cctr.h
cdbr.h Allow kernel code to access constant databases by moving cdbr(3) and the 2013-12-11 01:24:08 +00:00
cdefs.h add constcond 2015-01-25 20:45:18 +00:00
cdefs_aout.h
cdefs_elf.h Undo the OBJC hack for __weak, it will be done in gnustep-base 2015-05-08 13:58:53 +00:00
cdio.h
chio.h
clock.h Optimize. 2014-11-17 17:11:29 +00:00
clockctl.h
common_ansi.h More "common" includes which use the preprocessor defined macros. 2014-08-19 07:27:31 +00:00
common_int_const.h Add generic versions of machine/int_*.h for compilers providing 2014-07-25 21:43:13 +00:00
common_int_fmtio.h Add generic versions of machine/int_*.h for compilers providing 2014-07-25 21:43:13 +00:00
common_int_limits.h Add generic versions of machine/int_*.h for compilers providing 2014-07-25 21:43:13 +00:00
common_int_mwgwtypes.h Add generic versions of machine/int_*.h for compilers providing 2014-07-25 21:43:13 +00:00
common_int_types.h Add generic versions of machine/int_*.h for compilers providing 2014-07-25 21:43:13 +00:00
common_limits.h Compute u<type>_max by doing 2u<x>*type_max+1u<x>. 2014-08-19 15:46:46 +00:00
common_wchar_limits.h Add common_wchar_limits.h for those compilers that emit 2014-08-18 22:21:39 +00:00
condvar.h
conf.h Add d_discard to struct bdevsw/cdevsw, and the plumbing to access it. 2014-07-25 07:56:14 +00:00
core.h
cprng.h Omit needless include of <sys/fcntl.h> from <sys/cprng.h>. 2015-04-13 15:51:30 +00:00
cpu.h Constify kcpuset_countset() and cpu_index() parameters. 2014-05-19 20:39:23 +00:00
cpu_data.h Change type of cpu_uvm to struct uvm_cpu * 2014-09-05 05:45:34 +00:00
cpufreq.h Bump CPUFREQ_LATENCY_MAX to UINT32_MAX. 2011-10-27 05:13:04 +00:00
cpuio.h Add definitions so that the i386 cpuctl can issue IOC_CPU_UCODE_GET_VERSION 2013-01-05 16:36:38 +00:00
ctype_bits.h Allow use from C++. 2013-04-30 00:42:31 +00:00
ctype_inline.h Fix spelling of feature test macro. 2015-02-24 13:17:27 +00:00
debug.h We don't support KMEM_GUARD nor FREECHECK yet with rump, so disable them 2012-04-15 19:07:40 +00:00
device.h wait for config_mountroot threads to complete before we tell init it 2015-03-06 09:28:15 +00:00
device_if.h
devmon.h
dir.h
dirent.h fix inadequate parens in macro (my fault originally) 2015-02-26 02:05:54 +00:00
dirhash.h Extend generic dirhash to include an empty directory checker based on 2013-07-07 19:31:26 +00:00
disk.h Merge dk_intf and dkdriver interfaces. 2015-05-02 08:00:08 +00:00
disklabel.h We have three sets of DTYPE_ constants in the kernel: 2015-01-02 19:42:05 +00:00
disklabel_acorn.h
disklabel_gpt.h add implementation defined attributes from FreeBSD 2013-11-24 08:17:50 +00:00
disklabel_rdb.h
dkbad.h
dkio.h Implement DIOCGMEDIASIZE and DIOCGSECTORSIZE from FreeBSD. 2014-12-29 18:41:20 +00:00
dkstat.h
domain.h Move INET6 specific in6_if_{up,down}() and in6_if_link_{up,down}() 2015-04-22 19:46:08 +00:00
drvctlio.h
dtrace_bsd.h src is too big these days to tolerate superfluous apostrophes. It's 2014-10-18 08:33:23 +00:00
dvdio.h
endian.h Avoid undefined behaviour in shifts in endian decoding routines. 2014-03-18 14:28:37 +00:00
envsys.h add HYT-221/271/939 humidity/temperature I2C sensor 2014-05-18 11:46:23 +00:00
errno.h Expose the pseudo-errors if _KMEMUSER is defined (as well as _KERNEL). 2013-01-02 18:51:53 +00:00
evcnt.h
event.h make unsigned constants that. 2015-01-14 22:21:00 +00:00
eventvar.h
exec.h remove ep_name, change the last reference to use ep_kname instead. 2014-12-14 23:49:28 +00:00
exec_aout.h Remove some lint 2012-03-17 21:54:12 +00:00
exec_coff.h
exec_ecoff.h
exec_elf.h add struct exec_package; 2015-05-20 04:08:54 +00:00
exec_script.h
extattr.h Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with 2012-03-13 18:40:26 +00:00
extent.h converting extent(9) from malloc(9) to kmem(9) 2012-01-27 18:52:47 +00:00
fcntl.h Remove parameter name from openat prototype. 2013-09-15 10:41:20 +00:00
fd_set.h
fdio.h
featuretest.h comment about ISOC11 2013-04-26 18:29:06 +00:00
file.h Create a per-device state for iscsi(4), effectively making it a cloning 2015-05-30 20:09:47 +00:00
fileassoc.h
filedesc.h Add a posix_spawn syscall, as discussed on tech-kern. 2012-02-11 23:16:15 +00:00
filio.h
flashio.h add flash_addr_t 2011-06-28 20:49:43 +00:00
float_ieee754.h xorg's pixman-arm-neon-asm-bilinear.S wants to include this file, so make 2013-06-18 20:17:19 +00:00
fstrans.h
fstypes.h Remove miscfs/syncfs and 2015-05-06 15:57:07 +00:00
gcq.h
gennameih.awk
gmon.h use explicit cast for RHS of shift operator since semantics change from 2012-03-09 15:38:03 +00:00
gpio.h Remove an unused constant. 2011-11-13 16:56:15 +00:00
hash.h Add explicit casts for (const uint8_t *) 2014-09-05 05:46:15 +00:00
idle.h
ieee754.h All EXT_EXP defines must be conditionized. Back out previous change which 2014-02-01 16:39:52 +00:00
intr.h add pci_intr_distribute(9) for x86. 2015-04-27 06:42:52 +00:00
inttypes.h C++11 no longer requires __STDC_LIMIT_MACROS, __STDC_CONSTANT_MACROS or 2013-04-22 21:26:48 +00:00
ioccom.h provide a macro to symbolically print an ioctl number. 2014-12-10 00:16:05 +00:00
ioctl.h
ioctl_compat.h comment out the entries that are common with termios, and explain that they 2013-07-11 19:17:57 +00:00
iostat.h
ipc.h Use __BEGIN_DECLS / __END_DECLS consistently for _KERNEL part too. 2015-05-19 12:17:53 +00:00
ipi.h Implement ipi_trigger_multi(9); requested by cherry@. 2015-01-18 23:16:35 +00:00
joystick.h
kauth.h C99 section 6.7.2.3 (Tags) Note 3 states that: 2013-03-18 19:35:35 +00:00
kcore.h
kcpuset.h Constify kcpuset_countset() and cpu_index() parameters. 2014-05-19 20:39:23 +00:00
kern_ctf.h
kernel.h Add extern int psratio 2013-07-30 13:14:30 +00:00
kernhist.h fix KERNHIST_DUMP 2014-03-30 15:53:37 +00:00
kgdb.h
kmem.h - Make KMGUARD interrupt-safe. 2012-02-05 03:40:07 +00:00
kobj.h Always provide a meaningful short name for the kobj in the error message, 2011-08-13 21:04:05 +00:00
kobj_impl.h Always provide a meaningful short name for the kobj in the error message, 2011-08-13 21:04:05 +00:00
kprintf.h Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
ksem.h expose ksem_t for fstat(8), and implement stat for future reference. 2012-11-25 01:05:04 +00:00
ksyms.h Rework ksym defines and includes. 2015-05-20 04:37:45 +00:00
kthread.h Remove the unused and all-but-unusable kthread_destroy(). Also makes 2015-04-21 11:10:29 +00:00
ktrace.h include necessary headers 2013-12-09 17:43:58 +00:00
localedef.h Rename fixup to update_global to better reflect the purpose. 2013-08-18 20:03:48 +00:00
lock.h
lockdebug.h Revert change that allowed rw_tryenter(&lock, RW_READER) to recurse 2013-04-27 08:12:34 +00:00
lockf.h
lua.h lua(4): included <sys/param.h> into sys/lua.h 2014-11-30 19:12:59 +00:00
lwp.h Provide struct cpu_info *lwp_getcpu(struct lwp *) inline for <machine/cpu.h> 2015-03-31 01:10:02 +00:00
lwpctl.h
malloc.h Cleanup: 2014-12-27 19:32:57 +00:00
mallocvar.h Cleanup: 2014-12-27 19:32:57 +00:00
mbuf.h Pull out route lookups from L2 output routines 2015-06-04 09:19:59 +00:00
md4.h
md5.h
midiio.h
mman.h defintion -> definition 2014-08-03 19:14:24 +00:00
module.h use __COMPAT so that we get argument expansion. 2015-03-07 03:19:06 +00:00
mount.h Remove miscfs/syncfs and 2015-05-06 15:57:07 +00:00
mqueue.h change printf gcc attribute to __printflike(), requested by joerg. 2011-11-21 04:36:05 +00:00
msg.h More prep: add a xxxfini() routine to each subcomponent so we can 2015-05-13 01:16:15 +00:00
msgbuf.h
mtio.h
mutex.h
namei.h Cull unused INRENAME and INRELOOKUP from callers. 2015-04-21 03:19:03 +00:00
namei.src Cull unused INRENAME and INRELOOKUP from PARAMASK. 2015-04-21 03:18:21 +00:00
null.h
once.h
optstr.h
param.h bump to 7.99.18 for change to nfs_boot_sendrecv 2015-05-21 22:24:24 +00:00
pax.h
pcq.h Add PCQ_MAXLEN constant. 2014-06-09 12:44:06 +00:00
pcu.h pcu(9): 2014-05-16 00:48:41 +00:00
percpu.h
percpu_types.h
physmap.h KMEMUSER -> _KMEMUSER 2013-04-08 01:33:53 +00:00
pipe.h
pmc.h
pmf.h Add PMFE_SPEED_CHANGED 2013-08-06 06:10:57 +00:00
poll.h
pool.h Don't nest structure definitions. 2014-09-05 05:42:50 +00:00
power.h As proposed on tech-net@, introduce a new switch type, PSWITCH_TYPE_RADIO, 2015-01-06 15:39:54 +00:00
proc.h add dtrace syscall glue: 2015-03-07 16:34:55 +00:00
prot.h
protosw.h make connect syscall use sockaddr_big and modify pr_{send,connect} 2015-05-02 17:18:03 +00:00
pserialize.h Add an implementation of passive serialization as described in expired 2011-07-30 17:01:04 +00:00
pset.h Systematically include sys/featuretest.h when _NETBSD_SOURCE is used. 2013-04-27 21:35:24 +00:00
ptrace.h Remove __HAVE_PROCESS_XFPREGS and add the extra parameter for the size 2014-01-04 00:10:02 +00:00
ptree.h Add a ptree_mask_node_p to determine if an item is a mask node, and what 2012-10-06 22:15:09 +00:00
pty.h From Ilia Zykov: 2014-10-15 15:00:03 +00:00
queue.h Indent. 2014-11-19 08:10:01 +00:00
quota.h Add QUOTA_RESTRICT_READONLY, for the nfs quota access code. 2012-01-30 00:56:19 +00:00
quotactl.h Revert the following changes: 2014-06-28 22:27:50 +00:00
radioio.h
radixtree.h add radix_tree_empty_tagged_tree_p, a "tagged" variant of 2011-10-25 14:11:27 +00:00
ras.h
rbtree.h remove bogus const quals 2012-02-17 08:20:55 +00:00
reboot.h
resource.h Add a new resource to limit the number of lwps per user, RLIMIT_NTHR. There 2012-06-09 02:31:14 +00:00
resourcevar.h Don't nest structure definitions. 2014-09-05 05:47:40 +00:00
rmd160.h
rnd.h Move substantive part of rnd_ioctl to kern_rndq.c. 2015-04-14 12:51:30 +00:00
rndio.h Split <sys/rnd.h> into several header files. 2015-04-13 15:39:19 +00:00
rndpool.h Move RND_EXTRACT_{ANY,GOOD} to rndpool.h whose API they are part of. 2015-04-14 13:14:20 +00:00
rndsink.h Rework rndsink(9) abstraction and adapt arc4random(9) and cprng(9). 2013-06-23 02:35:23 +00:00
rndsource.h Release rnd_global.lock while calling an rndsource's callback. 2015-04-21 03:53:07 +00:00
rngtest.h First step of random number subsystem rework described in 2011-11-19 22:51:18 +00:00
rpst.h
rwlock.h
scanio.h
sched.h change printf gcc attribute to __printflike(), requested by joerg. 2011-11-21 04:36:05 +00:00
scsiio.h
sdt.h src is too big these days to tolerate superfluous apostrophes. It's 2014-10-18 08:33:23 +00:00
select.h Remove pollsock(). Since it took only a single socket, it was essentially 2014-04-25 15:52:45 +00:00
selinfo.h
sem.h More prep: add a xxxfini() routine to each subcomponent so we can 2015-05-13 01:16:15 +00:00
sha1.h
sha2.h
shm.h More prep: add a xxxfini() routine to each subcomponent so we can 2015-05-13 01:16:15 +00:00
siginfo.h convert vmem, signals, powerhooks from CIRCLEQ -> TAILQ. 2013-11-22 21:04:11 +00:00
signal.h
signalvar.h sigexit() calls either exit1() or panic() and never returns. Mark it as 2014-05-15 07:11:30 +00:00
sigtypes.h Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3! 2012-02-19 21:05:51 +00:00
sleepq.h make this kmemuser friendly. 2015-02-08 19:39:09 +00:00
socket.h * change pr_bind to accept struct sockaddr * instead of struct mbuf * 2015-04-03 20:01:07 +00:00
socketvar.h change sosend() to accept sockaddr * instead of mbuf * for nam. 2015-05-09 15:22:47 +00:00
sockio.h Add IPv4 address flags IN_IFF_TENTATIVE, IN_IFF_DUPLICATED and 2015-05-02 14:41:32 +00:00
spawn.h Don't nest enum in structures. 2014-09-05 05:46:54 +00:00
specificdata.h
spl.h
spldebug.h
stat.h Change mknodat(2) device argument type from uint32_t to dev_t. 2013-10-17 18:01:11 +00:00
statvfs.h all fsblkcnt_t's are in frsize units 2013-04-05 17:34:27 +00:00
stdarg.h #include <sys/cdefs.h> 2014-08-15 11:58:13 +00:00
stdint.h C++11 no longer requires __STDC_LIMIT_MACROS, __STDC_CONSTANT_MACROS or 2013-04-22 21:26:48 +00:00
swap.h
syncobj.h
syscall.h Regenerate 2015-05-13 02:13:08 +00:00
syscall_stats.h
syscallargs.h Regenerate 2015-05-13 02:13:08 +00:00
syscallvar.h regen 2015-03-07 16:38:49 +00:00
sysctl.h Extend RUMP_USE_CTOR to SYSCTL_SETUP(), similar to what is already 2015-01-04 22:11:40 +00:00
syslimits.h It is MAXNAMLEN, not MAXPATHLEN, that NAME_MAX has to be the same as. 2012-12-07 07:06:39 +00:00
syslog.h Mark #endifs that are far enough away from their corresponding #ifs to 2014-07-20 20:55:17 +00:00
systm.h add dtrace syscall glue: 2015-03-07 16:34:55 +00:00
tape.h
termios.h make all constants that are used in unsigned variables unsigned. 2013-07-11 16:46:06 +00:00
time.h Avoid C99 initializers outside _KERNEL. 2015-05-19 23:35:11 +00:00
timeb.h
timepps.h Extend kernel PPS api with pps_ref_event(). 2013-05-26 18:07:42 +00:00
times.h
timetc.h
timevar.h prototype adjustments for lwp_park, welcome to 6.99.19 2013-03-29 01:09:45 +00:00
timex.h
tls.h
tprintf.h change printf gcc attribute to __printflike(), requested by joerg. 2011-11-21 04:36:05 +00:00
trace.h
tree.h Some splay trees don't use the next method, so mark it as potentially unused 2013-09-14 13:20:45 +00:00
tty.h centralize the tty dialout and callunit macros 2014-11-15 19:17:05 +00:00
ttychars.h
ttycom.h Welcome to NetBSD-6.99.14 2012-10-19 16:49:21 +00:00
ttydefaults.h
ttydev.h spelling in comment 2014-05-21 04:24:40 +00:00
types.h Make ptrdiff_t available in the kernel. 2013-12-12 17:53:03 +00:00
ucontext.h Move CTASSERT a few lines down so as to not collide with the CTASSERT 2013-03-06 18:16:58 +00:00
ucred.h sys/ucred.h does not require sys/param.h any more, only limits.h. 2011-10-12 23:03:36 +00:00
uidinfo.h Add a new resource to limit the number of lwps per user, RLIMIT_NTHR. There 2012-06-09 02:31:14 +00:00
uio.h Forward-declare struct vmspace to reduce dependencies on uvm/uvm_extern.h. 2011-07-27 13:20:07 +00:00
un.h make connect syscall use sockaddr_big and modify pr_{send,connect} 2015-05-02 17:18:03 +00:00
unistd.h Add shm_open(3) and shm_unlink(3) to support POSIX shared memory objects. 2013-12-19 19:11:50 +00:00
unpcb.h
user.h Userspace shouldn't (and doesn't seem to) need machine/pcb.h. 2014-02-19 20:40:40 +00:00
userconf.h Don't use the C preprocessor to configure USERCONF. Instead, either do 2011-05-31 23:28:52 +00:00
userret.h Remove including myself. 2013-04-07 07:54:53 +00:00
utsname.h
uuid.h Make uuidgen(2) generate v4 (random) uuids. 2014-10-04 11:15:44 +00:00
vadvise.h
verified_exec.h
vfs_syscalls.h expose do_open 2014-01-25 02:28:31 +00:00
videoio.h Restore binary compatibility with NetBSD 5 binaries that utilize video(4). 2011-08-13 02:49:06 +00:00
vmem.h make vmem(9) ready to be used early during bootstrap to replace extent(9) 2013-01-29 21:26:24 +00:00
vmem_impl.h convert vmem, signals, powerhooks from CIRCLEQ -> TAILQ. 2013-11-22 21:04:11 +00:00
vmmeter.h
vnode.h Remove miscfs/syncfs and 2015-05-06 15:57:07 +00:00
vnode_if.h regen for good measure (no functional change) 2015-04-20 23:11:27 +00:00
wait.h
wapbl.h Don't nest structure definitions. 2014-09-05 05:42:50 +00:00
wapbl_replay.h
wdog.h
workqueue.h
xattr.h Introduce KERNEL_NAME_MAX = 255, and bump NAME_MAX to 511. This makes 2011-09-27 01:40:32 +00:00
xcall.h Stopgap fix to make rump cooperate with pserialize, may be revisited later. 2013-02-19 09:04:53 +00:00