head 1.131; access; symbols netbsd-10-0-RELEASE:1.130 netbsd-10-0-RC6:1.130 netbsd-10-0-RC5:1.130 netbsd-10-0-RC4:1.130 netbsd-10-0-RC3:1.130 netbsd-10-0-RC2:1.130 thorpej-ifq:1.130.0.6 thorpej-ifq-base:1.130 thorpej-altq-separation:1.130.0.4 thorpej-altq-separation-base:1.130 netbsd-10-0-RC1:1.130 netbsd-10:1.130.0.2 netbsd-10-base:1.130 bouyer-sunxi-drm:1.129.0.2 bouyer-sunxi-drm-base:1.129 netbsd-9-3-RELEASE:1.126 thorpej-i2c-spi-conf2:1.128.0.16 thorpej-i2c-spi-conf2-base:1.128 thorpej-futex2:1.128.0.14 thorpej-futex2-base:1.128 thorpej-cfargs2:1.128.0.12 thorpej-cfargs2-base:1.128 cjep_sun2x-base1:1.128 cjep_sun2x:1.128.0.10 cjep_sun2x-base:1.128 cjep_staticlib_x-base1:1.128 netbsd-9-2-RELEASE:1.126 cjep_staticlib_x:1.128.0.8 cjep_staticlib_x-base:1.128 thorpej-i2c-spi-conf:1.128.0.6 thorpej-i2c-spi-conf-base:1.128 thorpej-cfargs:1.128.0.4 thorpej-cfargs-base:1.128 thorpej-futex:1.128.0.2 thorpej-futex-base:1.128 netbsd-9-1-RELEASE:1.126 bouyer-xenpvh-base2:1.127 phil-wifi-20200421:1.126 bouyer-xenpvh-base1:1.126 phil-wifi-20200411:1.126 bouyer-xenpvh:1.126.0.10 bouyer-xenpvh-base:1.126 is-mlppp:1.126.0.8 is-mlppp-base:1.126 phil-wifi-20200406:1.126 netbsd-8-2-RELEASE:1.117.4.5 ad-namecache-base3:1.126 netbsd-9-0-RELEASE:1.126 netbsd-9-0-RC2:1.126 ad-namecache-base2:1.126 ad-namecache-base1:1.126 ad-namecache:1.126.0.6 ad-namecache-base:1.126 netbsd-9-0-RC1:1.126 phil-wifi-20191119:1.126 netbsd-9:1.126.0.4 netbsd-9-base:1.126 phil-wifi-20190609:1.126 netbsd-8-1-RELEASE:1.117.4.5 netbsd-8-1-RC1:1.117.4.5 isaki-audio2:1.126.0.2 isaki-audio2-base:1.126 pgoyette-compat-merge-20190127:1.121.2.3 pgoyette-compat-20190127:1.126 pgoyette-compat-20190118:1.126 pgoyette-compat-1226:1.126 pgoyette-compat-1126:1.126 pgoyette-compat-1020:1.126 pgoyette-compat-0930:1.126 pgoyette-compat-0906:1.126 netbsd-7-2-RELEASE:1.103 pgoyette-compat-0728:1.125 netbsd-8-0-RELEASE:1.117.4.5 phil-wifi:1.125.0.2 phil-wifi-base:1.125 pgoyette-compat-0625:1.125 netbsd-8-0-RC2:1.117.4.5 pgoyette-compat-0521:1.125 pgoyette-compat-0502:1.122 pgoyette-compat-0422:1.122 netbsd-8-0-RC1:1.117.4.4 pgoyette-compat-0415:1.122 pgoyette-compat-0407:1.122 pgoyette-compat-0330:1.122 pgoyette-compat-0322:1.122 pgoyette-compat-0315:1.122 netbsd-7-1-2-RELEASE:1.103 pgoyette-compat:1.121.0.2 pgoyette-compat-base:1.121 netbsd-7-1-1-RELEASE:1.103 tls-maxphys-base-20171202:1.119 matt-nb8-mediatek:1.117.4.2.0.2 matt-nb8-mediatek-base:1.117.4.2 nick-nhusb-base-20170825:1.117 perseant-stdc-iso10646:1.117.0.6 perseant-stdc-iso10646-base:1.117 netbsd-8:1.117.0.4 netbsd-8-base:1.117 prg-localcount2-base3:1.117 prg-localcount2-base2:1.117 prg-localcount2-base1:1.117 prg-localcount2:1.117.0.2 prg-localcount2-base:1.117 pgoyette-localcount-20170426:1.117 bouyer-socketcan-base1:1.117 jdolecek-ncq:1.116.0.2 jdolecek-ncq-base:1.116 pgoyette-localcount-20170320:1.116 netbsd-7-1:1.103.0.10 netbsd-7-1-RELEASE:1.103 netbsd-7-1-RC2:1.103 nick-nhusb-base-20170204:1.114 netbsd-7-nhusb-base-20170116:1.103 bouyer-socketcan:1.114.0.2 bouyer-socketcan-base:1.114 pgoyette-localcount-20170107:1.114 netbsd-7-1-RC1:1.103 nick-nhusb-base-20161204:1.113 pgoyette-localcount-20161104:1.113 netbsd-7-0-2-RELEASE:1.103 nick-nhusb-base-20161004:1.113 localcount-20160914:1.113 netbsd-7-nhusb:1.103.0.8 netbsd-7-nhusb-base:1.103 pgoyette-localcount-20160806:1.113 pgoyette-localcount-20160726:1.113 pgoyette-localcount:1.113.0.2 pgoyette-localcount-base:1.113 nick-nhusb-base-20160907:1.113 nick-nhusb-base-20160529:1.112 netbsd-7-0-1-RELEASE:1.103 nick-nhusb-base-20160422:1.111 nick-nhusb-base-20160319:1.110 nick-nhusb-base-20151226:1.107 netbsd-7-0:1.103.0.6 netbsd-7-0-RELEASE:1.103 nick-nhusb-base-20150921:1.106 netbsd-7-0-RC3:1.103 netbsd-7-0-RC2:1.103 netbsd-7-0-RC1:1.103 nick-nhusb-base-20150606:1.105 nick-nhusb-base-20150406:1.104 nick-nhusb:1.103.0.4 nick-nhusb-base:1.103 netbsd-5-2-3-RELEASE:1.82.12.1 netbsd-5-1-5-RELEASE:1.82 netbsd-6-0-6-RELEASE:1.95.6.1 netbsd-6-1-5-RELEASE:1.95.8.1 netbsd-7:1.103.0.2 netbsd-7-base:1.103 yamt-pagecache-base9:1.100 yamt-pagecache-tag8:1.93.2.2 netbsd-6-1-4-RELEASE:1.95.8.1 netbsd-6-0-5-RELEASE:1.95.6.1 tls-earlyentropy:1.100.0.2 tls-earlyentropy-base:1.103 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.100 riastradh-drm2-base3:1.100 netbsd-6-1-3-RELEASE:1.95.8.1 netbsd-6-0-4-RELEASE:1.95.6.1 netbsd-5-2-2-RELEASE:1.82.12.1 netbsd-5-1-4-RELEASE:1.82 netbsd-6-1-2-RELEASE:1.95.8.1 netbsd-6-0-3-RELEASE:1.95.6.1 netbsd-5-2-1-RELEASE:1.82.12.1 netbsd-5-1-3-RELEASE:1.82 rmind-smpnet-nbase:1.101 netbsd-6-1-1-RELEASE:1.95.8.1 riastradh-drm2-base2:1.99 riastradh-drm2-base1:1.99 riastradh-drm2:1.99.0.4 riastradh-drm2-base:1.99 rmind-smpnet:1.99.0.2 rmind-smpnet-base:1.101 netbsd-6-1:1.95.0.8 netbsd-6-0-2-RELEASE:1.95 netbsd-6-1-RELEASE:1.95 khorben-n900:1.98.0.4 netbsd-6-1-RC4:1.95 netbsd-6-1-RC3:1.95 agc-symver:1.98.0.2 agc-symver-base:1.98 netbsd-6-1-RC2:1.95 netbsd-6-1-RC1:1.95 yamt-pagecache-base8:1.97 netbsd-5-2:1.82.12.1.0.4 netbsd-6-0-1-RELEASE:1.95 yamt-pagecache-base7:1.97 netbsd-5-2-RELEASE:1.82.12.1 netbsd-5-2-RC1:1.82.12.1 matt-nb6-plus-nbase:1.95 yamt-pagecache-base6:1.97 netbsd-6-0:1.95.0.6 netbsd-6-0-RELEASE:1.95 netbsd-6-0-RC2:1.95 tls-maxphys:1.97.0.2 tls-maxphys-base:1.103 matt-nb6-plus:1.95.0.4 matt-nb6-plus-base:1.95 netbsd-6-0-RC1:1.95 jmcneill-usbmp-base10:1.96 yamt-pagecache-base5:1.96 jmcneill-usbmp-base9:1.96 yamt-pagecache-base4:1.96 jmcneill-usbmp-base8:1.96 jmcneill-usbmp-base7:1.95 jmcneill-usbmp-base6:1.95 jmcneill-usbmp-base5:1.95 jmcneill-usbmp-base4:1.95 jmcneill-usbmp-base3:1.95 jmcneill-usbmp-pre-base2:1.93 jmcneill-usbmp-base2:1.95 netbsd-6:1.95.0.2 netbsd-6-base:1.95 netbsd-5-1-2-RELEASE:1.82 netbsd-5-1-1-RELEASE:1.82 jmcneill-usbmp:1.93.0.6 jmcneill-usbmp-base:1.93 jmcneill-audiomp3:1.93.0.4 jmcneill-audiomp3-base:1.93 yamt-pagecache-base3:1.93 yamt-pagecache-base2:1.93 yamt-pagecache:1.93.0.2 yamt-pagecache-base:1.93 rmind-uvmplock-nbase:1.92 cherry-xenmp:1.92.0.2 cherry-xenmp-base:1.92 bouyer-quota2-nbase:1.89 bouyer-quota2:1.89.0.4 bouyer-quota2-base:1.89 jruoho-x86intr:1.89.0.2 jruoho-x86intr-base:1.89 matt-mips64-premerge-20101231:1.89 matt-nb5-mips64-premerge-20101231:1.82 matt-nb5-pq3:1.82.12.1.0.2 matt-nb5-pq3-base:1.82.12.1 netbsd-5-1:1.82.0.18 netbsd-5-1-RELEASE:1.82 uebayasi-xip-base4:1.89 uebayasi-xip-base3:1.89 yamt-nfs-mp-base11:1.89 netbsd-5-1-RC4:1.82 matt-nb5-mips64-k15:1.82 uebayasi-xip-base2:1.88 yamt-nfs-mp-base10:1.88 netbsd-5-1-RC3:1.82 netbsd-5-1-RC2:1.82 uebayasi-xip-base1:1.88 netbsd-5-1-RC1:1.82 rmind-uvmplock:1.88.0.4 rmind-uvmplock-base:1.92 yamt-nfs-mp-base9:1.88 uebayasi-xip:1.88.0.2 uebayasi-xip-base:1.88 netbsd-5-0-2-RELEASE:1.82 matt-nb5-mips64-premerge-20091211:1.82 matt-premerge-20091211:1.87 yamt-nfs-mp-base8:1.87 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.82 matt-nb4-mips64-k7-u2a-k9b:1.82 matt-nb5-mips64-u1-k1-k5:1.82 yamt-nfs-mp-base7:1.84 matt-nb5-mips64:1.82.0.16 netbsd-5-0-1-RELEASE:1.82 jymxensuspend-base:1.84 yamt-nfs-mp-base6:1.84 yamt-nfs-mp-base5:1.84 yamt-nfs-mp-base4:1.84 jym-xensuspend-nbase:1.87 yamt-nfs-mp-base3:1.84 nick-hppapmap-base4:1.84 nick-hppapmap-base3:1.84 netbsd-5-0:1.82.0.14 netbsd-5-0-RELEASE:1.82 netbsd-5-0-RC4:1.82 netbsd-5-0-RC3:1.82 nick-hppapmap-base2:1.83 netbsd-5-0-RC2:1.82 jym-xensuspend:1.83.0.4 jym-xensuspend-base:1.84 netbsd-5-0-RC1:1.82 haad-dm-base2:1.83 haad-nbase2:1.83 ad-audiomp2:1.83.0.2 ad-audiomp2-base:1.83 netbsd-5:1.82.0.12 netbsd-5-base:1.82 nick-hppapmap:1.82.0.10 nick-hppapmap-base:1.84 matt-mips64-base2:1.82 matt-mips64:1.77.0.10 haad-dm-base1:1.82 wrstuden-revivesa-base-4:1.82 netbsd-4-0-1-RELEASE:1.68.2.1 wrstuden-revivesa-base-3:1.82 wrstuden-revivesa-base-2:1.82 wrstuden-fixsa-newbase:1.68.2.1 nick-csl-alignment-base5:1.78 haad-dm:1.82.0.8 haad-dm-base:1.83 wrstuden-revivesa-base-1:1.82 simonb-wapbl-nbase:1.82 yamt-pf42-base4:1.82 simonb-wapbl:1.82.0.6 simonb-wapbl-base:1.82 yamt-pf42-base3:1.82 hpcarm-cleanup-nbase:1.82 yamt-pf42-baseX:1.80 yamt-pf42-base2:1.82 yamt-nfs-mp-base2:1.82 wrstuden-revivesa:1.82.0.4 wrstuden-revivesa-base:1.82 yamt-nfs-mp:1.82.0.2 yamt-nfs-mp-base:1.82 yamt-pf42:1.80.0.2 yamt-pf42-base:1.80 ad-socklock-base1:1.79 yamt-lazymbuf-base15:1.79 yamt-lazymbuf-base14:1.79 keiichi-mipv6-nbase:1.79 mjf-devfs2:1.79.0.20 mjf-devfs2-base:1.83 nick-net80211-sync:1.79.0.18 nick-net80211-sync-base:1.79 keiichi-mipv6:1.79.0.16 keiichi-mipv6-base:1.79 bouyer-xeni386-merge1:1.79 matt-armv6-prevmlocking:1.77.8.1 wrstuden-fixsa-base-1:1.68.2.1 vmlocking2-base3:1.79 netbsd-4-0:1.68.2.1.0.4 netbsd-4-0-RELEASE:1.68.2.1 bouyer-xeni386-nbase:1.79 yamt-kmem-base3:1.79 cube-autoconf:1.79.0.14 cube-autoconf-base:1.79 yamt-kmem-base2:1.79 bouyer-xeni386:1.79.0.12 bouyer-xeni386-base:1.79 yamt-kmem:1.79.0.10 yamt-kmem-base:1.79 vmlocking2-base2:1.79 reinoud-bufcleanup-nbase:1.79 vmlocking2:1.79.0.8 vmlocking2-base1:1.79 netbsd-4-0-RC5:1.68.2.1 matt-nb4-arm:1.68.2.1.0.2 matt-nb4-arm-base:1.68.2.1 matt-armv6-nbase:1.79 jmcneill-base:1.79 netbsd-4-0-RC4:1.68.2.1 mjf-devfs:1.79.0.6 mjf-devfs-base:1.79 bouyer-xenamd64-base2:1.79 vmlocking-nbase:1.79 yamt-x86pmap-base4:1.79 bouyer-xenamd64:1.79.0.4 bouyer-xenamd64-base:1.79 netbsd-4-0-RC3:1.68.2.1 yamt-x86pmap-base3:1.79 yamt-x86pmap-base2:1.79 netbsd-4-0-RC2:1.68.2.1 yamt-x86pmap:1.79.0.2 yamt-x86pmap-base:1.79 netbsd-4-0-RC1:1.68.2.1 matt-armv6:1.77.0.8 matt-armv6-base:1.79 matt-mips64-base:1.77 jmcneill-pm:1.77.0.6 jmcneill-pm-base:1.79 hpcarm-cleanup:1.77.0.4 hpcarm-cleanup-base:1.79 nick-csl-alignment:1.77.0.2 nick-csl-alignment-base:1.77 netbsd-3-1-1-RELEASE:1.58.6.1 netbsd-3-0-3-RELEASE:1.58.6.1 yamt-idlelwp-base8:1.77 wrstuden-fixsa:1.68.0.4 wrstuden-fixsa-base:1.68.2.1 thorpej-atomic:1.75.0.8 thorpej-atomic-base:1.75 reinoud-bufcleanup:1.75.0.6 reinoud-bufcleanup-base:1.79 mjf-ufs-trans:1.75.0.4 mjf-ufs-trans-base:1.77 vmlocking:1.75.0.2 vmlocking-base:1.79 ad-audiomp:1.72.0.2 ad-audiomp-base:1.72 yamt-idlelwp:1.70.0.2 post-newlock2-merge:1.69 newlock2-nbase:1.69 yamt-splraiseipl-base5:1.69 yamt-splraiseipl-base4:1.69 yamt-splraiseipl-base3:1.69 abandoned-netbsd-4-base:1.63 abandoned-netbsd-4:1.63.0.6 netbsd-3-1:1.58.6.1.0.4 netbsd-3-1-RELEASE:1.58.6.1 netbsd-3-0-2-RELEASE:1.58.6.1 yamt-splraiseipl-base2:1.67 netbsd-3-1-RC4:1.58.6.1 yamt-splraiseipl:1.66.0.4 yamt-splraiseipl-base:1.66 netbsd-3-1-RC3:1.58.6.1 yamt-pdpolicy-base9:1.66 newlock2:1.66.0.2 newlock2-base:1.69 yamt-pdpolicy-base8:1.66 netbsd-3-1-RC2:1.58.6.1 netbsd-3-1-RC1:1.58.6.1 yamt-pdpolicy-base7:1.63 netbsd-4:1.68.0.2 netbsd-4-base:1.68 yamt-pdpolicy-base6:1.63 chap-midi-nbase:1.63 netbsd-3-0-1-RELEASE:1.58.6.1 gdamore-uart:1.63.0.4 gdamore-uart-base:1.63 simonb-timcounters-final:1.61.6.2 yamt-pdpolicy-base5:1.63 chap-midi:1.63.0.2 chap-midi-base:1.63 yamt-pdpolicy-base4:1.62 yamt-pdpolicy-base3:1.62 peter-altq-base:1.62 peter-altq:1.62.0.4 yamt-pdpolicy-base2:1.62 elad-kernelauth-base:1.62 elad-kernelauth:1.62.0.2 yamt-pdpolicy:1.61.0.8 yamt-pdpolicy-base:1.61 yamt-uio_vmspace-base5:1.61 simonb-timecounters:1.61.0.6 simonb-timecounters-base:1.63 rpaulo-netinet-merge-pcb:1.61.0.4 rpaulo-netinet-merge-pcb-base:1.66 yamt-uio_vmspace:1.61.0.2 netbsd-3-0:1.58.6.1.0.2 netbsd-3-0-RELEASE:1.58.6.1 netbsd-3-0-RC6:1.58.6.1 yamt-readahead-base3:1.60 netbsd-3-0-RC5:1.58.6.1 netbsd-3-0-RC4:1.58.6.1 netbsd-3-0-RC3:1.58.6.1 yamt-readahead-base2:1.60 netbsd-3-0-RC2:1.58.6.1 yamt-readahead-pervnode:1.60 yamt-readahead-perfile:1.60 yamt-readahead:1.60.0.6 yamt-readahead-base:1.60 netbsd-3-0-RC1:1.58.6.1 yamt-vop-base3:1.60 netbsd-2-0-3-RELEASE:1.56 netbsd-2-1:1.56.0.6 yamt-vop-base2:1.60 thorpej-vnode-attr:1.60.0.4 thorpej-vnode-attr-base:1.60 netbsd-2-1-RELEASE:1.56 yamt-vop:1.60.0.2 yamt-vop-base:1.60 netbsd-2-1-RC6:1.56 netbsd-2-1-RC5:1.56 netbsd-2-1-RC4:1.56 netbsd-2-1-RC3:1.56 netbsd-2-1-RC2:1.56 netbsd-2-1-RC1:1.56 yamt-lazymbuf:1.59.0.2 yamt-km-base4:1.58 netbsd-2-0-2-RELEASE:1.56 yamt-km-base3:1.58 netbsd-3:1.58.0.6 netbsd-3-base:1.58 yamt-km-base2:1.58 yamt-km:1.58.0.2 yamt-km-base:1.58 kent-audio2:1.57.0.4 kent-audio2-base:1.58 netbsd-2-0-1-RELEASE:1.56 kent-audio1-beforemerge:1.57 netbsd-2:1.56.0.4 netbsd-2-base:1.56 kent-audio1:1.57.0.2 kent-audio1-base:1.57 netbsd-2-0-RELEASE:1.56 netbsd-2-0-RC5:1.56 netbsd-2-0-RC4:1.56 netbsd-2-0-RC3:1.56 netbsd-2-0-RC2:1.56 netbsd-2-0-RC1:1.56 netbsd-2-0:1.56.0.2 netbsd-2-0-base:1.56 netbsd-1-6-PATCH002-RELEASE:1.39.6.3 netbsd-1-6-PATCH002:1.39.6.3 netbsd-1-6-PATCH002-RC4:1.39.6.3 netbsd-1-6-PATCH002-RC3:1.39.6.3 netbsd-1-6-PATCH002-RC2:1.39.6.3 netbsd-1-6-PATCH002-RC1:1.39.6.3 ktrace-lwp:1.47.0.2 ktrace-lwp-base:1.60 netbsd-1-6-PATCH001:1.39.6.2 netbsd-1-6-PATCH001-RELEASE:1.39.6.2 netbsd-1-6-PATCH001-RC3:1.39.6.2 netbsd-1-6-PATCH001-RC2:1.39.6.2 netbsd-1-6-PATCH001-RC1:1.39.6.2 nathanw_sa_end:1.28.2.7 nathanw_sa_before_merge:1.46 fvdl_fs64_base:1.46 gmcgarry_ctxsw:1.46.0.4 gmcgarry_ctxsw_base:1.46 gmcgarry_ucred:1.46.0.2 gmcgarry_ucred_base:1.46 nathanw_sa_base:1.46 kqueue-aftermerge:1.45 kqueue-beforemerge:1.45 netbsd-1-6-RELEASE:1.39.6.1 netbsd-1-6-RC3:1.39.6.1 netbsd-1-6-RC2:1.39.6.1 netbsd-1-6-RC1:1.39 netbsd-1-6:1.39.0.6 netbsd-1-6-base:1.39 gehenna-devsw:1.39.0.4 gehenna-devsw-base:1.45 netbsd-1-5-PATCH003:1.17.4.3 eeh-devprop:1.39.0.2 eeh-devprop-base:1.39 newlock:1.38.0.4 newlock-base:1.38 ifpoll-base:1.38 thorpej-mips-cache:1.31.0.2 thorpej-mips-cache-base:1.33 thorpej-devvp-base3:1.29 thorpej-devvp-base2:1.29 post-chs-ubcperf:1.29 pre-chs-ubcperf:1.29 thorpej-devvp:1.29.0.4 thorpej-devvp-base:1.29 netbsd-1-5-PATCH002:1.17.4.3 kqueue:1.29.0.2 kqueue-base:1.45 netbsd-1-5-PATCH001:1.17.4.3 thorpej_scsipi_beforemerge:1.29 nathanw_sa:1.28.0.2 thorpej_scsipi_nbase:1.29 netbsd-1-5-RELEASE:1.17.4.2 netbsd-1-5-BETA2:1.17.4.2 netbsd-1-5-BETA:1.17.4.2 netbsd-1-5-ALPHA2:1.17 netbsd-1-5:1.17.0.4 netbsd-1-5-base:1.17 minoura-xpg4dl-base:1.17 minoura-xpg4dl:1.17.0.2 chs-ubc2-newbase:1.13 wrstuden-devbsize-19991221:1.9 wrstuden-devbsize:1.8.0.8 wrstuden-devbsize-base:1.9 kame_141_19991130:1.1.2.3 comdex-fall-1999:1.8.0.6 comdex-fall-1999-base:1.8 fvdl-softdep:1.8.0.4 fvdl-softdep-base:1.8 thorpej_scsipi:1.8.0.2 thorpej_scsipi_base:1.29 kame_14_19990705:1.1.2.2 chs-ubc2-base:1.8 chs-ubc2:1.2.0.2 kame_14_19990628:1.1.2.1 kame:1.1.0.2; locks; strict; comment @ * @; 1.131 date 2024.02.09.22.08.37; author andvar; state Exp; branches; next 1.130; commitid 3HXU4I4WgbZi7OXE; 1.130 date 2022.10.24.01.54.19; author knakahara; state Exp; branches; next 1.129; commitid Sn72LfHcHzhVBUYD; 1.129 date 2022.09.03.02.53.18; author thorpej; state Exp; branches; next 1.128; commitid 6tHd0yJj3r6OzmSD; 1.128 date 2020.06.12.11.04.45; author roy; state Exp; branches; next 1.127; commitid OaWPbwiyPUMQnVbC; 1.127 date 2020.04.24.17.36.55; author jakllsch; state Exp; branches; next 1.126; commitid H2gbpDUK4FUk9F5C; 1.126 date 2018.08.14.14.49.14; author maxv; state Exp; branches 1.126.10.1; next 1.125; commitid pqOYYjSgJjLB86OA; 1.125 date 2018.05.11.09.43.59; author roy; state Exp; branches 1.125.2.1; next 1.124; commitid AxrIe6QUriAsuRBA; 1.124 date 2018.05.03.07.13.48; author maxv; state Exp; branches; next 1.123; commitid lAWZaUvfWbrPVOAA; 1.123 date 2018.05.03.06.41.30; author maxv; state Exp; branches; next 1.122; commitid gvOaNGpIoQC1LOAA; 1.122 date 2018.03.15.08.15.21; author maxv; state Exp; branches; next 1.121; commitid 5qsY2kYQNZ9KQwuA; 1.121 date 2018.02.07.10.52.20; author maxv; state Exp; branches 1.121.2.1; next 1.120; commitid W3WXm43jMYCuSUpA; 1.120 date 2018.02.07.10.21.59; author maxv; state Exp; branches; next 1.119; commitid FrX3MxgleXiNHUpA; 1.119 date 2017.09.27.10.05.05; author ozaki-r; state Exp; branches; next 1.118; commitid Yh1n7clvIKjmTO8A; 1.118 date 2017.09.21.07.15.35; author ozaki-r; state Exp; branches; next 1.117; commitid 5HpPzB700oub928A; 1.117 date 2017.04.14.02.43.28; author ozaki-r; state Exp; branches 1.117.4.1; next 1.116; 1.116 date 2017.02.16.08.12.44; author knakahara; state Exp; branches; next 1.115; 1.115 date 2017.02.13.07.18.20; author ozaki-r; state Exp; branches; next 1.114; 1.114 date 2016.12.13.08.29.03; author ozaki-r; state Exp; branches 1.114.2.1; next 1.113; 1.113 date 2016.07.06.10.49.49; author ozaki-r; state Exp; branches 1.113.2.1; next 1.112; 1.112 date 2016.04.26.08.44.45; author ozaki-r; state Exp; branches; next 1.111; 1.111 date 2016.04.11.08.56.16; author ozaki-r; state Exp; branches; next 1.110; 1.110 date 2016.01.21.15.41.30; author riastradh; state Exp; branches; next 1.109; 1.109 date 2016.01.21.15.27.48; author riastradh; state Exp; branches; next 1.108; 1.108 date 2016.01.20.21.44.00; author riastradh; state Exp; branches; next 1.107; 1.107 date 2015.10.13.21.28.35; author rjs; state Exp; branches; next 1.106; 1.106 date 2015.08.24.22.21.27; author pooka; state Exp; branches; next 1.105; 1.105 date 2015.04.22.19.46.08; author roy; state Exp; branches; next 1.104; 1.104 date 2015.02.10.19.11.52; author rjs; state Exp; branches; next 1.103; 1.103 date 2014.06.05.23.48.16; author rmind; state Exp; branches 1.103.4.1; next 1.102; 1.102 date 2014.05.22.22.56.53; author rmind; state Exp; branches; next 1.101; 1.101 date 2014.05.18.14.46.16; author rmind; state Exp; branches; next 1.100; 1.100 date 2014.01.02.18.29.01; author pooka; state Exp; branches 1.100.2.1; next 1.99; 1.99 date 2013.06.05.19.01.26; author christos; state Exp; branches 1.99.2.1; next 1.98; 1.98 date 2013.03.01.18.25.58; author joerg; state Exp; branches; next 1.97; 1.97 date 2012.06.23.03.14.03; author christos; state Exp; branches 1.97.2.1; next 1.96; 1.96 date 2012.03.22.20.34.40; author drochner; state Exp; branches; next 1.95; 1.95 date 2011.12.31.20.41.59; author christos; state Exp; branches 1.95.2.1 1.95.6.1 1.95.8.1; next 1.94; 1.94 date 2011.12.19.11.59.58; author drochner; state Exp; branches; next 1.93; 1.93 date 2011.09.24.17.22.14; author christos; state Exp; branches 1.93.2.1 1.93.6.1; next 1.92; 1.92 date 2011.05.24.18.07.11; author spz; state Exp; branches; next 1.91; 1.91 date 2011.05.03.17.44.30; author dyoung; state Exp; branches; next 1.90; 1.90 date 2011.03.31.19.40.52; author dyoung; state Exp; branches; next 1.89; 1.89 date 2010.08.24.00.07.00; author jakllsch; state Exp; branches 1.89.2.1; next 1.88; 1.88 date 2010.02.04.21.48.35; author joerg; state Exp; branches 1.88.2.1 1.88.4.1; next 1.87; 1.87 date 2009.09.11.22.06.29; author dyoung; state Exp; branches; next 1.86; 1.86 date 2009.09.11.20.10.06; author dyoung; state Exp; branches; next 1.85; 1.85 date 2009.08.21.16.52.43; author tsutsui; state Exp; branches; next 1.84; 1.84 date 2009.03.23.18.43.20; author liamjfoy; state Exp; branches; next 1.83; 1.83 date 2008.11.25.18.28.06; author pooka; state Exp; branches 1.83.4.1; next 1.82; 1.82 date 2008.04.24.11.38.38; author ad; state Exp; branches 1.82.2.1 1.82.8.1 1.82.10.1 1.82.12.1; next 1.81; 1.81 date 2008.04.23.06.09.05; author thorpej; state Exp; branches; next 1.80; 1.80 date 2008.04.15.05.40.15; author thorpej; state Exp; branches 1.80.2.1; next 1.79; 1.79 date 2007.09.19.04.33.44; author dyoung; state Exp; branches 1.79.16.1 1.79.20.1; next 1.78; 1.78 date 2007.08.30.02.17.38; author dyoung; state Exp; branches; next 1.77; 1.77 date 2007.05.06.02.56.37; author dyoung; state Exp; branches 1.77.2.1 1.77.6.1 1.77.8.1; next 1.76; 1.76 date 2007.05.02.20.40.26; author dyoung; state Exp; branches; next 1.75; 1.75 date 2007.03.07.22.20.04; author liamjfoy; state Exp; branches 1.75.2.1 1.75.4.1; next 1.74; 1.74 date 2007.03.06.12.12.24; author liamjfoy; state Exp; branches; next 1.73; 1.73 date 2007.02.27.22.19.05; author degroote; state Exp; branches; next 1.72; 1.72 date 2007.02.19.07.28.58; author dyoung; state Exp; branches; next 1.71; 1.71 date 2007.02.17.20.38.05; author dyoung; state Exp; branches; next 1.70; 1.70 date 2007.02.10.09.43.05; author degroote; state Exp; branches 1.70.2.1; next 1.69; 1.69 date 2006.12.09.05.33.07; author dyoung; state Exp; branches; next 1.68; 1.68 date 2006.11.23.04.07.07; author rpaulo; state Exp; branches 1.68.2.1 1.68.4.1; next 1.67; 1.67 date 2006.10.10.21.49.15; author dogcow; state Exp; branches; next 1.66; 1.66 date 2006.08.30.17.05.30; author christos; state Exp; branches 1.66.2.1 1.66.4.1; next 1.65; 1.65 date 2006.08.28.02.51.12; author christos; state Exp; branches; next 1.64; 1.64 date 2006.08.25.19.33.51; author matt; state Exp; branches; next 1.63; 1.63 date 2006.05.18.09.05.51; author liamjfoy; state Exp; branches; next 1.62; 1.62 date 2006.03.05.23.47.08; author rpaulo; state Exp; branches 1.62.4.1; next 1.61; 1.61 date 2005.12.11.12.25.02; author christos; state Exp; branches 1.61.4.1 1.61.6.1 1.61.8.1; next 1.60; 1.60 date 2005.07.19.12.58.24; author gdt; state Exp; branches; next 1.59; 1.59 date 2005.05.29.21.43.51; author christos; state Exp; branches 1.59.2.1; next 1.58; 1.58 date 2005.01.23.18.41.57; author matt; state Exp; branches 1.58.6.1; next 1.57; 1.57 date 2004.04.22.01.01.41; author matt; state Exp; branches 1.57.4.1; next 1.56; 1.56 date 2003.12.04.19.38.24; author atatat; state Exp; branches; next 1.55; 1.55 date 2003.11.03.15.12.06; author briggs; state Exp; branches; next 1.54; 1.54 date 2003.10.28.06.31.28; author briggs; state Exp; branches; next 1.53; 1.53 date 2003.09.06.03.36.32; author itojun; state Exp; branches; next 1.52; 1.52 date 2003.09.05.01.35.08; author itojun; state Exp; branches; next 1.51; 1.51 date 2003.09.04.09.17.07; author itojun; state Exp; branches; next 1.50; 1.50 date 2003.08.14.07.57.41; author itojun; state Exp; branches; next 1.49; 1.49 date 2003.08.07.16.33.25; author agc; state Exp; branches; next 1.48; 1.48 date 2003.08.07.08.52.32; author itojun; state Exp; branches; next 1.47; 1.47 date 2003.04.17.19.58.57; author thorpej; state Exp; branches 1.47.2.1; next 1.46; 1.46 date 2002.11.11.18.26.42; author itojun; state Exp; branches; next 1.45; 1.45 date 2002.08.20.22.06.05; author itojun; state Exp; branches; next 1.44; 1.44 date 2002.08.17.22.15.58; author itojun; state Exp; branches; next 1.43; 1.43 date 2002.06.09.14.43.12; author itojun; state Exp; branches; next 1.42; 1.42 date 2002.06.08.20.06.44; author itojun; state Exp; branches; next 1.41; 1.41 date 2002.05.29.02.58.30; author itojun; state Exp; branches; next 1.40; 1.40 date 2002.05.28.03.04.06; author itojun; state Exp; branches; next 1.39; 1.39 date 2002.03.15.09.25.43; author itojun; state Exp; branches 1.39.4.1 1.39.6.1; next 1.38; 1.38 date 2001.12.21.08.54.19; author itojun; state Exp; branches; next 1.37; 1.37 date 2001.12.21.06.30.44; author itojun; state Exp; branches; next 1.36; 1.36 date 2001.12.21.03.58.15; author itojun; state Exp; branches; next 1.35; 1.35 date 2001.12.21.03.21.51; author itojun; state Exp; branches; next 1.34; 1.34 date 2001.11.13.00.57.00; author lukem; state Exp; branches; next 1.33; 1.33 date 2001.10.24.09.37.00; author itojun; state Exp; branches; next 1.32; 1.32 date 2001.10.24.06.36.38; author itojun; state Exp; branches; next 1.31; 1.31 date 2001.10.16.04.57.38; author itojun; state Exp; branches 1.31.2.1; next 1.30; 1.30 date 2001.10.15.09.51.17; author itojun; state Exp; branches; next 1.29; 1.29 date 2001.03.21.19.22.28; author thorpej; state Exp; branches 1.29.2.1; next 1.28; 1.28 date 2001.03.01.16.31.41; author itojun; state Exp; branches 1.28.2.1; next 1.27; 1.27 date 2001.02.21.00.11.53; author itojun; state Exp; branches; next 1.26; 1.26 date 2001.02.20.08.49.16; author itojun; state Exp; branches; next 1.25; 1.25 date 2001.02.11.06.49.52; author itojun; state Exp; branches; next 1.24; 1.24 date 2001.02.11.05.25.04; author itojun; state Exp; branches; next 1.23; 1.23 date 2000.10.19.20.23.02; author itojun; state Exp; branches; next 1.22; 1.22 date 2000.10.18.21.14.15; author itojun; state Exp; branches; next 1.21; 1.21 date 2000.10.10.16.26.44; author itojun; state Exp; branches; next 1.20; 1.20 date 2000.10.10.13.25.28; author enami; state Exp; branches; next 1.19; 1.19 date 2000.07.28.04.06.59; author itojun; state Exp; branches; next 1.18; 1.18 date 2000.07.06.12.36.18; author itojun; state Exp; branches; next 1.17; 1.17 date 2000.04.19.06.30.56; author itojun; state Exp; branches 1.17.4.1; next 1.16; 1.16 date 2000.02.26.09.09.17; author itojun; state Exp; branches; next 1.15; 1.15 date 2000.02.26.09.01.59; author itojun; state Exp; branches; next 1.14; 1.14 date 2000.02.14.19.45.50; author thorpej; state Exp; branches; next 1.13; 1.13 date 2000.02.06.12.49.45; author itojun; state Exp; branches; next 1.12; 1.12 date 2000.01.06.15.46.09; author itojun; state Exp; branches; next 1.11; 1.11 date 2000.01.06.06.41.19; author itojun; state Exp; branches; next 1.10; 1.10 date 2000.01.02.16.31.18; author itojun; state Exp; branches; next 1.9; 1.9 date 99.12.13.15.17.22; author itojun; state Exp; branches; next 1.8; 1.8 date 99.07.31.18.41.16; author itojun; state Exp; branches 1.8.2.1 1.8.8.1; next 1.7; 1.7 date 99.07.30.10.35.36; author itojun; state Exp; branches; next 1.6; 1.6 date 99.07.27.06.23.57; author explorer; state Exp; branches; next 1.5; 1.5 date 99.07.22.03.59.42; author itojun; state Exp; branches; next 1.4; 1.4 date 99.07.09.22.57.27; author thorpej; state Exp; branches; next 1.3; 1.3 date 99.07.03.21.30.18; author thorpej; state Exp; branches; next 1.2; 1.2 date 99.07.01.08.12.55; author itojun; state Exp; branches 1.2.2.1; next 1.1; 1.1 date 99.06.28.06.37.04; author itojun; state dead; branches 1.1.2.1; next ; 1.126.10.1 date 2020.04.25.11.24.06; author bouyer; state Exp; branches; next ; commitid d0banFLkg9JL4L5C; 1.125.2.1 date 2019.06.10.22.09.48; author christos; state Exp; branches; next ; commitid jtc8rnCzWiEEHGqB; 1.121.2.1 date 2018.03.15.09.12.07; author pgoyette; state Exp; branches; next 1.121.2.2; commitid lb7w3QtkrVH4axuA; 1.121.2.2 date 2018.05.21.04.36.16; author pgoyette; state Exp; branches; next 1.121.2.3; commitid X5L8kSrBWQcDt7DA; 1.121.2.3 date 2018.09.06.06.56.45; author pgoyette; state Exp; branches; next ; commitid HCi1bXD317XIK0RA; 1.117.4.1 date 2017.10.21.19.43.54; author snj; state Exp; branches; next 1.117.4.2; commitid oXGWsjkUnhTWjXbA; 1.117.4.2 date 2017.10.24.08.55.55; author snj; state Exp; branches; next 1.117.4.3; commitid yo09jWat7Xb8DhcA; 1.117.4.3 date 2018.03.30.12.01.30; author martin; state Exp; branches; next 1.117.4.4; commitid 44UgBL2hINQCCtwA; 1.117.4.4 date 2018.03.31.10.41.06; author martin; state Exp; branches; next 1.117.4.5; commitid MPnlNGMPZg139BwA; 1.117.4.5 date 2018.05.12.10.42.22; author martin; state Exp; branches; next ; commitid ADyYKRoN85pMNZBA; 1.114.2.1 date 2017.04.21.16.54.06; author bouyer; state Exp; branches; next ; 1.113.2.1 date 2017.01.07.08.56.51; author pgoyette; state Exp; branches; next 1.113.2.2; 1.113.2.2 date 2017.03.20.06.57.51; author pgoyette; state Exp; branches; next 1.113.2.3; 1.113.2.3 date 2017.04.26.02.53.29; author pgoyette; state Exp; branches; next ; 1.103.4.1 date 2015.04.06.15.18.23; author skrll; state Exp; branches; next 1.103.4.2; 1.103.4.2 date 2015.06.06.14.40.26; author skrll; state Exp; branches; next 1.103.4.3; 1.103.4.3 date 2015.09.22.12.06.11; author skrll; state Exp; branches; next 1.103.4.4; 1.103.4.4 date 2015.12.27.12.10.07; author skrll; state Exp; branches; next 1.103.4.5; 1.103.4.5 date 2016.03.19.11.30.33; author skrll; state Exp; branches; next 1.103.4.6; 1.103.4.6 date 2016.04.22.15.44.18; author skrll; state Exp; branches; next 1.103.4.7; 1.103.4.7 date 2016.05.29.08.44.39; author skrll; state Exp; branches; next 1.103.4.8; 1.103.4.8 date 2016.07.09.20.25.22; author skrll; state Exp; branches; next 1.103.4.9; 1.103.4.9 date 2017.02.05.13.40.59; author skrll; state Exp; branches; next 1.103.4.10; 1.103.4.10 date 2017.08.28.17.53.12; author skrll; state Exp; branches; next ; commitid UQQpnjvcNkUZn05A; 1.100.2.1 date 2014.08.10.06.56.30; author tls; state Exp; branches; next ; 1.99.2.1 date 2013.08.28.15.21.48; author rmind; state Exp; branches; next 1.99.2.2; 1.99.2.2 date 2014.05.18.17.46.13; author rmind; state Exp; branches; next ; 1.97.2.1 date 2013.06.23.06.20.25; author tls; state Exp; branches; next 1.97.2.2; 1.97.2.2 date 2014.08.20.00.04.36; author tls; state Exp; branches; next 1.97.2.3; 1.97.2.3 date 2017.12.03.11.39.04; author jdolecek; state Exp; branches; next ; commitid XcIYRZTAh1LmerhA; 1.95.2.1 date 2013.07.08.07.40.07; author jdc; state Exp; branches; next ; 1.95.6.1 date 2013.07.08.07.40.34; author jdc; state Exp; branches; next ; 1.95.8.1 date 2013.07.08.07.40.56; author jdc; state Exp; branches; next ; 1.93.2.1 date 2012.04.17.00.08.43; author yamt; state Exp; branches; next 1.93.2.2; 1.93.2.2 date 2012.10.30.17.22.48; author yamt; state Exp; branches; next 1.93.2.3; 1.93.2.3 date 2014.05.22.11.41.10; author yamt; state Exp; branches; next ; 1.93.6.1 date 2012.02.18.07.35.42; author mrg; state Exp; branches; next 1.93.6.2; 1.93.6.2 date 2012.04.05.21.33.46; author mrg; state Exp; branches; next ; 1.89.2.1 date 2011.06.06.09.09.59; author jruoho; state Exp; branches; next ; 1.88.2.1 date 2010.10.22.07.22.41; author uebayasi; state Exp; branches; next ; 1.88.4.1 date 2011.03.05.20.55.59; author rmind; state Exp; branches; next 1.88.4.2; 1.88.4.2 date 2011.04.21.01.42.15; author rmind; state Exp; branches; next 1.88.4.3; 1.88.4.3 date 2011.05.31.03.05.08; author rmind; state Exp; branches; next ; 1.83.4.1 date 2009.05.13.17.22.29; author jym; state Exp; branches; next ; 1.82.2.1 date 2009.05.04.08.14.18; author yamt; state Exp; branches; next 1.82.2.2; 1.82.2.2 date 2009.09.16.13.38.02; author yamt; state Exp; branches; next 1.82.2.3; 1.82.2.3 date 2010.03.11.15.04.29; author yamt; state Exp; branches; next 1.82.2.4; 1.82.2.4 date 2010.10.09.03.32.38; author yamt; state Exp; branches; next ; 1.82.8.1 date 2008.12.13.01.15.27; author haad; state Exp; branches; next ; 1.82.10.1 date 2009.01.19.13.20.14; author skrll; state Exp; branches; next 1.82.10.2; 1.82.10.2 date 2009.04.28.07.37.23; author skrll; state Exp; branches; next ; 1.82.12.1 date 2010.11.21.20.45.39; author riz; state Exp; branches 1.82.12.1.2.1; next ; 1.82.12.1.2.1 date 2011.01.07.03.16.14; author matt; state Exp; branches; next ; 1.80.2.1 date 2008.05.18.12.35.35; author yamt; state Exp; branches; next ; 1.79.16.1 date 2008.02.22.02.53.33; author keiichi; state Exp; branches; next ; 1.79.20.1 date 2008.06.02.13.24.26; author mjf; state Exp; branches; next 1.79.20.2; 1.79.20.2 date 2009.01.17.13.29.33; author mjf; state Exp; branches; next ; 1.77.2.1 date 2007.09.03.10.23.48; author skrll; state Exp; branches; next ; 1.77.6.1 date 2007.09.03.16.49.07; author jmcneill; state Exp; branches; next 1.77.6.2; 1.77.6.2 date 2007.10.02.18.29.22; author joerg; state Exp; branches; next ; 1.77.8.1 date 2007.11.06.23.34.00; author matt; state Exp; branches; next ; 1.75.2.1 date 2007.06.08.14.17.54; author ad; state Exp; branches; next 1.75.2.2; 1.75.2.2 date 2007.10.09.13.44.54; author ad; state Exp; branches; next ; 1.75.4.1 date 2007.07.11.20.11.40; author mjf; state Exp; branches; next ; 1.70.2.1 date 2007.02.27.16.55.00; author yamt; state Exp; branches; next 1.70.2.2; 1.70.2.2 date 2007.03.12.05.59.57; author rmind; state Exp; branches; next 1.70.2.3; 1.70.2.3 date 2007.05.07.10.56.03; author yamt; state Exp; branches; next ; 1.68.2.1 date 2007.05.24.19.13.16; author pavel; state Exp; branches; next ; 1.68.4.1 date 2007.06.04.01.54.24; author wrstuden; state Exp; branches; next ; 1.66.2.1 date 2006.11.18.21.39.37; author ad; state Exp; branches; next 1.66.2.2; 1.66.2.2 date 2007.01.12.01.04.15; author ad; state Exp; branches; next ; 1.66.4.1 date 2006.10.22.06.07.35; author yamt; state Exp; branches; next 1.66.4.2; 1.66.4.2 date 2006.12.10.07.19.15; author yamt; state Exp; branches; next ; 1.62.4.1 date 2006.05.24.15.50.45; author tron; state Exp; branches; next ; 1.61.4.1 date 2006.02.07.04.58.11; author rpaulo; state Exp; branches; next 1.61.4.2; 1.61.4.2 date 2006.09.09.02.58.55; author rpaulo; state Exp; branches; next ; 1.61.6.1 date 2006.04.22.11.40.12; author simonb; state Exp; branches; next 1.61.6.2; 1.61.6.2 date 2006.06.01.22.39.02; author kardel; state Exp; branches; next ; 1.61.8.1 date 2006.03.13.09.07.39; author yamt; state Exp; branches; next 1.61.8.2; 1.61.8.2 date 2006.05.24.10.59.09; author yamt; state Exp; branches; next 1.61.8.3; 1.61.8.3 date 2006.09.03.15.25.42; author yamt; state Exp; branches; next ; 1.59.2.1 date 2006.06.21.15.11.08; author yamt; state Exp; branches; next 1.59.2.2; 1.59.2.2 date 2006.12.30.20.50.38; author yamt; state Exp; branches; next 1.59.2.3; 1.59.2.3 date 2007.02.26.09.11.51; author yamt; state Exp; branches; next 1.59.2.4; 1.59.2.4 date 2007.09.03.14.43.30; author yamt; state Exp; branches; next 1.59.2.5; 1.59.2.5 date 2007.10.27.11.36.11; author yamt; state Exp; branches; next ; 1.58.6.1 date 2005.08.15.19.04.43; author tron; state Exp; branches; next ; 1.57.4.1 date 2005.04.29.11.29.34; author kent; state Exp; branches; next ; 1.47.2.1 date 2004.08.03.10.55.13; author skrll; state Exp; branches; next 1.47.2.2; 1.47.2.2 date 2004.09.18.14.55.14; author skrll; state Exp; branches; next 1.47.2.3; 1.47.2.3 date 2004.09.21.13.37.33; author skrll; state Exp; branches; next 1.47.2.4; 1.47.2.4 date 2005.01.24.08.35.53; author skrll; state Exp; branches; next 1.47.2.5; 1.47.2.5 date 2005.11.10.14.11.25; author skrll; state Exp; branches; next ; 1.39.4.1 date 2002.05.30.13.52.32; author gehenna; state Exp; branches; next 1.39.4.2; 1.39.4.2 date 2002.06.20.15.52.43; author gehenna; state Exp; branches; next 1.39.4.3; 1.39.4.3 date 2002.08.29.00.56.51; author gehenna; state Exp; branches; next ; 1.39.6.1 date 2002.08.18.00.56.19; author lukem; state Exp; branches; next 1.39.6.2; 1.39.6.2 date 2002.11.21.17.54.18; author he; state Exp; branches; next 1.39.6.3; 1.39.6.3 date 2003.10.04.09.44.06; author tron; state Exp; branches; next ; 1.31.2.1 date 2001.11.12.21.19.31; author thorpej; state Exp; branches; next ; 1.29.2.1 date 2002.01.10.20.03.18; author thorpej; state Exp; branches; next 1.29.2.2; 1.29.2.2 date 2002.06.23.17.51.14; author jdolecek; state Exp; branches; next 1.29.2.3; 1.29.2.3 date 2002.09.06.08.49.31; author jdolecek; state Exp; branches; next ; 1.28.2.1 date 2001.04.09.01.58.38; author nathanw; state Exp; branches; next 1.28.2.2; 1.28.2.2 date 2001.10.22.20.42.01; author nathanw; state Exp; branches; next 1.28.2.3; 1.28.2.3 date 2001.11.14.19.18.08; author nathanw; state Exp; branches; next 1.28.2.4; 1.28.2.4 date 2002.01.08.00.34.18; author nathanw; state Exp; branches; next 1.28.2.5; 1.28.2.5 date 2002.04.01.07.48.50; author nathanw; state Exp; branches; next 1.28.2.6; 1.28.2.6 date 2002.06.20.03.49.17; author nathanw; state Exp; branches; next 1.28.2.7; 1.28.2.7 date 2002.12.11.06.46.40; author thorpej; state Exp; branches; next ; 1.17.4.1 date 2000.08.16.01.22.26; author itojun; state Exp; branches; next 1.17.4.2; 1.17.4.2 date 2000.10.17.21.40.26; author tv; state Exp; branches; next 1.17.4.3; 1.17.4.3 date 2001.03.11.21.12.19; author he; state Exp; branches; next 1.17.4.4; 1.17.4.4 date 2003.09.09.10.36.20; author msaitoh; state Exp; branches; next ; 1.8.2.1 date 2000.11.20.18.10.50; author bouyer; state Exp; branches; next 1.8.2.2; 1.8.2.2 date 2001.02.11.19.17.24; author bouyer; state Exp; branches; next 1.8.2.3; 1.8.2.3 date 2001.03.12.13.31.55; author bouyer; state Exp; branches; next 1.8.2.4; 1.8.2.4 date 2001.03.27.15.32.37; author bouyer; state Exp; branches; next ; 1.8.8.1 date 99.12.27.18.36.24; author wrstuden; state Exp; branches; next ; 1.2.2.1 date 99.07.01.08.12.55; author thorpej; state dead; branches; next 1.2.2.2; 1.2.2.2 date 99.07.01.23.48.28; author thorpej; state Exp; branches; next 1.2.2.3; 1.2.2.3 date 99.08.02.22.36.04; author thorpej; state Exp; branches; next ; 1.1.2.1 date 99.06.28.06.37.05; author itojun; state Exp; branches; next 1.1.2.2; 1.1.2.2 date 99.07.06.11.03.00; author itojun; state Exp; branches; next 1.1.2.3; 1.1.2.3 date 99.11.30.13.35.52; author itojun; state Exp; branches; next ; desc @@ 1.131 log @fix spelling mistakes, mainly in comments and log messages. @ text @/* $NetBSD: in6_proto.c,v 1.130 2022/10/24 01:54:19 knakahara Exp $ */ /* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 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. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 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. * 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. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @@(#)in_proto.c 8.1 (Berkeley) 6/10/93 */ #include __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.130 2022/10/24 01:54:19 knakahara Exp $"); #ifdef _KERNEL_OPT #include "opt_gateway.h" #include "opt_inet.h" #include "opt_ipsec.h" #include "opt_dccp.h" #include "opt_sctp.h" #include "opt_net_mpsafe.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef DCCP #include #include #include #endif #ifdef SCTP #include #include #include #include #endif #include #ifdef IPSEC #include #include #include #endif #include "carp.h" #if NCARP > 0 #include #endif #include /* * TCP/IP protocol family: IP6, ICMP6, UDP, TCP. */ DOMAIN_DEFINE(inet6domain); /* forward declare and add to link set */ /* Wrappers to acquire kernel_lock. */ PR_WRAP_CTLINPUT(rip6_ctlinput) PR_WRAP_CTLINPUT(encap6_ctlinput) PR_WRAP_CTLINPUT(udp6_ctlinput) PR_WRAP_CTLINPUT(tcp6_ctlinput) #define rip6_ctlinput rip6_ctlinput_wrapper #define encap6_ctlinput encap6_ctlinput_wrapper #define udp6_ctlinput udp6_ctlinput_wrapper #define tcp6_ctlinput tcp6_ctlinput_wrapper PR_WRAP_CTLOUTPUT(rip6_ctloutput) PR_WRAP_CTLOUTPUT(tcp_ctloutput) PR_WRAP_CTLOUTPUT(udp6_ctloutput) PR_WRAP_CTLOUTPUT(icmp6_ctloutput) #define rip6_ctloutput rip6_ctloutput_wrapper #define tcp_ctloutput tcp_ctloutput_wrapper #define udp6_ctloutput udp6_ctloutput_wrapper #define icmp6_ctloutput icmp6_ctloutput_wrapper #if defined(DCCP) PR_WRAP_CTLINPUT(dccp6_ctlinput) PR_WRAP_CTLOUTPUT(dccp_ctloutput) #define dccp6_ctlinput dccp6_ctlinput_wrapper #define dccp_ctloutput dccp_ctloutput_wrapper #endif #if defined(SCTP) PR_WRAP_CTLINPUT(sctp6_ctlinput) PR_WRAP_CTLOUTPUT(sctp_ctloutput) #define sctp6_ctlinput sctp6_ctlinput_wrapper #define sctp_ctloutput sctp_ctloutput_wrapper #endif #ifdef NET_MPSAFE PR_WRAP_INPUT6(udp6_input) PR_WRAP_INPUT6(tcp6_input) #ifdef DCCP PR_WRAP_INPUT6(dccp6_input) #endif #ifdef SCTP PR_WRAP_INPUT6(sctp6_input) #endif PR_WRAP_INPUT6(rip6_input) PR_WRAP_INPUT6(dest6_input) PR_WRAP_INPUT6(route6_input) PR_WRAP_INPUT6(frag6_input) #if NPFSYNC > 0 PR_WRAP_INPUT6(pfsync_input) #endif PR_WRAP_INPUT6(pim6_input) #define udp6_input udp6_input_wrapper #define tcp6_input tcp6_input_wrapper #define dccp6_input dccp6_input_wrapper #define sctp6_input sctp6_input_wrapper #define rip6_input rip6_input_wrapper #define dest6_input dest6_input_wrapper #define route6_input route6_input_wrapper #define frag6_input frag6_input_wrapper #define pim6_input pim6_input_wrapper #endif #if defined(IPSEC) #ifdef IPSEC_RUMPKERNEL /* * .pr_input = ipsec6_common_input won't be resolved on loading * the ipsec shared library. We need a wrapper anyway. */ static int ipsec6_common_input_wrapper(struct mbuf **mp, int *offp, int proto) { if (ipsec_enabled) { return ipsec6_common_input(mp, offp, proto); } else { m_freem(*mp); return IPPROTO_DONE; } } #define ipsec6_common_input ipsec6_common_input_wrapper /* The ctlinput functions may not be loaded */ #define IPSEC_WRAP_CTLINPUT(name) \ static void * \ name##_wrapper(int a, const struct sockaddr *b, void *c)\ { \ void *rv; \ KERNEL_LOCK(1, NULL); \ if (ipsec_enabled) \ rv = name(a, b, c); \ else \ rv = NULL; \ KERNEL_UNLOCK_ONE(NULL); \ return rv; \ } IPSEC_WRAP_CTLINPUT(ah6_ctlinput) IPSEC_WRAP_CTLINPUT(esp6_ctlinput) #else /* !IPSEC_RUMPKERNEL */ PR_WRAP_CTLINPUT(ah6_ctlinput) PR_WRAP_CTLINPUT(esp6_ctlinput) #endif /* !IPSEC_RUMPKERNEL */ #define ah6_ctlinput ah6_ctlinput_wrapper #define esp6_ctlinput esp6_ctlinput_wrapper #endif /* IPSEC */ static void tcp6_init(void) { icmp6_mtudisc_callback_register(tcp6_mtudisc_callback); tcp_init_common(sizeof(struct ip6_hdr)); } const struct ip6protosw inet6sw[] = { { .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_init = ip6_init, .pr_fasttimo = frag6_fasttimo, .pr_slowtimo = frag6_slowtimo, .pr_drain = frag6_drainstub, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ICMPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = icmp6_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = icmp6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = icmp6_init, }, { .pr_type = SOCK_DGRAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_UDP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF, .pr_input = udp6_input, .pr_ctlinput = udp6_ctlinput, .pr_ctloutput = udp6_ctloutput, .pr_usrreqs = &udp6_usrreqs, .pr_init = udp6_init, }, { .pr_type = SOCK_STREAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_TCP, .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS|PR_PURGEIF, .pr_input = tcp6_input, .pr_ctlinput = tcp6_ctlinput, .pr_ctloutput = tcp_ctloutput, .pr_usrreqs = &tcp_usrreqs, .pr_init = tcp6_init, .pr_fasttimo = tcp_fasttimo, .pr_drain = tcp_drainstub, }, #ifdef DCCP { .pr_type = SOCK_CONN_DGRAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_DCCP, .pr_flags = PR_CONNREQUIRED|PR_ATOMIC|PR_LISTEN, .pr_input = dccp6_input, .pr_ctlinput = dccp6_ctlinput, .pr_ctloutput = dccp_ctloutput, .pr_usrreqs = &dccp6_usrreqs, #ifndef INET .pr_init = dccp_init, #endif }, #endif /* DCCP */ #ifdef SCTP { .pr_type = SOCK_DGRAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_ADDR_OPT|PR_WANTRCVD, .pr_input = sctp6_input, .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_usrreqs = &sctp6_usrreqs, .pr_drain = sctp_drain, }, { .pr_type = SOCK_SEQPACKET, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_ADDR_OPT|PR_WANTRCVD, .pr_input = sctp6_input, .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_usrreqs = &sctp6_usrreqs, .pr_drain = sctp_drain, }, { .pr_type = SOCK_STREAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_CONNREQUIRED|PR_ADDR_OPT|PR_WANTRCVD|PR_LISTEN, .pr_input = sctp6_input, .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_usrreqs = &sctp6_usrreqs, .pr_drain = sctp_drain, }, #endif /* SCTP */ { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_RAW, .pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF, .pr_input = rip6_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs, }, #ifdef GATEWAY { .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_slowtimo = ip6flow_slowtimo, .pr_init = ip6flow_poolinit, }, #endif /* GATEWAY */ { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_DSTOPTS, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = dest6_input, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ROUTING, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = route6_input, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_FRAGMENT, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = frag6_input, }, #ifdef IPSEC { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_AH, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipsec6_common_input, .pr_ctlinput = ah6_ctlinput, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ESP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipsec6_common_input, .pr_ctlinput = esp6_ctlinput, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPCOMP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipsec6_common_input, }, #endif /* IPSEC */ #ifdef INET { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV4, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = encap_init, }, #endif { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = encap_init, }, #if NCARP > 0 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_CARP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = carp6_proto_input, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs, }, #endif /* NCARP */ { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_L2TP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = encap_init, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_PIM, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = pim6_input, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = pim6_init, }, /* raw wildcard */ { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = rip6_input, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = rip6_init, }, }; static const struct sockaddr_in6 in6_any = { .sin6_len = sizeof(in6_any) , .sin6_family = AF_INET6 , .sin6_port = 0 , .sin6_flowinfo = 0 , .sin6_addr = IN6ADDR_ANY_INIT , .sin6_scope_id = 0 }; bool in6_present = false; static void in6_dom_init(void) { in6_present = true; } struct domain inet6domain = { .dom_family = AF_INET6, .dom_name = "internet6", .dom_init = in6_dom_init, .dom_externalize = NULL, .dom_dispose = NULL, .dom_protosw = (const struct protosw *)inet6sw, .dom_protoswNPROTOSW = (const struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], .dom_rtattach = rt_inithead, .dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr) << 3, .dom_maxrtkey = sizeof(struct ip_pack6), .dom_if_up = in6_if_up, .dom_if_down = in6_if_down, .dom_ifattach = in6_domifattach, .dom_ifdetach = in6_domifdetach, .dom_if_link_state_change = in6_if_link_state_change, .dom_link = { NULL }, .dom_mowner = MOWNER_INIT("",""), .dom_sa_cmpofs = offsetof(struct sockaddr_in6, sin6_addr), .dom_sa_cmplen = sizeof(struct in6_addr), .dom_sa_any = (const struct sockaddr *)&in6_any, .dom_sockaddr_externalize = sockaddr_in6_externalize, }; #if 0 int sockaddr_in6_cmp(const struct sockaddr *lsa, const struct sockaddr *rsa) { uint_fast8_t len; const uint_fast8_t addrofs = offsetof(struct sockaddr_in6, sin6_addr), addrend = addrofs + sizeof(struct in6_addr); int rc; const struct sockaddr_in6 *lsin6, *rsin6; lsin6 = satocsin6(lsa); rsin6 = satocsin6(rsa); len = MIN(addrend, MIN(lsin6->sin6_len, rsin6->sin6_len)); if (len > addrofs && (rc = memcmp(&lsin6->sin6_addr, &rsin6->sin6_addr, len - addrofs)) != 0) return rc; return lsin6->sin6_len - rsin6->sin6_len; } #endif /* * Internet configuration info */ #ifdef GATEWAY6 #define IPV6FORWARDING 1 /* forward IP6 packets not for us */ #else #define IPV6FORWARDING 0 /* don't forward IP6 packets not for us */ #endif int ip6_forwarding = IPV6FORWARDING; /* act as router? */ int ip6_sendredirects = 1; int ip6_defhlim = IPV6_DEFHLIM; int ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS; int ip6_maxfragpackets = 200; int ip6_maxfrags = 200; int ip6_log_interval = 5; int ip6_hdrnestlimit = 15; int ip6_dad_count = 1; /* DupAddrDetectionTransmits */ int ip6_auto_flowlabel = 1; int ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */ int ip6_mcast_pmtu = 0; /* enable pMTU discovery for multicast? */ int ip6_v6only = 1; int ip6_neighborgcthresh = 2048; /* Threshold # of NDP entries for GC */ int ip6_maxdynroutes = 4096; /* Max # of routes created via redirect */ int ip6_param_rt_msg = 1; /* How to send parameter changing rtm */ int ip6_keepfaith = 0; time_t ip6_log_time = 0; /* icmp6 */ int pmtu_expire = 60*10; /* raw IP6 parameters */ /* * Nominal space allocated to a raw ip socket. */ #define RIPV6SNDQ 8192 #define RIPV6RCVQ 16384 u_long rip6_sendspace = RIPV6SNDQ; u_long rip6_recvspace = RIPV6RCVQ; /* ICMPV6 parameters */ int icmp6_rediraccept = 1; /* accept and process redirects */ int icmp6_redirtimeout = 10 * 60; /* 10 minutes */ int icmp6errppslim = 100; /* 100pps */ int icmp6_nodeinfo = 1; /* enable/disable NI response */ @ 1.130 log @Fix PR kern/57037 Be able to change the behavior sending parameter changing routing messages. When set net.inet6.ip6.param_rt_msg=0, don't send parameter changing routing messages. When set net.inet6.ip6.param_rt_msg=1(default), send parameter changing routing messages by RTM_NEWADDR. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.129 2022/09/03 02:53:18 thorpej Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.129 2022/09/03 02:53:18 thorpej Exp $"); d554 1 a554 1 int ip6_param_rt_msg = 1; /* How to send parmeter changing rtm */ @ 1.129 log @Garbage-collect everything related to struct domain::dom_ifqueues (except dom_ifqueues itself, until the next kernel version bump). It's no longer used now that nothing uses the legacy netisr mechanism. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.128 2020/06/12 11:04:45 roy Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.128 2020/06/12 11:04:45 roy Exp $"); d554 1 @ 1.128 log @Remove in-kernel handling of Router Advertisements This is much better handled by a user-land tool. Proposed on tech-net here: https://mail-index.netbsd.org/tech-net/2020/04/22/msg007766.html Note that the ioctl SIOCGIFINFO_IN6 no longer sets flags. That now needs to be done using the pre-existing SIOCSIFINFO_FLAGS ioctl. Compat is fully provided where it makes sense, but trying to turn on RA handling will obviously throw an error as it no longer exists. Note that if you use IPv6 temporary addresses, this now needs to be turned on in dhcpcd.conf(5) rather than in sysctl.conf(5). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.127 2020/04/24 17:36:55 jakllsch Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.127 2020/04/24 17:36:55 jakllsch Exp $"); a497 1 .dom_ifqueues = { NULL, NULL }, @ 1.127 log @Fill in .pr_usrreqs for SOCK_SEQPACKET and SOCK_STREAM variants of SCTP too. This should allow these socket types of SCTP to operate on IPv6 family sockets, as .pr_usrreqs must not be NULL for socreate() to succeed. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.126 2018/08/14 14:49:14 maxv Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.126 2018/08/14 14:49:14 maxv Exp $"); a543 1 int ip6_accept_rtadv = 0; a550 2 int ip6_rr_prune = 5; /* router renumbering prefix * walk list every 5 sec. */ a553 2 int ip6_maxifprefixes = 16; /* Max acceptable prefixes via RA per IF */ int ip6_maxifdefrouters = 16; /* Max acceptable def routers via RA */ a557 7 int ip6_rtadv_maxroutes = 100; /* (arbitrary) initial maximum number of * routes via rtadv expected to be * significantly larger than common use. * if you need to count: 3 extra initial * routes, plus 1 per interface after the * first one, then one per non-linklocal * prefix */ @ 1.126 log @Retire EtherIP, we have L2TP instead. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.125 2018/05/11 09:43:59 roy Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.125 2018/05/11 09:43:59 roy Exp $"); d338 1 d348 1 @ 1.126.10.1 log @Sync with bouyer-xenpvh-base2 (HEAD) @ text @d1 1 a1 1 /* $NetBSD$ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD$"); a337 1 .pr_usrreqs = &sctp6_usrreqs, a346 1 .pr_usrreqs = &sctp6_usrreqs, @ 1.125 log @Increase the default size of some receive buffers from 8k to 16k. This mitigates recent reports of socket overflow errors and fixes PR bin/53247. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.124 2018/05/03 07:13:48 maxv Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.124 2018/05/03 07:13:48 maxv Exp $"); a132 5 #include "etherip.h" #if NETHERIP > 0 #include #endif a191 3 #if NETHERIP > 0 PR_WRAP_INPUT6(ip6_etherip_input) #endif a204 1 #define ip6_etherip_input ip6_etherip_input_wrapper a427 11 #if NETHERIP > 0 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ETHERIP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = ip6_etherip_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs, }, #endif @ 1.125.2.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.126 2018/08/14 14:49:14 maxv Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.126 2018/08/14 14:49:14 maxv Exp $"); d133 5 d197 3 d213 1 d437 11 @ 1.124 log @Remove now unused tcpip.h includes. Some were already unused before. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.123 2018/05/03 06:41:30 maxv Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.123 2018/05/03 06:41:30 maxv Exp $"); d597 1 a597 1 #define RIPV6RCVQ 8192 @ 1.123 log @Remove net_osdep.h completely. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.122 2018/03/15 08:15:21 maxv Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.122 2018/03/15 08:15:21 maxv Exp $"); a101 1 #include @ 1.122 log @Add the PR_LASTHDR flag on the PFsync and CARP entries. Otherwise a "require" IPsec policy is not enforced on them, and unauthenticated packets will be accepted. Tested with a require-AH configuration. Sent on tech-net@@, no comment. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.121 2018/02/07 10:52:20 maxv Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.121 2018/02/07 10:52:20 maxv Exp $"); a140 2 #include @ 1.121 log @Style, and localify IPV6FORWARDING. No functional change. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.119 2017/09/27 10:05:05 ozaki-r Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.119 2017/09/27 10:05:05 ozaki-r Exp $"); d455 1 a455 1 .pr_flags = PR_ATOMIC|PR_ADDR, @ 1.121.2.1 log @Synch with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.122 2018/03/15 08:15:21 maxv Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.122 2018/03/15 08:15:21 maxv Exp $"); d455 1 a455 1 .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, @ 1.121.2.2 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.125 2018/05/11 09:43:59 roy Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.125 2018/05/11 09:43:59 roy Exp $"); d102 1 d141 2 d600 1 a600 1 #define RIPV6RCVQ 16384 @ 1.121.2.3 log @Sync with HEAD Resolve a couple of conflicts (result of the uimin/uimax changes) @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.126 2018/08/14 14:49:14 maxv Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.126 2018/08/14 14:49:14 maxv Exp $"); d133 5 d197 3 d213 1 d437 11 @ 1.120 log @Change ip6_hdrnestlimit to be 15 instead of 50. I couldn't find any reference in RFCs about what a correct limit should be, but FreeBSD already uses 15. If an IPv6 packet has 50 options, there is clearly something wrong with it. @ text @d127 1 a127 2 #endif /* IPSEC */ a554 1 #ifndef IPV6FORWARDING d556 1 a556 1 #define IPV6FORWARDING 1 /* forward IP6 packets not for us */ d558 33 a590 34 #define IPV6FORWARDING 0 /* don't forward IP6 packets not for us */ #endif /* GATEWAY6 */ #endif /* !IPV6FORWARDING */ int ip6_forwarding = IPV6FORWARDING; /* act as router? */ int ip6_sendredirects = 1; int ip6_defhlim = IPV6_DEFHLIM; int ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS; int ip6_accept_rtadv = 0; /* "IPV6FORWARDING ? 0 : 1" is dangerous */ int ip6_maxfragpackets = 200; int ip6_maxfrags = 200; int ip6_log_interval = 5; int ip6_hdrnestlimit = 15; /* appropriate? */ int ip6_dad_count = 1; /* DupAddrDetectionTransmits */ int ip6_auto_flowlabel = 1; int ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */ int ip6_rr_prune = 5; /* router renumbering prefix * walk list every 5 sec. */ int ip6_mcast_pmtu = 0; /* enable pMTU discovery for multicast? */ int ip6_v6only = 1; int ip6_neighborgcthresh = 2048; /* Threshold # of NDP entries for GC */ int ip6_maxifprefixes = 16; /* Max acceptable prefixes via RA per IF */ int ip6_maxifdefrouters = 16; /* Max acceptable def routers via RA */ int ip6_maxdynroutes = 4096; /* Max # of routes created via redirect */ int ip6_keepfaith = 0; time_t ip6_log_time = 0; int ip6_rtadv_maxroutes = 100; /* (arbitrary) initial maximum number of * routes via rtadv expected to be * significantly larger than common use. * if you need to count: 3 extra initial * routes, plus 1 per interface after the * first one, then one per non-linklocal * prefix */ a592 5 /* * BSDI4 defines these variables in in_proto.c... * XXX: what if we don't define INET? Should we define pmtu6_expire * or so? (jinmei@@kame.net 19990310) */ @ 1.119 log @Take softnet_lock on pr_input properly if NET_MPSAFE Currently softnet_lock is taken unnecessarily in some cases, e.g., icmp_input and encap4_input from ip_input, or not taken even if needed, e.g., udp_input and tcp_input from ipsec4_common_input_cb. Fix them. NFC if NET_MPSAFE is disabled (default). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.118 2017/09/21 07:15:35 ozaki-r Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.118 2017/09/21 07:15:35 ozaki-r Exp $"); d572 1 a572 1 int ip6_hdrnestlimit = 50; /* appropriate? */ @ 1.118 log @Invalidate rtcache based on a global generation counter The change introduces a global generation counter that is incremented when any routes have been added or deleted. When a rtcache caches a rtentry into itself, it also stores a snapshot of the generation counter. If the snapshot equals to the global counter, the cache is still valid, otherwise invalidated. One drawback of the change is that all rtcaches of all protocol families are invalidated when any routes of any protocol families are added or deleted. If that matters, we should have separate generation counters based on protocol families. This change removes LIST_ENTRY from struct route, which fixes a part of PR kern/52515. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.117 2017/04/14 02:43:28 ozaki-r Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.117 2017/04/14 02:43:28 ozaki-r Exp $"); d73 1 d188 33 @ 1.117 log @Rumpify netipsec Note that we should modularize netipsec and reduce reverse symbol references (referencing symbols of netipsec from net, netinet and netinet6) though, the task needs lots of code changes. Prior to doing so, rumpifying it and having ATF tests should be useful. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.116 2017/02/16 08:12:44 knakahara Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.116 2017/02/16 08:12:44 knakahara Exp $"); a492 1 .dom_rtcache = LIST_HEAD_INITIALIZER(inet6domain.dom_rtcache) @ 1.117.4.1 log @Pull up following revision(s) (requested by ozaki-r in ticket #300): crypto/dist/ipsec-tools/src/setkey/parse.y: 1.19 crypto/dist/ipsec-tools/src/setkey/token.l: 1.20 distrib/sets/lists/tests/mi: 1.754, 1.757, 1.759 doc/TODO.smpnet: 1.12-1.13 sys/net/pfkeyv2.h: 1.32 sys/net/raw_cb.c: 1.23-1.24, 1.28 sys/net/raw_cb.h: 1.28 sys/net/raw_usrreq.c: 1.57-1.58 sys/net/rtsock.c: 1.228-1.229 sys/netinet/in_proto.c: 1.125 sys/netinet/ip_input.c: 1.359-1.361 sys/netinet/tcp_input.c: 1.359-1.360 sys/netinet/tcp_output.c: 1.197 sys/netinet/tcp_var.h: 1.178 sys/netinet6/icmp6.c: 1.213 sys/netinet6/in6_proto.c: 1.119 sys/netinet6/ip6_forward.c: 1.88 sys/netinet6/ip6_input.c: 1.181-1.182 sys/netinet6/ip6_output.c: 1.193 sys/netinet6/ip6protosw.h: 1.26 sys/netipsec/ipsec.c: 1.100-1.122 sys/netipsec/ipsec.h: 1.51-1.61 sys/netipsec/ipsec6.h: 1.18-1.20 sys/netipsec/ipsec_input.c: 1.44-1.51 sys/netipsec/ipsec_netbsd.c: 1.41-1.45 sys/netipsec/ipsec_output.c: 1.49-1.64 sys/netipsec/ipsec_private.h: 1.5 sys/netipsec/key.c: 1.164-1.234 sys/netipsec/key.h: 1.20-1.32 sys/netipsec/key_debug.c: 1.18-1.21 sys/netipsec/key_debug.h: 1.9 sys/netipsec/keydb.h: 1.16-1.20 sys/netipsec/keysock.c: 1.59-1.62 sys/netipsec/keysock.h: 1.10 sys/netipsec/xform.h: 1.9-1.12 sys/netipsec/xform_ah.c: 1.55-1.74 sys/netipsec/xform_esp.c: 1.56-1.72 sys/netipsec/xform_ipcomp.c: 1.39-1.53 sys/netipsec/xform_ipip.c: 1.50-1.54 sys/netipsec/xform_tcp.c: 1.12-1.16 sys/rump/librump/rumpkern/Makefile.rumpkern: 1.170 sys/rump/librump/rumpnet/net_stub.c: 1.27 sys/sys/protosw.h: 1.67-1.68 tests/net/carp/t_basic.sh: 1.7 tests/net/if_gif/t_gif.sh: 1.11 tests/net/if_l2tp/t_l2tp.sh: 1.3 tests/net/ipsec/Makefile: 1.7-1.9 tests/net/ipsec/algorithms.sh: 1.5 tests/net/ipsec/common.sh: 1.4-1.6 tests/net/ipsec/t_ipsec_ah_keys.sh: 1.2 tests/net/ipsec/t_ipsec_esp_keys.sh: 1.2 tests/net/ipsec/t_ipsec_gif.sh: 1.6-1.7 tests/net/ipsec/t_ipsec_l2tp.sh: 1.6-1.7 tests/net/ipsec/t_ipsec_misc.sh: 1.8-1.18 tests/net/ipsec/t_ipsec_sockopt.sh: 1.1-1.2 tests/net/ipsec/t_ipsec_tcp.sh: 1.1-1.2 tests/net/ipsec/t_ipsec_transport.sh: 1.5-1.6 tests/net/ipsec/t_ipsec_tunnel.sh: 1.9 tests/net/ipsec/t_ipsec_tunnel_ipcomp.sh: 1.1-1.2 tests/net/ipsec/t_ipsec_tunnel_odd.sh: 1.3 tests/net/mcast/t_mcast.sh: 1.6 tests/net/net/t_ipaddress.sh: 1.11 tests/net/net_common.sh: 1.20 tests/net/npf/t_npf.sh: 1.3 tests/net/route/t_flags.sh: 1.20 tests/net/route/t_flags6.sh: 1.16 usr.bin/netstat/fast_ipsec.c: 1.22 Do m_pullup before mtod It may fix panicks of some tests on anita/sparc and anita/GuruPlug. --- KNF --- Enable DEBUG for babylon5 --- Apply C99-style struct initialization to xformsw --- Tweak outputs of netstat -s for IPsec - Get rid of "Fast" - Use ipsec and ipsec6 for titles to clarify protocol - Indent outputs of sub protocols Original outputs were organized like this: (Fast) IPsec: IPsec ah: IPsec esp: IPsec ipip: IPsec ipcomp: (Fast) IPsec: IPsec ah: IPsec esp: IPsec ipip: IPsec ipcomp: New outputs are organized like this: ipsec: ah: esp: ipip: ipcomp: ipsec6: ah: esp: ipip: ipcomp: --- Add test cases for IPComp --- Simplify IPSEC_OSTAT macro (NFC) --- KNF; replace leading whitespaces with hard tabs --- Introduce and use SADB_SASTATE_USABLE_P --- KNF --- Add update command for testing Updating an SA (SADB_UPDATE) requires that a process issuing SADB_UPDATE is the same as a process issued SADB_ADD (or SADB_GETSPI). This means that update command must be used with add command in a configuration of setkey. This usage is normally meaningless but useful for testing (and debugging) purposes. --- Add test cases for updating SA/SP The tests require newly-added udpate command of setkey. --- PR/52346: Frank Kardel: Fix checksumming for NAT-T See XXX for improvements. --- Remove codes for PACKET_TAG_IPSEC_IN_CRYPTO_DONE It seems that PACKET_TAG_IPSEC_IN_CRYPTO_DONE is for network adapters that have IPsec accelerators; a driver sets the mtag to a packet when its device has already encrypted the packet. Unfortunately no driver implements such offload features for long years and seems unlikely to implement them soon. (Note that neither FreeBSD nor Linux doesn't have such drivers.) Let's remove related (unused) codes and simplify the IPsec code. --- Fix usages of sadb_msg_errno --- Avoid updating sav directly On SADB_UPDATE a target sav was updated directly, which was unsafe. Instead allocate another sav, copy variables of the old sav to the new one and replace the old one with the new one. --- Simplify; we can assume sav->tdb_xform cannot be NULL while it's valid --- Rename key_alloc* functions (NFC) We shouldn't use the term "alloc" for functions that just look up data and actually don't allocate memory. --- Use explicit_memset to surely zero-clear key_auth and key_enc --- Make sure to clear keys on error paths of key_setsaval --- Add missing KEY_FREESAV --- Make sure a sav is inserted to a sah list after its initialization completes --- Remove unnecessary zero-clearing codes from key_setsaval key_setsaval is now used only for a newly-allocated sav. (It was used to reset variables of an existing sav.) --- Correct wrong assumption of sav->refcnt in key_delsah A sav in a list is basically not to be sav->refcnt == 0. And also KEY_FREESAV assumes sav->refcnt > 0. --- Let key_getsavbyspi take a reference of a returning sav --- Use time_mono_to_wall (NFC) --- Separate sending message routine (NFC) --- Simplify; remove unnecessary zero-clears key_freesaval is used only when a target sav is being destroyed. --- Omit NULL checks for sav->lft_c sav->lft_c can be NULL only when initializing or destroying sav. --- Omit unnecessary NULL checks for sav->sah --- Omit unnecessary check of sav->state key_allocsa_policy picks a sav of either MATURE or DYING so we don't need to check its state again. --- Simplify; omit unnecessary saidx passing - ipsec_nextisr returns a saidx but no caller uses it - key_checkrequest is passed a saidx but it can be gotton by another argument (isr) --- Fix splx isn't called on some error paths --- Fix header size calculation of esp where sav is NULL --- Fix header size calculation of ah in the case sav is NULL This fix was also needed for esp. --- Pass sav directly to opencrypto callback In a callback, use a passed sav as-is by default and look up a sav only if the passed sav is dead. --- Avoid examining freshness of sav on packet processing If a sav list is sorted (by lft_c->sadb_lifetime_addtime) in advance, we don't need to examine each sav and also don't need to delete one on the fly and send up a message. Fortunately every sav lists are sorted as we need. Added key_validate_savlist validates that each sav list is surely sorted (run only if DEBUG because it's not cheap). --- Add test cases for SAs with different SPIs --- Prepare to stop using isr->sav isr is a shared resource and using isr->sav as a temporal storage for each packet processing is racy. And also having a reference from isr to sav makes the lifetime of sav non-deterministic; such a reference is removed when a packet is processed and isr->sav is overwritten by new one. Let's have a sav locally for each packet processing instead of using shared isr->sav. However this change doesn't stop using isr->sav yet because there are some users of isr->sav. isr->sav will be removed after the users find a way to not use isr->sav. --- Fix wrong argument handling --- fix printf format. --- Don't validate sav lists of LARVAL or DEAD states We don't sort the lists so the validation will always fail. Fix PR kern/52405 --- Make sure to sort the list when changing the state by key_sa_chgstate --- Rename key_allocsa_policy to key_lookup_sa_bysaidx --- Separate test files --- Calculate ah_max_authsize on initialization as well as esp_max_ivlen --- Remove m_tag_find(PACKET_TAG_IPSEC_PENDING_TDB) because nobody sets the tag --- Restore a comment removed in previous The comment is valid for the below code. --- Make tests more stable sleep command seems to wait longer than expected on anita so use polling to wait for a state change. --- Add tests that explicitly delete SAs instead of waiting for expirations --- Remove invalid M_AUTHIPDGM check on ESP isr->sav M_AUTHIPDGM flag is set to a mbuf in ah_input_cb. An sav of ESP can have AH authentication as sav->tdb_authalgxform. However, in that case esp_input and esp_input_cb are used to do ESP decryption and AH authentication and M_AUTHIPDGM never be set to a mbuf. So checking M_AUTHIPDGM of a mbuf on isr->sav of ESP is meaningless. --- Look up sav instead of relying on unstable sp->req->sav This code is executed only in an error path so an additional lookup doesn't matter. --- Correct a comment --- Don't release sav if calling crypto_dispatch again --- Remove extra KEY_FREESAV from ipsec_process_done It should be done by the caller. --- Don't bother the case of crp->crp_buf == NULL in callbacks --- Hold a reference to an SP during opencrypto processing An SP has a list of isr (ipsecrequest) that represents a sequence of IPsec encryption/authentication processing. One isr corresponds to one opencrypto processing. The lifetime of an isr follows its SP. We pass an isr to a callback function of opencrypto to continue to a next encryption/authentication processing. However nobody guaranteed that the isr wasn't freed, i.e., its SP wasn't destroyed. In order to avoid such unexpected destruction of isr, hold a reference to its SP during opencrypto processing. --- Don't make SAs expired on tests that delete SAs explicitly --- Fix a debug message --- Dedup error paths (NFC) --- Use pool to allocate tdb_crypto For ESP and AH, we need to allocate an extra variable space in addition to struct tdb_crypto. The fixed size of pool items may be larger than an actual requisite size of a buffer, but still the performance improvement by replacing malloc with pool wins. --- Don't use unstable isr->sav for header size calculations We may need to optimize to not look up sav here for users that don't need to know an exact size of headers (e.g., TCP segmemt size caclulation). --- Don't use sp->req->sav when handling NAT-T ESP fragmentation In order to do this we need to look up a sav however an additional look-up degrades performance. A sav is later looked up in ipsec4_process_packet so delay the fragmentation check until then to avoid an extra look-up. --- Don't use key_lookup_sp that depends on unstable sp->req->sav It provided a fast look-up of SP. We will provide an alternative method in the future (after basic MP-ification finishes). --- Stop setting isr->sav on looking up sav in key_checkrequest --- Remove ipsecrequest#sav --- Stop setting mtag of PACKET_TAG_IPSEC_IN_DONE because there is no users anymore --- Skip ipsec_spi_*_*_preferred_new_timeout when running on qemu Probably due to PR 43997 --- Add localcount to rump kernels --- Remove unused macro --- Fix key_getcomb_setlifetime The fix adjusts a soft limit to be 80% of a corresponding hard limit. I'm not sure the fix is really correct though, at least the original code is wrong. A passed comb is zero-cleared before calling key_getcomb_setlifetime, so comb->sadb_comb_soft_addtime = comb->sadb_comb_soft_addtime * 80 / 100; is meaningless. --- Provide and apply key_sp_refcnt (NFC) It simplifies further changes. --- Fix indentation Pointed out by knakahara@@ --- Use pslist(9) for sptree --- Don't acquire global locks for IPsec if NET_MPSAFE Note that the change is just to make testing easy and IPsec isn't MP-safe yet. --- Let PF_KEY socks hold their own lock instead of softnet_lock Operations on SAD and SPD are executed via PF_KEY socks. The operations include deletions of SAs and SPs that will use synchronization mechanisms such as pserialize_perform to wait for references to SAs and SPs to be released. It is known that using such mechanisms with holding softnet_lock causes a dead lock. We should avoid the situation. --- Make IPsec SPD MP-safe We use localcount(9), not psref(9), to make the sptree and secpolicy (SP) entries MP-safe because SPs need to be referenced over opencrypto processing that executes a callback in a different context. SPs on sockets aren't managed by the sptree and can be destroyed in softint. localcount_drain cannot be used in softint so we delay the destruction of such SPs to a thread context. To do so, a list to manage such SPs is added (key_socksplist) and key_timehandler_spd deletes dead SPs in the list. For more details please read the locking notes in key.c. Proposed on tech-kern@@ and tech-net@@ --- Fix updating ipsec_used - key_update_used wasn't called in key_api_spddelete2 and key_api_spdflush - key_update_used wasn't called if an SP had been added/deleted but a reply to userland failed --- Fix updating ipsec_used; turn on when SPs on sockets are added --- Add missing IPsec policy checks to icmp6_rip6_input icmp6_rip6_input is quite similar to rip6_input and the same checks exist in rip6_input. --- Add test cases for setsockopt(IP_IPSEC_POLICY) --- Don't use KEY_NEWSP for dummy SP entries By the change KEY_NEWSP is now not called from softint anymore and we can use kmem_zalloc with KM_SLEEP for KEY_NEWSP. --- Comment out unused functions --- Add test cases that there are SPs but no relevant SAs --- Don't allow sav->lft_c to be NULL lft_c of an sav that was created by SADB_GETSPI could be NULL. --- Clean up clunky eval strings - Remove unnecessary \ at EOL - This allows to omit ; too - Remove unnecessary quotes for arguments of atf_set - Don't expand $DEBUG in eval - We expect it's expanded on execution Suggested by kre@@ --- Remove unnecessary KEY_FREESAV in an error path sav should be freed (unreferenced) by the caller. --- Use pslist(9) for sahtree --- Use pslist(9) for sah->savtree --- Rename local variable newsah to sah It may not be new. --- MP-ify SAD slightly - Introduce key_sa_mtx and use it for some list operations - Use pserialize for some list iterations --- Introduce KEY_SA_UNREF and replace KEY_FREESAV with it where sav will never be actually freed in the future KEY_SA_UNREF is still key_freesav so no functional change for now. This change reduces diff of further changes. --- Remove out-of-date log output Pointed out by riastradh@@ --- Use KDASSERT instead of KASSERT for mutex_ownable Because mutex_ownable is too heavy to run in a fast path even for DIAGNOSTIC + LOCKDEBUG. Suggested by riastradh@@ --- Assemble global lists and related locks into cache lines (NFCI) Also rename variable names from *tree to *list because they are just lists, not trees. Suggested by riastradh@@ --- Move locking notes --- Update the locking notes - Add locking order - Add locking notes for misc lists such as reglist - Mention pserialize, key_sp_ref and key_sp_unref on SP operations Requested by riastradh@@ --- Describe constraints of key_sp_ref and key_sp_unref Requested by riastradh@@ --- Hold key_sad.lock on SAVLIST_WRITER_INSERT_TAIL --- Add __read_mostly to key_psz Suggested by riastradh@@ --- Tweak wording (pserialize critical section => pserialize read section) Suggested by riastradh@@ --- Add missing mutex_exit --- Fix setkey -D -P outputs The outputs were tweaked (by me), but I forgot updating libipsec in my local ATF environment... --- MP-ify SAD (key_sad.sahlist and sah entries) localcount(9) is used to protect key_sad.sahlist and sah entries as well as SPD (and will be used for SAD sav). Please read the locking notes of SAD for more details. --- Introduce key_sa_refcnt and replace sav->refcnt with it (NFC) --- Destroy sav only in the loop for DEAD sav --- Fix KASSERT(solocked(sb->sb_so)) failure in sbappendaddr that is called eventually from key_sendup_mbuf If key_sendup_mbuf isn't passed a socket, the assertion fails. Originally in this case sb->sb_so was softnet_lock and callers held softnet_lock so the assertion was magically satisfied. Now sb->sb_so is key_so_mtx and also softnet_lock isn't always held by callers so the assertion can fail. Fix it by holding key_so_mtx if key_sendup_mbuf isn't passed a socket. Reported by knakahara@@ Tested by knakahara@@ and ozaki-r@@ --- Fix locking notes of SAD --- Fix deadlock between key_sendup_mbuf called from key_acquire and localcount_drain If we call key_sendup_mbuf from key_acquire that is called on packet processing, a deadlock can happen like this: - At key_acquire, a reference to an SP (and an SA) is held - key_sendup_mbuf will try to take key_so_mtx - Some other thread may try to localcount_drain to the SP with holding key_so_mtx in say key_api_spdflush - In this case localcount_drain never return because key_sendup_mbuf that has stuck on key_so_mtx never release a reference to the SP Fix the deadlock by deferring key_sendup_mbuf to the timer (key_timehandler). --- Fix that prev isn't cleared on retry --- Limit the number of mbufs queued for deferred key_sendup_mbuf It's easy to be queued hundreds of mbufs on the list under heavy network load. --- MP-ify SAD (savlist) localcount(9) is used to protect savlist of sah. The basic design is similar to MP-ifications of SPD and SAD sahlist. Please read the locking notes of SAD for more details. --- Simplify ipsec_reinject_ipstack (NFC) --- Add per-CPU rtcache to ipsec_reinject_ipstack It reduces route lookups and also reduces rtcache lock contentions when NET_MPSAFE is enabled. --- Use pool_cache(9) instead of pool(9) for tdb_crypto objects The change improves network throughput especially on multi-core systems. --- Update ipsec(4), opencrypto(9) and vlan(4) are now MP-safe. --- Write known issues on scalability --- Share a global dummy SP between PCBs It's never be changed so it can be pre-allocated and shared safely between PCBs. --- Fix race condition on the rawcb list shared by rtsock and keysock keysock now protects itself by its own mutex, which means that the rawcb list is protected by two different mutexes (keysock's one and softnet_lock for rtsock), of course it's useless. Fix the situation by having a discrete rawcb list for each. --- Use a dedicated mutex for rt_rawcb instead of softnet_lock if NET_MPSAFE --- fix localcount leak in sav. fixed by ozaki-r@@n.o. I commit on behalf of him. --- remove unnecessary comment. --- Fix deadlock between pserialize_perform and localcount_drain A typical ussage of localcount_drain looks like this: mutex_enter(&mtx); item = remove_from_list(); pserialize_perform(psz); localcount_drain(&item->localcount, &cv, &mtx); mutex_exit(&mtx); This sequence can cause a deadlock which happens for example on the following situation: - Thread A calls localcount_drain which calls xc_broadcast after releasing a specified mutex - Thread B enters the sequence and calls pserialize_perform with holding the mutex while pserialize_perform also calls xc_broadcast - Thread C (xc_thread) that calls an xcall callback of localcount_drain tries to hold the mutex xc_broadcast of thread B doesn't start until xc_broadcast of thread A finishes, which is a feature of xcall(9). This means that pserialize_perform never complete until xc_broadcast of thread A finishes. On the other hand, thread C that is a callee of xc_broadcast of thread A sticks on the mutex. Finally the threads block each other (A blocks B, B blocks C and C blocks A). A possible fix is to serialize executions of the above sequence by another mutex, but adding another mutex makes the code complex, so fix the deadlock by another way; the fix is to release the mutex before pserialize_perform and instead use a condvar to prevent pserialize_perform from being called simultaneously. Note that the deadlock has happened only if NET_MPSAFE is enabled. --- Add missing ifdef NET_MPSAFE --- Take softnet_lock on pr_input properly if NET_MPSAFE Currently softnet_lock is taken unnecessarily in some cases, e.g., icmp_input and encap4_input from ip_input, or not taken even if needed, e.g., udp_input and tcp_input from ipsec4_common_input_cb. Fix them. NFC if NET_MPSAFE is disabled (default). --- - sanitize key debugging so that we don't print extra newlines or unassociated debugging messages. - remove unused functions and make internal ones static - print information in one line per message --- humanize printing of ip addresses --- cast reduction, NFC. --- Fix typo in comment --- Pull out ipsec_fill_saidx_bymbuf (NFC) --- Don't abuse key_checkrequest just for looking up sav It does more than expected for example key_acquire. --- Fix SP is broken on transport mode isr->saidx was modified accidentally in ipsec_nextisr. Reported by christos@@ Helped investigations by christos@@ and knakahara@@ --- Constify isr at many places (NFC) --- Include socketvar.h for softnet_lock --- Fix buffer length for ipsec_logsastr @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.117 2017/04/14 02:43:28 ozaki-r Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.117 2017/04/14 02:43:28 ozaki-r Exp $"); a72 1 #include "opt_net_mpsafe.h" a186 33 #ifdef NET_MPSAFE PR_WRAP_INPUT6(udp6_input) PR_WRAP_INPUT6(tcp6_input) #ifdef DCCP PR_WRAP_INPUT6(dccp6_input) #endif #ifdef SCTP PR_WRAP_INPUT6(sctp6_input) #endif PR_WRAP_INPUT6(rip6_input) PR_WRAP_INPUT6(dest6_input) PR_WRAP_INPUT6(route6_input) PR_WRAP_INPUT6(frag6_input) #if NETHERIP > 0 PR_WRAP_INPUT6(ip6_etherip_input) #endif #if NPFSYNC > 0 PR_WRAP_INPUT6(pfsync_input) #endif PR_WRAP_INPUT6(pim6_input) #define udp6_input udp6_input_wrapper #define tcp6_input tcp6_input_wrapper #define dccp6_input dccp6_input_wrapper #define sctp6_input sctp6_input_wrapper #define rip6_input rip6_input_wrapper #define dest6_input dest6_input_wrapper #define route6_input route6_input_wrapper #define frag6_input frag6_input_wrapper #define ip6_etherip_input ip6_etherip_input_wrapper #define pim6_input pim6_input_wrapper #endif @ 1.117.4.2 log @Pull up following revision(s) (requested by ozaki-r in ticket #305): distrib/sets/lists/tests/mi: revision 1.762 sys/net/route.c: revision 1.198-1.201 sys/net/route.h: revision 1.114 sys/netatalk/at_proto.c: revision 1.22 sys/netinet/in_proto.c: revision 1.124 sys/netinet6/in6_proto.c: revision 1.118 sys/netmpls/mpls_proto.c: revision 1.31 sys/netnatm/natm_proto.c: revision 1.18 sys/rump/net/lib/libsockin/sockin.c: revision 1.65 sys/sys/domain.h: revision 1.33 tests/net/route/Makefile: revision 1.6 tests/net/route/t_rtcache.sh: revision 1.1 Add tests of rtcache invalidation Remove unnecessary NULL check of rt_ifp It's always non-NULL. Invalidate rtcache based on a global generation counter The change introduces a global generation counter that is incremented when any routes have been added or deleted. When a rtcache caches a rtentry into itself, it also stores a snapshot of the generation counter. If the snapshot equals to the global counter, the cache is still valid, otherwise invalidated. One drawback of the change is that all rtcaches of all protocol families are invalidated when any routes of any protocol families are added or deleted. If that matters, we should have separate generation counters based on protocol families. This change removes LIST_ENTRY from struct route, which fixes a part of PR kern/52515. Remove the global lock for rtcache Thanks to removal of LIST_ENTRY of struct route, rtcaches are accessed only by their users. And in existing usages a rtcache is guranteed to be not accessed simultaneously. So the rtcache framework doesn't need any exclusion controls in itself. Synchronize on rtcache_generation with rtlock It's racy if NET_MPSAFE is enabled. Pointed out by joerg@@ @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.117.4.1 2017/10/21 19:43:54 snj Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.117.4.1 2017/10/21 19:43:54 snj Exp $"); d527 1 @ 1.117.4.3 log @Pull up following revision(s) (requested by maxv in ticket #672): sys/netinet6/in6_proto.c: revision 1.120 Change ip6_hdrnestlimit to be 15 instead of 50. I couldn't find any reference in RFCs about what a correct limit should be, but FreeBSD already uses 15. If an IPv6 packet has 50 options, there is clearly something wrong with it. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.117.4.2 2017/10/24 08:55:55 snj Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.117.4.2 2017/10/24 08:55:55 snj Exp $"); d572 1 a572 1 int ip6_hdrnestlimit = 15; /* appropriate? */ @ 1.117.4.4 log @Pull up following revision(s) (requested by maxv in ticket #676): sys/netinet/in_proto.c: revision 1.127 sys/netinet6/in6_proto.c: revision 1.122 Add the PR_LASTHDR flag on the PFsync and CARP entries. Otherwise a "require" IPsec policy is not enforced on them, and unauthenticated packets will be accepted. Tested with a require-AH configuration. Sent on tech-net@@, no comment. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.117.4.3 2018/03/30 12:01:30 martin Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.117.4.3 2018/03/30 12:01:30 martin Exp $"); d456 1 a456 1 .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, @ 1.117.4.5 log @Pull up following revision(s) (requested by roy in ticket #821): sys/netinet6/in6_proto.c: revision 1.125 sys/net/raw_cb.h: revision 1.29 sys/kern/uipc_usrreq.c: revision 1.186 Increase the default size of some receive buffers from 8k to 16k. This mitigates recent reports of socket overflow errors and fixes PR bin/53247. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.117.4.4 2018/03/31 10:41:06 martin Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.117.4.4 2018/03/31 10:41:06 martin Exp $"); d608 1 a608 1 #define RIPV6RCVQ 16384 @ 1.116 log @add l2tp(4) L2TPv3 interface. originally implemented by IIJ SEIL team. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.115 2017/02/13 07:18:20 ozaki-r Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.115 2017/02/13 07:18:20 ozaki-r Exp $"); a187 1 PR_WRAP_CTLINPUT(ah6_ctlinput) d189 36 a224 2 #define ah6_ctlinput ah6_ctlinput_wrapper #endif d226 1 a226 1 #if defined(IPSEC) d229 3 d233 2 a234 1 #endif @ 1.115 log @Protect mtudisc and redirect stuffs of icmp/icmp6 with mutex We have to run pr_init of icmp and icmp6 prior to tcp and tcp6 ones for mutex initialization. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.114 2016/12/13 08:29:03 ozaki-r Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.114 2016/12/13 08:29:03 ozaki-r Exp $"); d393 10 @ 1.114 log @Remove unnecessary inclusions of nd6.h @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.113 2016/07/06 10:49:49 ozaki-r Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.113 2016/07/06 10:49:49 ozaki-r Exp $"); d216 10 a309 10 .pr_protocol = IPPROTO_ICMPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = icmp6_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = icmp6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = icmp6_init, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, @ 1.114.2.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.117 2017/04/14 02:43:28 ozaki-r Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.117 2017/04/14 02:43:28 ozaki-r Exp $"); d188 1 d190 2 a191 8 #ifdef IPSEC_RUMPKERNEL /* * .pr_input = ipsec6_common_input won't be resolved on loading * the ipsec shared library. We need a wrapper anyway. */ static int ipsec6_common_input_wrapper(struct mbuf **mp, int *offp, int proto) { d193 1 a193 29 if (ipsec_enabled) { return ipsec6_common_input(mp, offp, proto); } else { m_freem(*mp); return IPPROTO_DONE; } } #define ipsec6_common_input ipsec6_common_input_wrapper /* The ctlinput functions may not be loaded */ #define IPSEC_WRAP_CTLINPUT(name) \ static void * \ name##_wrapper(int a, const struct sockaddr *b, void *c)\ { \ void *rv; \ KERNEL_LOCK(1, NULL); \ if (ipsec_enabled) \ rv = name(a, b, c); \ else \ rv = NULL; \ KERNEL_UNLOCK_ONE(NULL); \ return rv; \ } IPSEC_WRAP_CTLINPUT(ah6_ctlinput) IPSEC_WRAP_CTLINPUT(esp6_ctlinput) #else /* !IPSEC_RUMPKERNEL */ PR_WRAP_CTLINPUT(ah6_ctlinput) a195 3 #endif /* !IPSEC_RUMPKERNEL */ #define ah6_ctlinput ah6_ctlinput_wrapper d197 1 a197 2 #endif /* IPSEC */ a215 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ICMPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = icmp6_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = icmp6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = icmp6_init, }, d300 10 a392 10 .pr_protocol = IPPROTO_L2TP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = encap_init, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, @ 1.113 log @Move in6_ifaddr_list to a more proper place (from ip6_input.c to in6.c) It's a similar place as the IPv4 address list, i.e., in.c. More varibles will join together. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.112 2016/04/26 08:44:45 ozaki-r Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.112 2016/04/26 08:44:45 ozaki-r Exp $"); a121 2 #include @ 1.113.2.1 log @Sync with HEAD. (Note that most of these changes are simply $NetBSD$ tag issues.) @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.114 2016/12/13 08:29:03 ozaki-r Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.114 2016/12/13 08:29:03 ozaki-r Exp $"); d122 2 @ 1.113.2.2 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.116 2017/02/16 08:12:44 knakahara Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.116 2017/02/16 08:12:44 knakahara Exp $"); a215 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ICMPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = icmp6_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = icmp6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = icmp6_init, }, d300 10 a392 10 .pr_protocol = IPPROTO_L2TP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = encap_init, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, @ 1.113.2.3 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.117 2017/04/14 02:43:28 ozaki-r Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.117 2017/04/14 02:43:28 ozaki-r Exp $"); d188 1 d190 2 a191 8 #ifdef IPSEC_RUMPKERNEL /* * .pr_input = ipsec6_common_input won't be resolved on loading * the ipsec shared library. We need a wrapper anyway. */ static int ipsec6_common_input_wrapper(struct mbuf **mp, int *offp, int proto) { d193 1 a193 29 if (ipsec_enabled) { return ipsec6_common_input(mp, offp, proto); } else { m_freem(*mp); return IPPROTO_DONE; } } #define ipsec6_common_input ipsec6_common_input_wrapper /* The ctlinput functions may not be loaded */ #define IPSEC_WRAP_CTLINPUT(name) \ static void * \ name##_wrapper(int a, const struct sockaddr *b, void *c)\ { \ void *rv; \ KERNEL_LOCK(1, NULL); \ if (ipsec_enabled) \ rv = name(a, b, c); \ else \ rv = NULL; \ KERNEL_UNLOCK_ONE(NULL); \ return rv; \ } IPSEC_WRAP_CTLINPUT(ah6_ctlinput) IPSEC_WRAP_CTLINPUT(esp6_ctlinput) #else /* !IPSEC_RUMPKERNEL */ PR_WRAP_CTLINPUT(ah6_ctlinput) a195 3 #endif /* !IPSEC_RUMPKERNEL */ #define ah6_ctlinput ah6_ctlinput_wrapper d197 1 a197 2 #endif /* IPSEC */ @ 1.112 log @Sweep unnecessary route.h inclusions @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.111 2016/04/11 08:56:16 ozaki-r Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.111 2016/04/11 08:56:16 ozaki-r Exp $"); d424 1 a424 1 in6_init(void) d432 1 a432 1 .dom_init = in6_init, .dom_externalize = NULL, .dom_dispose = NULL, @ 1.111 log @Sweep unncessary radix.h inclusions @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.110 2016/01/21 15:41:30 riastradh Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.110 2016/01/21 15:41:30 riastradh Exp $"); a82 1 #include @ 1.110 log @Revert previous: ran cvs commit when I meant cvs diff. Sorry! Hit up-arrow one too few times. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.108 2016/01/20 21:44:00 riastradh Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.108 2016/01/20 21:44:00 riastradh Exp $"); a82 1 #include @ 1.109 log @Give proper prototype to ip_output. @ text @d213 1 a213 3 { .ip6pr_protosw = { .pr_domain = &inet6domain, a218 1 }, d220 1 a220 3 { .ip6pr_protosw = { .pr_type = SOCK_DGRAM, d224 1 a228 2 }, .ip6pr_input = udp6_input, d230 1 a230 3 { .ip6pr_protosw = { .pr_type = SOCK_STREAM, d234 1 a240 2 }, .ip6pr_input = tcp6_input, d243 1 a243 3 { .ip6pr_protosw = { .pr_type = SOCK_CONN_DGRAM, d247 1 a253 2 }, .ip6pr_input = dccp6_input, d257 1 a257 3 { .ip6pr_protosw = { .pr_type = SOCK_DGRAM, d261 1 a265 2 }, .ip6pr_input = sctp6_input, d267 1 a267 3 { .ip6pr_protosw = { .pr_type = SOCK_SEQPACKET, d271 1 a274 2 }, .ip6pr_input = sctp6_input, d276 1 a276 3 { .ip6pr_protosw = { .pr_type = SOCK_STREAM, d280 1 a283 2 }, .ip6pr_input = sctp6_input, d286 1 a286 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d290 1 a293 2 }, .ip6pr_input = rip6_input, d296 1 a296 3 { .ip6pr_protosw = { .pr_domain = &inet6domain, a299 1 }, d302 1 a302 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d306 1 a310 2 }, .ip6pr_input = icmp6_input, d312 1 a312 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d316 1 a316 2 }, .ip6pr_input = dest6_input, d318 1 a318 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d322 1 a322 2 }, .ip6pr_input = route6_input, d324 1 a324 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d328 1 a328 2 }, .ip6pr_input = frag6_input, d331 1 a331 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d335 1 a336 2 }, .ip6pr_input = ipsec6_common_input, d338 1 a338 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d342 1 a343 2 }, .ip6pr_input = ipsec6_common_input, d345 1 a345 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d349 1 a349 2 }, .ip6pr_input = ipsec6_common_input, d353 1 a353 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d357 1 a361 2 }, .ip6pr_input = encap6_input, d364 1 a364 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d368 1 a372 2 }, .ip6pr_input = encap6_input, d375 1 a375 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d379 1 a382 2 }, .ip6pr_input = ip6_etherip_input, d386 1 a386 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d390 1 a392 2 }, .ip6pr_input = carp6_proto_input, d395 1 a395 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d399 1 a402 2 }, .ip6pr_input = pim6_input, d405 1 a405 3 { .ip6pr_protosw = { .pr_type = SOCK_RAW, d408 1 a411 2 }, .ip6pr_input = rip6_input, @ 1.108 log @Eliminate struct protosw::pr_output. You can't use this unless you know what it is a priori: the formal prototype is variadic, and the different instances (e.g., ip_output, route_output) have different real prototypes. Convert the only user of it, raw_send in net/raw_cb.c, to take an explicit callback argument. Convert the only instances of it, route_output and key_output, to such explicit callbacks for raw_send. Use assertions to make sure the conversion to explicit callbacks is warranted. Discussed on tech-net with no objections: https://mail-index.netbsd.org/tech-net/2016/01/16/msg005484.html @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.107 2015/10/13 21:28:35 rjs Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.107 2015/10/13 21:28:35 rjs Exp $"); d213 3 a215 1 { .pr_domain = &inet6domain, d221 1 d223 3 a225 1 { .pr_type = SOCK_DGRAM, a228 1 .pr_input = udp6_input, d233 2 d236 3 a238 1 { .pr_type = SOCK_STREAM, a241 1 .pr_input = tcp6_input, d248 2 d252 3 a254 1 { .pr_type = SOCK_CONN_DGRAM, a257 1 .pr_input = dccp6_input, d264 2 d269 3 a271 1 { .pr_type = SOCK_DGRAM, a274 1 .pr_input = sctp6_input, d279 2 d282 3 a284 1 { .pr_type = SOCK_SEQPACKET, a287 1 .pr_input = sctp6_input, d291 2 d294 3 a296 1 { .pr_type = SOCK_STREAM, a299 1 .pr_input = sctp6_input, d303 2 d307 3 a309 1 { .pr_type = SOCK_RAW, a312 1 .pr_input = rip6_input, d316 2 d320 3 a322 1 { .pr_domain = &inet6domain, d326 1 d329 3 a331 1 { .pr_type = SOCK_RAW, a334 1 .pr_input = icmp6_input, d339 2 d342 3 a344 1 { .pr_type = SOCK_RAW, d348 2 a349 1 .pr_input = dest6_input, d351 3 a353 1 { .pr_type = SOCK_RAW, d357 2 a358 1 .pr_input = route6_input, d360 3 a362 1 { .pr_type = SOCK_RAW, d366 2 a367 1 .pr_input = frag6_input, d370 3 a372 1 { .pr_type = SOCK_RAW, a375 1 .pr_input = ipsec6_common_input, d377 2 d380 3 a382 1 { .pr_type = SOCK_RAW, a385 1 .pr_input = ipsec6_common_input, d387 2 d390 3 a392 1 { .pr_type = SOCK_RAW, d396 2 a397 1 .pr_input = ipsec6_common_input, d401 3 a403 1 { .pr_type = SOCK_RAW, a406 1 .pr_input = encap6_input, d411 2 d415 3 a417 1 { .pr_type = SOCK_RAW, a420 1 .pr_input = encap6_input, d425 2 d429 3 a431 1 { .pr_type = SOCK_RAW, a434 1 .pr_input = ip6_etherip_input, d438 2 d443 3 a445 1 { .pr_type = SOCK_RAW, a448 1 .pr_input = carp6_proto_input, d451 2 d455 3 a457 1 { .pr_type = SOCK_RAW, a460 1 .pr_input = pim6_input, d464 2 d468 3 a470 1 { .pr_type = SOCK_RAW, a472 1 .pr_input = rip6_input, d476 2 @ 1.107 log @Add core networking support for SCTP. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.106 2015/08/24 22:21:27 pooka Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.106 2015/08/24 22:21:27 pooka Exp $"); a290 1 .pr_output = rip6_output, a306 1 .pr_output = rip6_output, a357 1 .pr_output = rip6_output, a368 1 .pr_output = rip6_output, a379 1 .pr_output = rip6_output, a390 1 .pr_output = rip6_output, a399 1 .pr_output = rip6_output, a408 1 .pr_output = rip6_output, @ 1.106 log @sprinkle _KERNEL_OPT @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.105 2015/04/22 19:46:08 roy Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.105 2015/04/22 19:46:08 roy Exp $"); d72 1 d115 7 d183 8 d256 30 @ 1.105 log @Move INET6 specific in6_if_{up,down}() and in6_if_link_{up,down}() into agnostic domain functions. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.104 2015/02/10 19:11:52 rjs Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.104 2015/02/10 19:11:52 rjs Exp $"); d67 1 d72 1 @ 1.104 log @Add DCCP protocol support from KAME. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.103 2014/06/05 23:48:16 rmind Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.103 2014/06/05 23:48:16 rmind Exp $"); d400 1 d402 1 @ 1.103 log @- Implement pktqueue interface for lockless IP input queue. - Replace ipintrq and ip6intrq with the pktqueue mechanism. - Eliminate kernel-lock from ipintr() and ip6intr(). - Some preparation work to push softnet_lock out of ipintr(). Discussed on tech-net. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.102 2014/05/22 22:56:53 rmind Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.102 2014/05/22 22:56:53 rmind Exp $"); d70 1 d106 6 d165 8 d224 14 @ 1.103.4.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.104 2015/02/10 19:11:52 rjs Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.104 2015/02/10 19:11:52 rjs Exp $"); a69 1 #include "opt_dccp.h" a104 6 #ifdef DCCP #include #include #include #endif a157 8 #if defined(DCCP) PR_WRAP_CTLINPUT(dccp6_ctlinput) PR_WRAP_CTLOUTPUT(dccp_ctloutput) #define dccp6_ctlinput dccp6_ctlinput_wrapper #define dccp_ctloutput dccp_ctloutput_wrapper #endif a208 14 #ifdef DCCP { .pr_type = SOCK_CONN_DGRAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_DCCP, .pr_flags = PR_CONNREQUIRED|PR_ATOMIC|PR_LISTEN, .pr_input = dccp6_input, .pr_ctlinput = dccp6_ctlinput, .pr_ctloutput = dccp_ctloutput, .pr_usrreqs = &dccp6_usrreqs, #ifndef INET .pr_init = dccp_init, #endif }, #endif /* DCCP */ @ 1.103.4.2 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.103.4.1 2015/04/06 15:18:23 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.103.4.1 2015/04/06 15:18:23 skrll Exp $"); a399 1 .dom_if_up = in6_if_up, .dom_if_down = in6_if_down, a400 1 .dom_if_link_state_change = in6_if_link_state_change, @ 1.103.4.3 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.103.4.2 2015/06/06 14:40:26 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.103.4.2 2015/06/06 14:40:26 skrll Exp $"); a66 1 #ifdef _KERNEL_OPT a70 1 #endif @ 1.103.4.4 log @Sync with HEAD (as of 26th Dec) @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.103.4.3 2015/09/22 12:06:11 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.103.4.3 2015/09/22 12:06:11 skrll Exp $"); a71 1 #include "opt_sctp.h" a113 7 #ifdef SCTP #include #include #include #include #endif a174 8 #if defined(SCTP) PR_WRAP_CTLINPUT(sctp6_ctlinput) PR_WRAP_CTLOUTPUT(sctp_ctloutput) #define sctp6_ctlinput sctp6_ctlinput_wrapper #define sctp_ctloutput sctp_ctloutput_wrapper #endif a239 30 #ifdef SCTP { .pr_type = SOCK_DGRAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_ADDR_OPT|PR_WANTRCVD, .pr_input = sctp6_input, .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_usrreqs = &sctp6_usrreqs, .pr_drain = sctp_drain, }, { .pr_type = SOCK_SEQPACKET, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_ADDR_OPT|PR_WANTRCVD, .pr_input = sctp6_input, .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_drain = sctp_drain, }, { .pr_type = SOCK_STREAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_CONNREQUIRED|PR_ADDR_OPT|PR_WANTRCVD|PR_LISTEN, .pr_input = sctp6_input, .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_drain = sctp_drain, }, #endif /* SCTP */ @ 1.103.4.5 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.103.4.4 2015/12/27 12:10:07 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.103.4.4 2015/12/27 12:10:07 skrll Exp $"); d291 1 d308 1 d360 1 d372 1 d384 1 d396 1 d406 1 d416 1 @ 1.103.4.6 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.103.4.5 2016/03/19 11:30:33 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.103.4.5 2016/03/19 11:30:33 skrll Exp $"); d83 1 @ 1.103.4.7 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.103.4.6 2016/04/22 15:44:18 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.103.4.6 2016/04/22 15:44:18 skrll Exp $"); d83 1 @ 1.103.4.8 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.103.4.7 2016/05/29 08:44:39 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.103.4.7 2016/05/29 08:44:39 skrll Exp $"); d424 1 a424 1 in6_dom_init(void) d432 1 a432 1 .dom_init = in6_dom_init, .dom_externalize = NULL, .dom_dispose = NULL, @ 1.103.4.9 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.103.4.8 2016/07/09 20:25:22 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.103.4.8 2016/07/09 20:25:22 skrll Exp $"); d122 2 @ 1.103.4.10 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.103.4.9 2017/02/05 13:40:59 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.103.4.9 2017/02/05 13:40:59 skrll Exp $"); d188 1 d190 2 a191 8 #ifdef IPSEC_RUMPKERNEL /* * .pr_input = ipsec6_common_input won't be resolved on loading * the ipsec shared library. We need a wrapper anyway. */ static int ipsec6_common_input_wrapper(struct mbuf **mp, int *offp, int proto) { d193 1 a193 29 if (ipsec_enabled) { return ipsec6_common_input(mp, offp, proto); } else { m_freem(*mp); return IPPROTO_DONE; } } #define ipsec6_common_input ipsec6_common_input_wrapper /* The ctlinput functions may not be loaded */ #define IPSEC_WRAP_CTLINPUT(name) \ static void * \ name##_wrapper(int a, const struct sockaddr *b, void *c)\ { \ void *rv; \ KERNEL_LOCK(1, NULL); \ if (ipsec_enabled) \ rv = name(a, b, c); \ else \ rv = NULL; \ KERNEL_UNLOCK_ONE(NULL); \ return rv; \ } IPSEC_WRAP_CTLINPUT(ah6_ctlinput) IPSEC_WRAP_CTLINPUT(esp6_ctlinput) #else /* !IPSEC_RUMPKERNEL */ PR_WRAP_CTLINPUT(ah6_ctlinput) a195 3 #endif /* !IPSEC_RUMPKERNEL */ #define ah6_ctlinput ah6_ctlinput_wrapper d197 1 a197 2 #endif /* IPSEC */ a215 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ICMPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = icmp6_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = icmp6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = icmp6_init, }, d300 10 a392 10 .pr_protocol = IPPROTO_L2TP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = encap_init, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, @ 1.102 log @Move udp6_input(), udp6_sendup(), udp6_realinput() and udp6_input_checksum() from udp_usrreq.c to udp6_usrreq.c where they belong. No functional change. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.101 2014/05/18 14:46:16 rmind Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.101 2014/05/18 14:46:16 rmind Exp $"); d372 1 a372 1 .dom_ifqueues = { &ip6intrq, NULL }, @ 1.101 log @Add struct pr_usrreqs with a pr_generic function and prepare for the dismantling of pr_usrreq in the protocols; no functional change intended. PRU_ATTACH/PRU_DETACH changes will follow soon. Bump for struct protosw. Welcome to 6.99.62! @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.100 2014/01/02 18:29:01 pooka Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.100 2014/01/02 18:29:01 pooka Exp $"); a470 5 /* UDP on IP6 parameters */ int udp6_sendspace = 9216; /* really max datagram size */ int udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6)); /* 40 1K datagrams */ @ 1.100 log @Allow kernels compiled with INET+INET6 to be booted as IPv4-only or IPv6-only. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.99 2013/06/05 19:01:26 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.99 2013/06/05 19:01:26 christos Exp $"); a137 8 PR_WRAP_USRREQ(rip6_usrreq) PR_WRAP_USRREQ(udp6_usrreq) PR_WRAP_USRREQ(tcp_usrreq) #define rip6_usrreq rip6_usrreq_wrapper #define udp6_usrreq udp6_usrreq_wrapper #define tcp_usrreq tcp_usrreq_wrapper d194 1 a194 1 .pr_usrreq = udp6_usrreq, d204 1 a204 1 .pr_usrreq = tcp_usrreq, d217 1 a217 1 .pr_usrreq = rip6_usrreq, d234 1 a234 1 .pr_usrreq = rip6_usrreq, d286 1 a286 1 .pr_usrreq = rip6_usrreq, d298 1 a298 1 .pr_usrreq = rip6_usrreq, d310 1 a310 1 .pr_usrreq = rip6_usrreq, d321 1 a321 1 .pr_usrreq = rip6_usrreq, d331 1 a331 1 .pr_usrreq = rip6_usrreq, d341 1 a341 1 .pr_usrreq = rip6_usrreq, @ 1.100.2.1 log @Rebase. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.103 2014/06/05 23:48:16 rmind Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.103 2014/06/05 23:48:16 rmind Exp $"); d138 8 d202 1 a202 1 .pr_usrreqs = &udp6_usrreqs, d212 1 a212 1 .pr_usrreqs = &tcp_usrreqs, d225 1 a225 1 .pr_usrreqs = &rip6_usrreqs, d242 1 a242 1 .pr_usrreqs = &rip6_usrreqs, d294 1 a294 1 .pr_usrreqs = &rip6_usrreqs, d306 1 a306 1 .pr_usrreqs = &rip6_usrreqs, d318 1 a318 1 .pr_usrreqs = &rip6_usrreqs, d329 1 a329 1 .pr_usrreqs = &rip6_usrreqs, d339 1 a339 1 .pr_usrreqs = &rip6_usrreqs, d349 1 a349 1 .pr_usrreqs = &rip6_usrreqs, d380 1 a380 1 .dom_ifqueues = { NULL, NULL }, d479 5 @ 1.99 log @IPSEC has not come in two speeds for a long time now (IPSEC == kame, FAST_IPSEC). Make everything refer to IPSEC to avoid confusion. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.98 2013/03/01 18:25:58 joerg Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.98 2013/03/01 18:25:58 joerg Exp $"); d178 9 d213 1 a213 2 #ifndef INET /* don't call initialization and timeout routines twice */ .pr_init = tcp_init, a214 1 .pr_slowtimo = tcp_slowtimo, a215 1 #endif d363 8 d373 1 a373 1 .dom_init = NULL, .dom_externalize = NULL, .dom_dispose = NULL, @ 1.99.2.1 log @Checkpoint work in progress: - Initial split of the protocol user-request method into the following methods: pr_attach, pr_detach and pr_generic for old the pr_usrreq. - Adjust socreate(9) and sonewconn(9) to call pr_attach without the socket lock held (as a preparation for the locking scheme adjustment). - Adjust all pr_attach routines to assert that PCB is not set. - Sprinkle various comments, document some routines and their locking. - Remove M_PCB, replace with kmem(9). - Fix few bugs spotted on the way. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.99 2013/06/05 19:01:26 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.99 2013/06/05 19:01:26 christos Exp $"); d138 8 d193 1 a193 1 .pr_usrreqs = &udp6_usrreqs, d203 1 a203 1 .pr_usrreqs = &tcp_usrreqs, d219 1 a219 1 .pr_usrreqs = &rip6_usrreqs, d236 1 a236 1 .pr_usrreqs = &rip6_usrreqs, d288 1 a288 1 .pr_usrreqs = &rip6_usrreqs, d300 1 a300 1 .pr_usrreqs = &rip6_usrreqs, d312 1 a312 1 .pr_usrreqs = &rip6_usrreqs, d323 1 a323 1 .pr_usrreqs = &rip6_usrreqs, d333 1 a333 1 .pr_usrreqs = &rip6_usrreqs, d343 1 a343 1 .pr_usrreqs = &rip6_usrreqs, @ 1.99.2.2 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.99.2.1 2013/08/28 15:21:48 rmind Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.99.2.1 2013/08/28 15:21:48 rmind Exp $"); a169 9 static void tcp6_init(void) { icmp6_mtudisc_callback_register(tcp6_mtudisc_callback); tcp_init_common(sizeof(struct ip6_hdr)); } d196 2 a197 1 .pr_init = tcp6_init, d199 1 d201 1 a348 8 bool in6_present = false; static void in6_init(void) { in6_present = true; } d351 1 a351 1 .dom_init = in6_init, .dom_externalize = NULL, .dom_dispose = NULL, @ 1.98 log @Retire OSI network stack. OK core@@ @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.97 2012/06/23 03:14:03 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.97 2012/06/23 03:14:03 christos Exp $"); d109 1 a109 1 #ifdef FAST_IPSEC d113 1 a113 1 #endif /* FAST_IPSEC */ d166 1 a166 1 #if defined(FAST_IPSEC) d172 1 a172 1 #if defined(FAST_IPSEC) d257 1 a257 1 #ifdef FAST_IPSEC d278 1 a278 1 #endif /* FAST_IPSEC */ @ 1.97 log @4 new sysctls to avoid ipv6 DoS attacks from OpenBSD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.96 2012/03/22 20:34:40 drochner Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.96 2012/03/22 20:34:40 drochner Exp $"); a69 1 #include "opt_iso.h" a325 14 #ifdef ISO { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_EON, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, /*XXX*/ .pr_init = encap_init, }, #endif @ 1.97.2.1 log @resync from head @ text @d1 1 a1 1 /* $NetBSD$ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD$"); d70 1 d110 1 a110 1 #ifdef IPSEC d114 1 a114 1 #endif /* IPSEC */ d167 1 a167 1 #if defined(IPSEC) d173 1 a173 1 #if defined(IPSEC) d258 1 a258 1 #ifdef IPSEC d279 1 a279 1 #endif /* IPSEC */ d327 14 @ 1.97.2.2 log @Rebase to HEAD as of a few days ago. @ text @d138 8 a177 9 static void tcp6_init(void) { icmp6_mtudisc_callback_register(tcp6_mtudisc_callback); tcp_init_common(sizeof(struct ip6_hdr)); } d193 1 a193 1 .pr_usrreqs = &udp6_usrreqs, d203 3 a205 2 .pr_usrreqs = &tcp_usrreqs, .pr_init = tcp6_init, d207 1 d209 1 d219 1 a219 1 .pr_usrreqs = &rip6_usrreqs, d236 1 a236 1 .pr_usrreqs = &rip6_usrreqs, d288 1 a288 1 .pr_usrreqs = &rip6_usrreqs, d300 1 a300 1 .pr_usrreqs = &rip6_usrreqs, d312 1 a312 1 .pr_usrreqs = &rip6_usrreqs, d323 1 a323 1 .pr_usrreqs = &rip6_usrreqs, d333 1 a333 1 .pr_usrreqs = &rip6_usrreqs, d343 1 a343 1 .pr_usrreqs = &rip6_usrreqs, a356 8 bool in6_present = false; static void in6_init(void) { in6_present = true; } d359 1 a359 1 .dom_init = in6_init, .dom_externalize = NULL, .dom_dispose = NULL, d366 1 a366 1 .dom_ifqueues = { NULL, NULL }, d465 5 @ 1.97.2.3 log @update from HEAD @ text @a66 1 #ifdef _KERNEL_OPT a69 4 #include "opt_dccp.h" #include "opt_sctp.h" #include "opt_net_mpsafe.h" #endif d79 2 d105 1 a105 12 #ifdef DCCP #include #include #include #endif #ifdef SCTP #include #include #include #include #endif d107 1 a107 1 #include d158 2 a159 3 #if defined(DCCP) PR_WRAP_CTLINPUT(dccp6_ctlinput) PR_WRAP_CTLOUTPUT(dccp_ctloutput) d161 1 a161 43 #define dccp6_ctlinput dccp6_ctlinput_wrapper #define dccp_ctloutput dccp_ctloutput_wrapper #endif #if defined(SCTP) PR_WRAP_CTLINPUT(sctp6_ctlinput) PR_WRAP_CTLOUTPUT(sctp_ctloutput) #define sctp6_ctlinput sctp6_ctlinput_wrapper #define sctp_ctloutput sctp_ctloutput_wrapper #endif #ifdef NET_MPSAFE PR_WRAP_INPUT6(udp6_input) PR_WRAP_INPUT6(tcp6_input) #ifdef DCCP PR_WRAP_INPUT6(dccp6_input) #endif #ifdef SCTP PR_WRAP_INPUT6(sctp6_input) #endif PR_WRAP_INPUT6(rip6_input) PR_WRAP_INPUT6(dest6_input) PR_WRAP_INPUT6(route6_input) PR_WRAP_INPUT6(frag6_input) #if NETHERIP > 0 PR_WRAP_INPUT6(ip6_etherip_input) #endif #if NPFSYNC > 0 PR_WRAP_INPUT6(pfsync_input) #endif PR_WRAP_INPUT6(pim6_input) #define udp6_input udp6_input_wrapper #define tcp6_input tcp6_input_wrapper #define dccp6_input dccp6_input_wrapper #define sctp6_input sctp6_input_wrapper #define rip6_input rip6_input_wrapper #define dest6_input dest6_input_wrapper #define route6_input route6_input_wrapper #define frag6_input frag6_input_wrapper #define ip6_etherip_input ip6_etherip_input_wrapper #define pim6_input pim6_input_wrapper a164 39 #ifdef IPSEC_RUMPKERNEL /* * .pr_input = ipsec6_common_input won't be resolved on loading * the ipsec shared library. We need a wrapper anyway. */ static int ipsec6_common_input_wrapper(struct mbuf **mp, int *offp, int proto) { if (ipsec_enabled) { return ipsec6_common_input(mp, offp, proto); } else { m_freem(*mp); return IPPROTO_DONE; } } #define ipsec6_common_input ipsec6_common_input_wrapper /* The ctlinput functions may not be loaded */ #define IPSEC_WRAP_CTLINPUT(name) \ static void * \ name##_wrapper(int a, const struct sockaddr *b, void *c)\ { \ void *rv; \ KERNEL_LOCK(1, NULL); \ if (ipsec_enabled) \ rv = name(a, b, c); \ else \ rv = NULL; \ KERNEL_UNLOCK_ONE(NULL); \ return rv; \ } IPSEC_WRAP_CTLINPUT(ah6_ctlinput) IPSEC_WRAP_CTLINPUT(esp6_ctlinput) #else /* !IPSEC_RUMPKERNEL */ PR_WRAP_CTLINPUT(ah6_ctlinput) a166 3 #endif /* !IPSEC_RUMPKERNEL */ #define ah6_ctlinput ah6_ctlinput_wrapper d168 1 a168 2 #endif /* IPSEC */ a186 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ICMPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = icmp6_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = icmp6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = icmp6_init, }, a208 44 #ifdef DCCP { .pr_type = SOCK_CONN_DGRAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_DCCP, .pr_flags = PR_CONNREQUIRED|PR_ATOMIC|PR_LISTEN, .pr_input = dccp6_input, .pr_ctlinput = dccp6_ctlinput, .pr_ctloutput = dccp_ctloutput, .pr_usrreqs = &dccp6_usrreqs, #ifndef INET .pr_init = dccp_init, #endif }, #endif /* DCCP */ #ifdef SCTP { .pr_type = SOCK_DGRAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_ADDR_OPT|PR_WANTRCVD, .pr_input = sctp6_input, .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_usrreqs = &sctp6_usrreqs, .pr_drain = sctp_drain, }, { .pr_type = SOCK_SEQPACKET, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_ADDR_OPT|PR_WANTRCVD, .pr_input = sctp6_input, .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_drain = sctp_drain, }, { .pr_type = SOCK_STREAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_SCTP, .pr_flags = PR_CONNREQUIRED|PR_ADDR_OPT|PR_WANTRCVD|PR_LISTEN, .pr_input = sctp6_input, .pr_ctlinput = sctp6_ctlinput, .pr_ctloutput = sctp_ctloutput, .pr_drain = sctp_drain, }, #endif /* SCTP */ d214 1 d228 11 d283 1 d295 1 d307 1 d319 1 a325 10 .pr_protocol = IPPROTO_L2TP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreqs = &rip6_usrreqs, .pr_init = encap_init, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, d329 1 d339 1 d357 1 a357 1 in6_dom_init(void) d365 1 a365 1 .dom_init = in6_dom_init, .dom_externalize = NULL, .dom_dispose = NULL, a370 1 .dom_if_up = in6_if_up, .dom_if_down = in6_if_down, a371 1 .dom_if_link_state_change = in6_if_link_state_change, d379 1 @ 1.96 log @remove KAME IPSEC, replaced by FAST_IPSEC @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.95 2011/12/31 20:41:59 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.95 2011/12/31 20:41:59 christos Exp $"); d442 4 @ 1.95 log @- fix offsetof usage, and redundant defines - kill pointer casts to 0 @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.94 2011/12/19 11:59:58 drochner Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.94 2011/12/19 11:59:58 drochner Exp $"); a109 9 #ifdef KAME_IPSEC #include #include #ifdef IPSEC_ESP #include #endif #include #endif /* KAME_IPSEC */ d167 1 a167 1 #if defined(KAME_IPSEC) || defined(FAST_IPSEC) d173 1 a173 1 #if (defined(KAME_IPSEC) && defined(IPSEC_ESP)) || defined(FAST_IPSEC) a257 27 #ifdef KAME_IPSEC { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_AH, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ah6_input, .pr_ctlinput = ah6_ctlinput, .pr_init = ah6_init, }, #ifdef IPSEC_ESP { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ESP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = esp6_input, .pr_ctlinput = esp6_ctlinput, .pr_init = esp6_init, }, #endif { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPCOMP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipcomp6_input, .pr_init = ipcomp6_init, }, #endif /* KAME_IPSEC */ @ 1.95.8.1 log @Pull up revisions: src/share/man/man7/sysctl.7 revision 1.73 via patch src/sys/netinet6/icmp6.c revision 1.161 via patch src/sys/netinet6/in6.c revision 1.161 via patch src/sys/netinet6/in6_proto.c revision 1.97 via patch src/sys/netinet6/in6_var.h revision 1.65 via patch src/sys/netinet6/ip6_input.c revision 1.139 via patch src/sys/netinet6/ip6_var.h revision 1.59 via patch src/sys/netinet6/nd6.c revision 1.143 via patch src/sys/netinet6/nd6.h revision 1.57 via patch src/sys/netinet6/nd6_rtr.c revision 1.83 via patch (requested by christos in ticket #905). Patch by Loganaden Velvindron. 4 new sysctls to avoid ipv6 DoS attacks from OpenBSD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.95 2011/12/31 20:41:59 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.95 2011/12/31 20:41:59 christos Exp $"); a477 4 int ip6_neighborgcthresh = 2048; /* Threshold # of NDP entries for GC */ int ip6_maxifprefixes = 16; /* Max acceptable prefixes via RA per IF */ int ip6_maxifdefrouters = 16; /* Max acceptable def routers via RA */ int ip6_maxdynroutes = 4096; /* Max # of routes created via redirect */ @ 1.95.6.1 log @Pull up revisions: src/share/man/man7/sysctl.7 revision 1.73 via patch src/sys/netinet6/icmp6.c revision 1.161 via patch src/sys/netinet6/in6.c revision 1.161 via patch src/sys/netinet6/in6_proto.c revision 1.97 via patch src/sys/netinet6/in6_var.h revision 1.65 via patch src/sys/netinet6/ip6_input.c revision 1.139 via patch src/sys/netinet6/ip6_var.h revision 1.59 via patch src/sys/netinet6/nd6.c revision 1.143 via patch src/sys/netinet6/nd6.h revision 1.57 via patch src/sys/netinet6/nd6_rtr.c revision 1.83 via patch (requested by christos in ticket #905). Patch by Loganaden Velvindron. 4 new sysctls to avoid ipv6 DoS attacks from OpenBSD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.95 2011/12/31 20:41:59 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.95 2011/12/31 20:41:59 christos Exp $"); a477 4 int ip6_neighborgcthresh = 2048; /* Threshold # of NDP entries for GC */ int ip6_maxifprefixes = 16; /* Max acceptable prefixes via RA per IF */ int ip6_maxifdefrouters = 16; /* Max acceptable def routers via RA */ int ip6_maxdynroutes = 4096; /* Max # of routes created via redirect */ @ 1.95.2.1 log @Pull up revisions: src/share/man/man7/sysctl.7 revision 1.73 via patch src/sys/netinet6/icmp6.c revision 1.161 via patch src/sys/netinet6/in6.c revision 1.161 via patch src/sys/netinet6/in6_proto.c revision 1.97 via patch src/sys/netinet6/in6_var.h revision 1.65 via patch src/sys/netinet6/ip6_input.c revision 1.139 via patch src/sys/netinet6/ip6_var.h revision 1.59 via patch src/sys/netinet6/nd6.c revision 1.143 via patch src/sys/netinet6/nd6.h revision 1.57 via patch src/sys/netinet6/nd6_rtr.c revision 1.83 via patch (requested by christos in ticket #905). Patch by Loganaden Velvindron. 4 new sysctls to avoid ipv6 DoS attacks from OpenBSD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.95 2011/12/31 20:41:59 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.95 2011/12/31 20:41:59 christos Exp $"); a477 4 int ip6_neighborgcthresh = 2048; /* Threshold # of NDP entries for GC */ int ip6_maxifprefixes = 16; /* Max acceptable prefixes via RA per IF */ int ip6_maxifdefrouters = 16; /* Max acceptable def routers via RA */ int ip6_maxdynroutes = 4096; /* Max # of routes created via redirect */ @ 1.94 log @rename the IPSEC in-kernel CPP variable and config(8) option to KAME_IPSEC, and make IPSEC define it so that existing kernel config files work as before Now the default can be easily be changed to FAST_IPSEC just by setting the IPSEC alias to FAST_IPSEC. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.93 2011/09/24 17:22:14 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.93 2011/09/24 17:22:14 christos Exp $"); a139 4 #ifndef offsetof /* XXX */ #define offsetof(type, member) ((size_t)(&((type *)0)->member)) #endif d480 1 a480 1 time_t ip6_log_time = (time_t)0L; @ 1.93 log @Add inet6 part of the rfc6056 code contributed by Vlad Balan as part of Google SoC-2011 @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.92 2011/05/24 18:07:11 spz Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.92 2011/05/24 18:07:11 spz Exp $"); d110 1 a110 1 #ifdef IPSEC d117 1 a117 1 #endif /* IPSEC */ d180 1 a180 1 #if defined(IPSEC) || defined(FAST_IPSEC) d186 1 a186 1 #if (defined(IPSEC) && defined(IPSEC_ESP)) || defined(FAST_IPSEC) d271 1 a271 1 #ifdef IPSEC d297 1 a297 1 #endif /* IPSEC */ @ 1.93.2.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.93 2011/09/24 17:22:14 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.93 2011/09/24 17:22:14 christos Exp $"); d110 9 d140 4 d180 1 a180 1 #if defined(FAST_IPSEC) d186 1 a186 1 #if defined(FAST_IPSEC) d271 27 d484 1 a484 1 time_t ip6_log_time = 0; @ 1.93.2.2 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.93.2.1 2012/04/17 00:08:43 yamt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.93.2.1 2012/04/17 00:08:43 yamt Exp $"); a441 4 int ip6_neighborgcthresh = 2048; /* Threshold # of NDP entries for GC */ int ip6_maxifprefixes = 16; /* Max acceptable prefixes via RA per IF */ int ip6_maxifdefrouters = 16; /* Max acceptable def routers via RA */ int ip6_maxdynroutes = 4096; /* Max # of routes created via redirect */ @ 1.93.2.3 log @sync with head. for a reference, the tree before this commit was tagged as yamt-pagecache-tag8. this commit was splitted into small chunks to avoid a limitation of cvs. ("Protocol error: too many arguments") @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.93.2.2 2012/10/30 17:22:48 yamt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.93.2.2 2012/10/30 17:22:48 yamt Exp $"); d70 1 d110 1 a110 1 #ifdef IPSEC d114 1 a114 1 #endif /* IPSEC */ d167 1 a167 1 #if defined(IPSEC) d173 1 a173 1 #if defined(IPSEC) a178 9 static void tcp6_init(void) { icmp6_mtudisc_callback_register(tcp6_mtudisc_callback); tcp_init_common(sizeof(struct ip6_hdr)); } d205 2 a206 1 .pr_init = tcp6_init, d208 1 d210 1 d258 1 a258 1 #ifdef IPSEC d279 1 a279 1 #endif /* IPSEC */ d327 14 a371 8 bool in6_present = false; static void in6_init(void) { in6_present = true; } d374 1 a374 1 .dom_init = in6_init, .dom_externalize = NULL, .dom_dispose = NULL, @ 1.93.6.1 log @merge to -current. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.95 2011/12/31 20:41:59 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.95 2011/12/31 20:41:59 christos Exp $"); d110 1 a110 1 #ifdef KAME_IPSEC d117 1 a117 1 #endif /* KAME_IPSEC */ d140 4 d180 1 a180 1 #if defined(KAME_IPSEC) || defined(FAST_IPSEC) d186 1 a186 1 #if (defined(KAME_IPSEC) && defined(IPSEC_ESP)) || defined(FAST_IPSEC) d271 1 a271 1 #ifdef KAME_IPSEC d297 1 a297 1 #endif /* KAME_IPSEC */ d484 1 a484 1 time_t ip6_log_time = 0; @ 1.93.6.2 log @sync to latest -current. @ text @d1 1 a1 1 /* $NetBSD$ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD$"); d110 9 d176 1 a176 1 #if defined(FAST_IPSEC) d182 1 a182 1 #if defined(FAST_IPSEC) d267 27 @ 1.92 log @RA flood mitigation via a limit on accepted routes: - introduce a limit for the routes accepted via IPv6 Router Advertisement: a common 2 interface client will have 6, the default limit is 100 and can be adjusted via sysctl - report the current number of routes installed via RA via sysctl - count discarded route additions. Note that one RA message is two routes. This is at present only across all interfaces even though per-interface would be more useful, since the per-interface structure complies to RFC2466 - bump kernel version due to the previous change - adjust netstat to use the new value (with netstat -p icmp6) @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.91 2011/05/03 17:44:30 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.91 2011/05/03 17:44:30 dyoung Exp $"); a170 1 PR_WRAP_CTLOUTPUT(ip6_ctloutput) d172 1 a175 1 #define ip6_ctloutput ip6_ctloutput_wrapper d177 1 d206 1 a206 1 .pr_ctloutput = ip6_ctloutput, @ 1.91 log @*_drain() routines may be called with locks held, so instead of doing any work in *_drain(), set a drain-needed flag. Do the work in the fasttimo handler. Contributed by Coyote Point Systems, Inc. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.90 2011/03/31 19:40:52 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.90 2011/03/31 19:40:52 dyoung Exp $"); d485 7 @ 1.90 log @Hide the radix-trie implementation of the forwarding table so that we will have an easier time replacing it with something different, even if it is a second radix-trie implementation. sys/net/route.c and sys/net/rtsock.c no longer operate directly on radix_nodes or radix_node_heads. Hopefully this will reduce the temptation to implement multipath or source-based routing using grotty hacks to the grotty old radix-trie code, too. :-) @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.89 2010/08/24 00:07:00 jakllsch Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.89 2010/08/24 00:07:00 jakllsch Exp $"); d196 1 d198 1 a198 1 .pr_drain = frag6_drain, d220 1 d222 1 a222 1 .pr_drain = tcp_drain, @ 1.89 log @Make the EtherIP in IPv6 input path work. XXX: Figure out if we really need a separate protosw for IPv6. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.88 2010/02/04 21:48:35 joerg Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.88 2010/02/04 21:48:35 joerg Exp $"); d415 1 a415 1 .dom_rtattach = rn_inithead, @ 1.89.2.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.92 2011/05/24 18:07:11 spz Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.92 2011/05/24 18:07:11 spz Exp $"); a195 1 .pr_fasttimo = frag6_fasttimo, d197 1 a197 1 .pr_drain = frag6_drainstub, a218 1 .pr_fasttimo = tcp_fasttimo, d220 1 a220 1 .pr_drain = tcp_drainstub, d415 1 a415 1 .dom_rtattach = rt_inithead, a482 7 int ip6_rtadv_maxroutes = 100; /* (arbitrary) initial maximum number of * routes via rtadv expected to be * significantly larger than common use. * if you need to count: 3 extra initial * routes, plus 1 per interface after the * first one, then one per non-linklocal * prefix */ @ 1.88 log @Explicitly include opt_gateway.h when depending on GATEWAY. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.87 2009/09/11 22:06:29 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.87 2009/09/11 22:06:29 dyoung Exp $"); d132 1 a132 1 #if NETHERIP > 1 d342 1 a342 1 #if NETHERIP > 1 @ 1.88.4.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD$ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD$"); d132 1 a132 1 #if NETHERIP > 0 d342 1 a342 1 #if NETHERIP > 0 @ 1.88.4.2 log @sync with head @ text @d415 1 a415 1 .dom_rtattach = rt_inithead, @ 1.88.4.3 log @sync with head @ text @a195 1 .pr_fasttimo = frag6_fasttimo, d197 1 a197 1 .pr_drain = frag6_drainstub, a218 1 .pr_fasttimo = tcp_fasttimo, d220 1 a220 1 .pr_drain = tcp_drainstub, a482 7 int ip6_rtadv_maxroutes = 100; /* (arbitrary) initial maximum number of * routes via rtadv expected to be * significantly larger than common use. * if you need to count: 3 extra initial * routes, plus 1 per interface after the * first one, then one per non-linklocal * prefix */ @ 1.88.2.1 log @Sync with HEAD (-D20101022). @ text @d1 1 a1 1 /* $NetBSD$ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD$"); d132 1 a132 1 #if NETHERIP > 0 d342 1 a342 1 #if NETHERIP > 0 @ 1.87 log @Make ifconfig(8) set and display preference numbers for IPv6 addresses. Make the kernel support SIOC[SG]IFADDRPREF for IPv6 interface addresses. In in6ifa_ifpforlinklocal(), consult preference numbers before making an otherwise arbitrary choice of in6_ifaddr. Otherwise, preference numbers are *not* consulted by the kernel, but that will be rather easy for somebody with a little bit of free time to fix. Please note that setting the preference number for a link-local IPv6 address does not work right, yet, but that ought to be fixed soon. In support of the changes above, 1 Add a method to struct domain for "externalizing" a sockaddr, and provide an implementation for IPv6. Expect more work in this area: it may be more proper to say that the IPv6 implementation "internalizes" a sockaddr. Add sockaddr_externalize(). 2 Add a subroutine, sofamily(), that returns a struct socket's address family or AF_UNSPEC. 3 Make a lot of IPv4-specific code generic, and move it from sys/netinet/ to sys/net/ for re-use by IPv6 parts of the kernel and ifconfig(8). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.86 2009/09/11 20:10:06 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.86 2009/09/11 20:10:06 dyoung Exp $"); d67 1 @ 1.86 log @Nothing uses sockaddr_in6_cmp() right now, and the generic sockaddr_cmp() is probably as fast or faster than calling sockaddr_in6_cmp() through a function pointer, so let's stop compiling it. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.85 2009/08/21 16:52:43 tsutsui Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.85 2009/08/21 16:52:43 tsutsui Exp $"); d424 1 @ 1.85 log @Fix error on kernels with options IPSEC without options IPSEC_ESP. Found on building evbppc/conf/PMPPC. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.84 2009/03/23 18:43:20 liamjfoy Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.84 2009/03/23 18:43:20 liamjfoy Exp $"); d427 1 d449 1 @ 1.84 log @Init ip6flow pool dynamically instead of using a linkset. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.83 2008/11/25 18:28:06 pooka Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.83 2008/11/25 18:28:06 pooka Exp $"); d181 5 a187 1 #define ah6_ctlinput ah6_ctlinput_wrapper @ 1.83 log @Make dom_maxrtkey of inet/inet6domain the size of the ip_encap pack structures. This is far from optimal, but gets rid of iffy #ifdef INET in radix.c. The radix bonsai still needs lots of love before loading domains dynamically is possible... @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.82 2008/04/24 11:38:38 ad Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.82 2008/04/24 11:38:38 ad Exp $"); d232 1 @ 1.83.4.1 log @Sync with HEAD. Commit is split, to avoid a "too many arguments" protocol error. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.84 2009/03/23 18:43:20 liamjfoy Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.84 2009/03/23 18:43:20 liamjfoy Exp $"); a231 1 .pr_init = ip6flow_poolinit, @ 1.82 log @Merge the socket locking patch: - Socket layer becomes MP safe. - Unix protocols become MP safe. - Allows protocol processing interrupts to safely block on locks. - Fixes a number of race conditions. With much feedback from matt@@ and plunky@@. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.81 2008/04/23 06:09:05 thorpej Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.81 2008/04/23 06:09:05 thorpej Exp $"); d411 1 a411 1 .dom_maxrtkey = sizeof(struct sockaddr_in6), @ 1.82.12.1 log @Pull up following revision(s) (requested by jakllsch in ticket #1445): sys/netinet6/ip6_etherip.h: revision 1.2 sys/netinet6/in6_proto.c: revision 1.89 sys/netinet6/ip6_etherip.c: revision 1.14 Make the EtherIP in IPv6 input path work. XXX: Figure out if we really need a separate protosw for IPv6. @ text @d1 1 a1 1 /* $NetBSD$ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD$"); d131 1 a131 1 #if NETHERIP > 0 d336 1 a336 1 #if NETHERIP > 0 @ 1.82.12.1.2.1 log @If using hardware checksum offload and the packet can't be h/w checksumed (for whatever reason, some hardware is stupid) allow the driver to calculate the checksum instead. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.82.12.1 2010/11/21 20:45:39 riz Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.82.12.1 2010/11/21 20:45:39 riz Exp $"); a180 2 #if defined(IPSEC_ESP) || defined(FAST_IPSEC) a181 1 #endif @ 1.82.2.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.82 2008/04/24 11:38:38 ad Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.82 2008/04/24 11:38:38 ad Exp $"); a231 1 .pr_init = ip6flow_poolinit, d411 1 a411 1 .dom_maxrtkey = sizeof(struct ip_pack6), @ 1.82.2.2 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.82.2.1 2009/05/04 08:14:18 yamt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.82.2.1 2009/05/04 08:14:18 yamt Exp $"); d181 1 a183 5 #endif #if (defined(IPSEC) && defined(IPSEC_ESP)) || defined(FAST_IPSEC) PR_WRAP_CTLINPUT(esp6_ctlinput) a419 1 .dom_sockaddr_externalize = sockaddr_in6_externalize, a422 1 #if 0 a443 1 #endif @ 1.82.2.3 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.82.2.2 2009/09/16 13:38:02 yamt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.82.2.2 2009/09/16 13:38:02 yamt Exp $"); a66 1 #include "opt_gateway.h" @ 1.82.2.4 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.82.2.3 2010/03/11 15:04:29 yamt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.82.2.3 2010/03/11 15:04:29 yamt Exp $"); d132 1 a132 1 #if NETHERIP > 0 d342 1 a342 1 #if NETHERIP > 0 @ 1.82.10.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.83 2008/11/25 18:28:06 pooka Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.83 2008/11/25 18:28:06 pooka Exp $"); d411 1 a411 1 .dom_maxrtkey = sizeof(struct ip_pack6), @ 1.82.10.2 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.82.10.1 2009/01/19 13:20:14 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.82.10.1 2009/01/19 13:20:14 skrll Exp $"); a231 1 .pr_init = ip6flow_poolinit, @ 1.82.8.1 log @Update haad-dm branch to haad-dm-base2. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.83 2008/11/25 18:28:06 pooka Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.83 2008/11/25 18:28:06 pooka Exp $"); d411 1 a411 1 .dom_maxrtkey = sizeof(struct ip_pack6), @ 1.81 log @Make IPSEC and FAST_IPSEC stats per-cpu. Use and netstat_sysctl(). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.80 2008/04/15 05:40:15 thorpej Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.80 2008/04/15 05:40:15 thorpej Exp $"); d149 38 @ 1.80 log @Make pim6 stats per-cpu. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.79 2007/09/19 04:33:44 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.79 2007/09/19 04:33:44 dyoung Exp $"); d232 1 d241 1 d249 1 @ 1.80.2.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.80 2008/04/15 05:40:15 thorpej Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.80 2008/04/15 05:40:15 thorpej Exp $"); a148 38 /* Wrappers to acquire kernel_lock. */ PR_WRAP_USRREQ(rip6_usrreq) PR_WRAP_USRREQ(udp6_usrreq) PR_WRAP_USRREQ(tcp_usrreq) #define rip6_usrreq rip6_usrreq_wrapper #define udp6_usrreq udp6_usrreq_wrapper #define tcp_usrreq tcp_usrreq_wrapper PR_WRAP_CTLINPUT(rip6_ctlinput) PR_WRAP_CTLINPUT(encap6_ctlinput) PR_WRAP_CTLINPUT(udp6_ctlinput) PR_WRAP_CTLINPUT(tcp6_ctlinput) #define rip6_ctlinput rip6_ctlinput_wrapper #define encap6_ctlinput encap6_ctlinput_wrapper #define udp6_ctlinput udp6_ctlinput_wrapper #define tcp6_ctlinput tcp6_ctlinput_wrapper PR_WRAP_CTLOUTPUT(rip6_ctloutput) PR_WRAP_CTLOUTPUT(ip6_ctloutput) PR_WRAP_CTLOUTPUT(tcp_ctloutput) PR_WRAP_CTLOUTPUT(icmp6_ctloutput) #define rip6_ctloutput rip6_ctloutput_wrapper #define ip6_ctloutput ip6_ctloutput_wrapper #define tcp_ctloutput tcp_ctloutput_wrapper #define icmp6_ctloutput icmp6_ctloutput_wrapper #if defined(IPSEC) || defined(FAST_IPSEC) PR_WRAP_CTLINPUT(ah6_ctlinput) PR_WRAP_CTLINPUT(esp6_ctlinput) #define ah6_ctlinput ah6_ctlinput_wrapper #define esp6_ctlinput esp6_ctlinput_wrapper #endif a231 1 .pr_init = ah6_init, a239 1 .pr_init = esp6_init, a246 1 .pr_init = ipcomp6_init, @ 1.79 log @1) Introduce a new socket option, (SOL_SOCKET, SO_NOHEADER), that tells a socket that it should both add a protocol header to tx'd datagrams and remove the header from rx'd datagrams: int onoff = 1, s = socket(...); setsockopt(s, SOL_SOCKET, SO_NOHEADER, &onoff); 2) Add an implementation of (SOL_SOCKET, SO_NOHEADER) for raw IPv4 sockets. 3) Reorganize the protocols' pr_ctloutput implementations a bit. Consistently return ENOPROTOOPT when an option is unsupported, and EINVAL if a supported option's arguments are incorrect. Reorganize the flow of code so that it's more clear how/when options are passed down the stack until they are handled. Shorten some pr_ctloutput staircases for readability. 4) Extract common mbuf code into subroutines, add new sockaddr methods, and introduce a new subroutine, fsocreate(), for reuse later; use it first in sys_socket(): struct mbuf *m_getsombuf(struct socket *so) Create an mbuf and make its owner the socket `so'. struct mbuf *m_intopt(struct socket *so, int val) Create an mbuf, make its owner the socket `so', put the int `val' into it, and set its length to sizeof(int). int fsocreate(..., int *fd) Create a socket, a la socreate(9), put the socket into the given LWP's descriptor table, return the descriptor at `fd' on success. void *sockaddr_addr(struct sockaddr *sa, socklen_t *slenp) const void *sockaddr_const_addr(const struct sockaddr *sa, socklen_t *slenp) Extract a pointer to the address part of a sockaddr. Write the length of the address part at `slenp', if `slenp' is not NULL. socklen_t sockaddr_getlen(const struct sockaddr *sa) Return the length of a sockaddr. This just evaluates to sa->sa_len. I only add this for consistency with code that appears in a portable userland library that I am going to import. const struct sockaddr *sockaddr_any(const struct sockaddr *sa) Return the "don't care" sockaddr in the same family as `sa'. This is the address a client should sobind(9) if it does not care the source address and, if applicable, the port et cetera that it uses. const void *sockaddr_anyaddr(const struct sockaddr *sa, socklen_t *slenp) Return the "don't care" sockaddr in the same family as `sa'. This is the address a client should sobind(9) if it does not care the source address and, if applicable, the port et cetera that it uses. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.78 2007/08/30 02:17:38 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.78 2007/08/30 02:17:38 dyoung Exp $"); d340 1 @ 1.79.20.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD$ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD$"); a148 38 /* Wrappers to acquire kernel_lock. */ PR_WRAP_USRREQ(rip6_usrreq) PR_WRAP_USRREQ(udp6_usrreq) PR_WRAP_USRREQ(tcp_usrreq) #define rip6_usrreq rip6_usrreq_wrapper #define udp6_usrreq udp6_usrreq_wrapper #define tcp_usrreq tcp_usrreq_wrapper PR_WRAP_CTLINPUT(rip6_ctlinput) PR_WRAP_CTLINPUT(encap6_ctlinput) PR_WRAP_CTLINPUT(udp6_ctlinput) PR_WRAP_CTLINPUT(tcp6_ctlinput) #define rip6_ctlinput rip6_ctlinput_wrapper #define encap6_ctlinput encap6_ctlinput_wrapper #define udp6_ctlinput udp6_ctlinput_wrapper #define tcp6_ctlinput tcp6_ctlinput_wrapper PR_WRAP_CTLOUTPUT(rip6_ctloutput) PR_WRAP_CTLOUTPUT(ip6_ctloutput) PR_WRAP_CTLOUTPUT(tcp_ctloutput) PR_WRAP_CTLOUTPUT(icmp6_ctloutput) #define rip6_ctloutput rip6_ctloutput_wrapper #define ip6_ctloutput ip6_ctloutput_wrapper #define tcp_ctloutput tcp_ctloutput_wrapper #define icmp6_ctloutput icmp6_ctloutput_wrapper #if defined(IPSEC) || defined(FAST_IPSEC) PR_WRAP_CTLINPUT(ah6_ctlinput) PR_WRAP_CTLINPUT(esp6_ctlinput) #define ah6_ctlinput ah6_ctlinput_wrapper #define esp6_ctlinput esp6_ctlinput_wrapper #endif a231 1 .pr_init = ah6_init, a239 1 .pr_init = esp6_init, a246 1 .pr_init = ipcomp6_init, a339 1 .pr_init = pim6_init, @ 1.79.20.2 log @Sync with HEAD. @ text @d411 1 a411 1 .dom_maxrtkey = sizeof(struct ip_pack6), @ 1.79.16.1 log @imported Mobile IPv6 code developed by the SHISA project (http://www.mobileip.jp/). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.79 2007/09/19 04:33:44 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.79 2007/09/19 04:33:44 dyoung Exp $"); a134 4 #ifdef MOBILE_IPV6 #include #endif /* MOBILE_IPV6 */ a224 11 #ifdef MOBILE_IPV6 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_MH, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = mip6_input, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, }, #endif /* MOBILE_IPV6 */ a352 18 POOL_INIT(sockaddr_in6_pool, sizeof(struct sockaddr_in6), 0, 0, 0, "sockaddr_in6_pool", NULL, IPL_NET); #ifdef MOBILE_IPV6 /* To receive tunneled packet on mobile node or home agent */ struct ip6protosw mip6_tunnel_protosw = { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = mip6_tunnel_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, }; #endif /* MOBILE_IPV6 */ @ 1.78 log @Use malloc(9) for sockaddrs instead of pool(9), and remove dom_sa_pool and dom_sa_len members from struct domain. Pools of fixed-size objects are too rigid for sockaddr_dls, whose size can vary over a wide range. Return sockaddr_dl to its "historical" size. Now that I'm using malloc(9) instead of pool(9) to allocate sockaddr_dl, I can create a sockaddr_dl of any size in the kernel, so expanding sockaddr_dl is useless. Avoid using sizeof(struct sockaddr_dl) in the kernel. Introduce sockaddr_dl_alloc() for allocating & initializing an arbitrary sockaddr_dl on the heap. Add an argument, the sockaddr length, to sockaddr_alloc(), sockaddr_copy(), and sockaddr_dl_setaddr(). Constify: LLADDR() -> CLLADDR(). Where the kernel overwrites LLADDR(), use sockaddr_dl_setaddr(), instead. Used properly, sockaddr_dl_setaddr() will not overrun the end of the sockaddr. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.77 2007/05/06 02:56:37 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.77 2007/05/06 02:56:37 dyoung Exp $"); d203 1 a203 1 .pr_ctloutput = rip6_ctloutput, d353 9 d376 1 @ 1.77 log @In AppleTalk, IPv4, and IPv6 routing domains, help sockaddr_cmp() avoid an indirect function call by comparing the family, length, and bytes [dom->dom_sa_cmpofs, dom->dom_sa_cmpofs + dom->dom_sa_cmplen), corresponding to the the sockaddrs' "address" members. For ISO, actually use sockaddr_iso_cmp, for a change. Thanks to yamt@@ for pointing out my error. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.76 2007/05/02 20:40:26 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.76 2007/05/02 20:40:26 dyoung Exp $"); a352 3 POOL_INIT(sockaddr_in6_pool, sizeof(struct sockaddr_in6), 0, 0, 0, "sockaddr_in6_pool", NULL, IPL_NET); a364 2 .dom_sa_pool = &sockaddr_in6_pool, .dom_sa_len = sizeof(struct sockaddr_in6), @ 1.77.8.1 log @sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.79 2007/09/19 04:33:44 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.79 2007/09/19 04:33:44 dyoung Exp $"); d203 1 a203 1 .pr_ctloutput = icmp6_ctloutput, d353 2 a354 8 static const struct sockaddr_in6 in6_any = { .sin6_len = sizeof(in6_any) , .sin6_family = AF_INET6 , .sin6_port = 0 , .sin6_flowinfo = 0 , .sin6_addr = IN6ADDR_ANY_INIT , .sin6_scope_id = 0 }; d368 2 a371 1 .dom_sa_any = (const struct sockaddr *)&in6_any, @ 1.77.6.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.78 2007/08/30 02:17:38 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.78 2007/08/30 02:17:38 dyoung Exp $"); d353 3 d368 2 @ 1.77.6.2 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.79 2007/09/19 04:33:44 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.79 2007/09/19 04:33:44 dyoung Exp $"); d203 1 a203 1 .pr_ctloutput = icmp6_ctloutput, a352 9 static const struct sockaddr_in6 in6_any = { .sin6_len = sizeof(in6_any) , .sin6_family = AF_INET6 , .sin6_port = 0 , .sin6_flowinfo = 0 , .sin6_addr = IN6ADDR_ANY_INIT , .sin6_scope_id = 0 }; a366 1 .dom_sa_any = (const struct sockaddr *)&in6_any, @ 1.77.2.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.78 2007/08/30 02:17:38 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.78 2007/08/30 02:17:38 dyoung Exp $"); d353 3 d368 2 @ 1.76 log @Eliminate address family-specific route caches (struct route, struct route_in6, struct route_iso), replacing all caches with a struct route. The principle benefit of this change is that all of the protocol families can benefit from route cache-invalidation, which is necessary for correct routing. Route-cache invalidation fixes an ancient PR, kern/3508, at long last; it fixes various other PRs, also. Discussions with and ideas from Joerg Sonnenberger influenced this work tremendously. Of course, all design oversights and bugs are mine. DETAILS 1 I added to each address family a pool of sockaddrs. I have introduced routines for allocating, copying, and duplicating, and freeing sockaddrs: struct sockaddr *sockaddr_alloc(sa_family_t af, int flags); struct sockaddr *sockaddr_copy(struct sockaddr *dst, const struct sockaddr *src); struct sockaddr *sockaddr_dup(const struct sockaddr *src, int flags); void sockaddr_free(struct sockaddr *sa); sockaddr_alloc() returns either a sockaddr from the pool belonging to the specified family, or NULL if the pool is exhausted. The returned sockaddr has the right size for that family; sa_family and sa_len fields are initialized to the family and sockaddr length---e.g., sa_family = AF_INET and sa_len = sizeof(struct sockaddr_in). sockaddr_free() puts the given sockaddr back into its family's pool. sockaddr_dup() and sockaddr_copy() work analogously to strdup() and strcpy(), respectively. sockaddr_copy() KASSERTs that the family of the destination and source sockaddrs are alike. The 'flags' argumet for sockaddr_alloc() and sockaddr_dup() is passed directly to pool_get(9). 2 I added routines for initializing sockaddrs in each address family, sockaddr_in_init(), sockaddr_in6_init(), sockaddr_iso_init(), etc. They are fairly self-explanatory. 3 structs route_in6 and route_iso are no more. All protocol families use struct route. I have changed the route cache, 'struct route', so that it does not contain storage space for a sockaddr. Instead, struct route points to a sockaddr coming from the pool the sockaddr belongs to. I added a new method to struct route, rtcache_setdst(), for setting the cache destination: int rtcache_setdst(struct route *, const struct sockaddr *); rtcache_setdst() returns 0 on success, or ENOMEM if no memory is available to create the sockaddr storage. It is now possible for rtcache_getdst() to return NULL if, say, rtcache_setdst() failed. I check the return value for NULL everywhere in the kernel. 4 Each routing domain (struct domain) has a list of live route caches, dom_rtcache. rtflushall(sa_family_t af) looks up the domain indicated by 'af', walks the domain's list of route caches and invalidates each one. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.75 2007/03/07 22:20:04 liamjfoy Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.75 2007/03/07 22:20:04 liamjfoy Exp $"); d370 3 a372 2 .dom_rtcache = LIST_HEAD_INITIALIZER(inet6domain.dom_rtcache), .dom_sockaddr_cmp = sockaddr_in6_cmp @ 1.75 log @Add IPv6 Fast Forward - the IPv4 counterpart: If ip6_forward successfully forwards a packet, a cache, in this case a ip6flow struct entry, will be created. ether_input and friends will then be able to call ip6flow_fastforward with the packet which will then be passed to if_output (unless an issue is found - in that case the packet is passed back to ip6_input). ok matt@@ christos@@ dyoung@@ and joerg@@ @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.74 2007/03/06 12:12:24 liamjfoy Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.74 2007/03/06 12:12:24 liamjfoy Exp $"); d353 3 d367 5 a371 1 .dom_mowner = MOWNER_INIT("","") d374 22 @ 1.75.4.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.77 2007/05/06 02:56:37 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.77 2007/05/06 02:56:37 dyoung Exp $"); a352 3 POOL_INIT(sockaddr_in6_pool, sizeof(struct sockaddr_in6), 0, 0, 0, "sockaddr_in6_pool", NULL, IPL_NET); d364 1 a364 6 .dom_mowner = MOWNER_INIT("",""), .dom_sa_pool = &sockaddr_in6_pool, .dom_sa_len = sizeof(struct sockaddr_in6), .dom_sa_cmpofs = offsetof(struct sockaddr_in6, sin6_addr), .dom_sa_cmplen = sizeof(struct in6_addr), .dom_rtcache = LIST_HEAD_INITIALIZER(inet6domain.dom_rtcache) a366 22 int sockaddr_in6_cmp(const struct sockaddr *lsa, const struct sockaddr *rsa) { uint_fast8_t len; const uint_fast8_t addrofs = offsetof(struct sockaddr_in6, sin6_addr), addrend = addrofs + sizeof(struct in6_addr); int rc; const struct sockaddr_in6 *lsin6, *rsin6; lsin6 = satocsin6(lsa); rsin6 = satocsin6(rsa); len = MIN(addrend, MIN(lsin6->sin6_len, rsin6->sin6_len)); if (len > addrofs && (rc = memcmp(&lsin6->sin6_addr, &rsin6->sin6_addr, len - addrofs)) != 0) return rc; return lsin6->sin6_len - rsin6->sin6_len; } @ 1.75.2.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.75 2007/03/07 22:20:04 liamjfoy Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.75 2007/03/07 22:20:04 liamjfoy Exp $"); a352 3 POOL_INIT(sockaddr_in6_pool, sizeof(struct sockaddr_in6), 0, 0, 0, "sockaddr_in6_pool", NULL, IPL_NET); d364 1 a364 6 .dom_mowner = MOWNER_INIT("",""), .dom_sa_pool = &sockaddr_in6_pool, .dom_sa_len = sizeof(struct sockaddr_in6), .dom_sa_cmpofs = offsetof(struct sockaddr_in6, sin6_addr), .dom_sa_cmplen = sizeof(struct in6_addr), .dom_rtcache = LIST_HEAD_INITIALIZER(inet6domain.dom_rtcache) a366 22 int sockaddr_in6_cmp(const struct sockaddr *lsa, const struct sockaddr *rsa) { uint_fast8_t len; const uint_fast8_t addrofs = offsetof(struct sockaddr_in6, sin6_addr), addrend = addrofs + sizeof(struct in6_addr); int rc; const struct sockaddr_in6 *lsin6, *rsin6; lsin6 = satocsin6(lsa); rsin6 = satocsin6(rsa); len = MIN(addrend, MIN(lsin6->sin6_len, rsin6->sin6_len)); if (len > addrofs && (rc = memcmp(&lsin6->sin6_addr, &rsin6->sin6_addr, len - addrofs)) != 0) return rc; return lsin6->sin6_len - rsin6->sin6_len; } @ 1.75.2.2 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.75.2.1 2007/06/08 14:17:54 ad Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.75.2.1 2007/06/08 14:17:54 ad Exp $"); d203 1 a203 1 .pr_ctloutput = icmp6_ctloutput, d353 2 a354 8 static const struct sockaddr_in6 in6_any = { .sin6_len = sizeof(in6_any) , .sin6_family = AF_INET6 , .sin6_port = 0 , .sin6_flowinfo = 0 , .sin6_addr = IN6ADDR_ANY_INIT , .sin6_scope_id = 0 }; d368 2 a371 1 .dom_sa_any = (const struct sockaddr *)&in6_any, @ 1.74 log @Fix some style issues - no functional change @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.73 2007/02/27 22:19:05 degroote Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.73 2007/02/27 22:19:05 degroote Exp $"); d190 6 @ 1.73 log @Initialize fast_ipsec entry in the protocol switch with structure initializers as other entries. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.72 2007/02/19 07:28:58 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.72 2007/02/19 07:28:58 dyoung Exp $"); d150 24 a173 24 { .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_init = ip6_init, .pr_slowtimo = frag6_slowtimo, .pr_drain = frag6_drain, }, { .pr_type = SOCK_DGRAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_UDP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF, .pr_input = udp6_input, .pr_ctlinput = udp6_ctlinput, .pr_ctloutput = ip6_ctloutput, .pr_usrreq = udp6_usrreq, .pr_init = udp6_init, }, { .pr_type = SOCK_STREAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_TCP, .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS|PR_PURGEIF, .pr_input = tcp6_input, .pr_ctlinput = tcp6_ctlinput, .pr_ctloutput = tcp_ctloutput, .pr_usrreq = tcp_usrreq, d175 3 a177 3 .pr_init = tcp_init, .pr_slowtimo = tcp_slowtimo, .pr_drain = tcp_drain, d180 38 a217 38 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_RAW, .pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF, .pr_input = rip6_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ICMPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = icmp6_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = icmp6_init, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_DSTOPTS, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = dest6_input, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ROUTING, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = route6_input, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_FRAGMENT, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = frag6_input, d220 6 a225 6 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_AH, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ah6_input, .pr_ctlinput = ah6_ctlinput, d228 6 a233 6 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ESP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = esp6_input, .pr_ctlinput = esp6_ctlinput, d236 5 a240 5 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPCOMP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipcomp6_input, d244 19 a262 19 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_AH, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipsec6_common_input, .pr_ctlinput = ah6_ctlinput, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ESP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipsec6_common_input, .pr_ctlinput = esp6_ctlinput, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPCOMP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipsec6_common_input, d266 10 a275 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV4, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = encap_init, d278 10 a287 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = encap_init, d290 9 a298 9 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ETHERIP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = ip6_etherip_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d302 8 a309 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_CARP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = carp6_proto_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d313 11 a323 11 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_EON, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, /*XXX*/ .pr_init = encap_init, d326 8 a333 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_PIM, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = pim6_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d336 8 a343 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = rip6_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = rip6_init, @ 1.72 log @Initialize protocol switch with structure initializers. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.71 2007/02/17 20:38:05 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.71 2007/02/17 20:38:05 dyoung Exp $"); d244 19 a262 14 { SOCK_RAW, &inet6domain, IPPROTO_AH, PR_ATOMIC|PR_ADDR, ipsec6_common_input, 0, ah6_ctlinput, 0, 0, 0, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR, ipsec6_common_input, 0, esp6_ctlinput, 0, 0, 0, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR, ipsec6_common_input, 0, 0, 0, 0, 0, 0, 0, 0, @ 1.71 log @0 -> NULL @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.70 2007/02/10 09:43:05 degroote Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.70 2007/02/10 09:43:05 degroote Exp $"); d150 28 a177 17 { 0, &inet6domain, IPPROTO_IPV6, 0, 0, 0, 0, 0, 0, ip6_init, 0, frag6_slowtimo, frag6_drain, }, { SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR|PR_PURGEIF, udp6_input, 0, udp6_ctlinput, ip6_ctloutput, udp6_usrreq, udp6_init, 0, 0, 0, }, { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS|PR_PURGEIF, tcp6_input, NULL, tcp6_ctlinput, tcp_ctloutput, tcp_usrreq, #ifdef INET /* don't call initialization and timeout routines twice */ 0, 0, 0, 0, #else tcp_init, 0, tcp_slowtimo, tcp_drain, d180 38 a217 24 { SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR|PR_PURGEIF, rip6_input, rip6_output, rip6_ctlinput, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_ICMPV6, PR_ATOMIC|PR_ADDR|PR_LASTHDR, icmp6_input, rip6_output, rip6_ctlinput, rip6_ctloutput, rip6_usrreq, icmp6_init, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_DSTOPTS,PR_ATOMIC|PR_ADDR, dest6_input, 0, 0, 0, 0, 0, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_ROUTING,PR_ATOMIC|PR_ADDR, route6_input, 0, 0, 0, 0, 0, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_FRAGMENT,PR_ATOMIC|PR_ADDR, frag6_input, 0, 0, 0, 0, 0, 0, 0, 0, d220 6 a225 4 { SOCK_RAW, &inet6domain, IPPROTO_AH, PR_ATOMIC|PR_ADDR, ah6_input, 0, ah6_ctlinput, 0, 0, 0, 0, 0, 0, d228 6 a233 4 { SOCK_RAW, &inet6domain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR, esp6_input, 0, esp6_ctlinput, 0, 0, 0, 0, 0, 0, d236 5 a240 4 { SOCK_RAW, &inet6domain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR, ipcomp6_input, 0, 0, 0, 0, 0, 0, 0, 0, d261 10 a270 4 { SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR|PR_LASTHDR, encap6_input, rip6_output, encap6_ctlinput, rip6_ctloutput, rip6_usrreq, encap_init, 0, 0, 0, d273 10 a282 4 { SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR|PR_LASTHDR, encap6_input, rip6_output, encap6_ctlinput, rip6_ctloutput, rip6_usrreq, encap_init, 0, 0, 0, d285 9 a293 4 { SOCK_RAW, &inet6domain, IPPROTO_ETHERIP, PR_ATOMIC|PR_ADDR|PR_LASTHDR, ip6_etherip_input, rip6_output, rip6_ctlinput, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, d297 8 a304 4 { SOCK_RAW, &inet6domain, IPPROTO_CARP, PR_ATOMIC|PR_ADDR, carp6_proto_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, d308 11 a318 4 { SOCK_RAW, &inet6domain, IPPROTO_EON, PR_ATOMIC|PR_ADDR|PR_LASTHDR, encap6_input, rip6_output, encap6_ctlinput, rip6_ctloutput, rip6_usrreq, /*XXX*/ encap_init, 0, 0, 0, d321 8 a328 4 { SOCK_RAW, &inet6domain, IPPROTO_PIM, PR_ATOMIC|PR_ADDR|PR_LASTHDR, pim6_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, d331 8 a338 4 { SOCK_RAW, &inet6domain, 0, PR_ATOMIC|PR_ADDR|PR_LASTHDR, rip6_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, rip6_init, 0, 0, 0, @ 1.70 log @Commit my SoC work Add ipv6 support for fast_ipsec Note that currently, packet with extensions headers are not correctly supported Change the ipcomp logic @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.69 2006/12/09 05:33:07 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.69 2006/12/09 05:33:07 dyoung Exp $"); d161 1 a161 1 tcp6_input, 0, tcp6_ctlinput, tcp_ctloutput, @ 1.70.2.1 log @- sync with head. - move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.70 2007/02/10 09:43:05 degroote Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.70 2007/02/10 09:43:05 degroote Exp $"); d150 17 a166 28 { .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_init = ip6_init, .pr_slowtimo = frag6_slowtimo, .pr_drain = frag6_drain, }, { .pr_type = SOCK_DGRAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_UDP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF, .pr_input = udp6_input, .pr_ctlinput = udp6_ctlinput, .pr_ctloutput = ip6_ctloutput, .pr_usrreq = udp6_usrreq, .pr_init = udp6_init, }, { .pr_type = SOCK_STREAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_TCP, .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS|PR_PURGEIF, .pr_input = tcp6_input, .pr_ctlinput = tcp6_ctlinput, .pr_ctloutput = tcp_ctloutput, .pr_usrreq = tcp_usrreq, #ifndef INET /* don't call initialization and timeout routines twice */ .pr_init = tcp_init, .pr_slowtimo = tcp_slowtimo, .pr_drain = tcp_drain, d169 24 a192 38 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_RAW, .pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF, .pr_input = rip6_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ICMPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = icmp6_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = icmp6_init, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_DSTOPTS, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = dest6_input, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ROUTING, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = route6_input, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_FRAGMENT, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = frag6_input, d195 4 a198 6 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_AH, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ah6_input, .pr_ctlinput = ah6_ctlinput, d201 4 a204 6 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ESP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = esp6_input, .pr_ctlinput = esp6_ctlinput, d207 4 a210 5 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPCOMP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipcomp6_input, d231 4 a234 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV4, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = encap_init, d237 4 a240 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = encap_init, d243 4 a246 9 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ETHERIP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = ip6_etherip_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d250 4 a253 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_CARP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = carp6_proto_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d257 4 a260 11 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_EON, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, /*XXX*/ .pr_init = encap_init, d263 4 a266 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_PIM, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = pim6_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d269 4 a272 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = rip6_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = rip6_init, @ 1.70.2.2 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.70.2.1 2007/02/27 16:55:00 yamt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.70.2.1 2007/02/27 16:55:00 yamt Exp $"); d150 24 a173 24 { .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_init = ip6_init, .pr_slowtimo = frag6_slowtimo, .pr_drain = frag6_drain, }, { .pr_type = SOCK_DGRAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_UDP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF, .pr_input = udp6_input, .pr_ctlinput = udp6_ctlinput, .pr_ctloutput = ip6_ctloutput, .pr_usrreq = udp6_usrreq, .pr_init = udp6_init, }, { .pr_type = SOCK_STREAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_TCP, .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS|PR_PURGEIF, .pr_input = tcp6_input, .pr_ctlinput = tcp6_ctlinput, .pr_ctloutput = tcp_ctloutput, .pr_usrreq = tcp_usrreq, d175 3 a177 3 .pr_init = tcp_init, .pr_slowtimo = tcp_slowtimo, .pr_drain = tcp_drain, d180 38 a217 44 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_RAW, .pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF, .pr_input = rip6_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, }, #ifdef GATEWAY { .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_slowtimo = ip6flow_slowtimo, }, #endif /* GATEWAY */ { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ICMPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = icmp6_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = icmp6_init, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_DSTOPTS, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = dest6_input, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ROUTING, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = route6_input, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_FRAGMENT, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = frag6_input, d220 6 a225 6 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_AH, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ah6_input, .pr_ctlinput = ah6_ctlinput, d228 6 a233 6 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ESP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = esp6_input, .pr_ctlinput = esp6_ctlinput, d236 5 a240 5 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPCOMP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipcomp6_input, d244 14 a257 19 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_AH, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipsec6_common_input, .pr_ctlinput = ah6_ctlinput, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ESP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipsec6_common_input, .pr_ctlinput = esp6_ctlinput, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPCOMP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipsec6_common_input, d261 10 a270 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV4, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = encap_init, d273 10 a282 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = encap_init, d285 9 a293 9 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ETHERIP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = ip6_etherip_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d297 8 a304 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_CARP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = carp6_proto_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d308 11 a318 11 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_EON, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, /*XXX*/ .pr_init = encap_init, d321 8 a328 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_PIM, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = pim6_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d331 8 a338 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = rip6_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = rip6_init, @ 1.70.2.3 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.70.2.2 2007/03/12 05:59:57 rmind Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.70.2.2 2007/03/12 05:59:57 rmind Exp $"); a352 3 POOL_INIT(sockaddr_in6_pool, sizeof(struct sockaddr_in6), 0, 0, 0, "sockaddr_in6_pool", NULL, IPL_NET); d364 1 a364 6 .dom_mowner = MOWNER_INIT("",""), .dom_sa_pool = &sockaddr_in6_pool, .dom_sa_len = sizeof(struct sockaddr_in6), .dom_sa_cmpofs = offsetof(struct sockaddr_in6, sin6_addr), .dom_sa_cmplen = sizeof(struct in6_addr), .dom_rtcache = LIST_HEAD_INITIALIZER(inet6domain.dom_rtcache) a366 22 int sockaddr_in6_cmp(const struct sockaddr *lsa, const struct sockaddr *rsa) { uint_fast8_t len; const uint_fast8_t addrofs = offsetof(struct sockaddr_in6, sin6_addr), addrend = addrofs + sizeof(struct in6_addr); int rc; const struct sockaddr_in6 *lsin6, *rsin6; lsin6 = satocsin6(lsa); rsin6 = satocsin6(rsa); len = MIN(addrend, MIN(lsin6->sin6_len, rsin6->sin6_len)); if (len > addrofs && (rc = memcmp(&lsin6->sin6_addr, &rsin6->sin6_addr, len - addrofs)) != 0) return rc; return lsin6->sin6_len - rsin6->sin6_len; } @ 1.69 log @Here are various changes designed to protect against bad IPv4 routing caused by stale route caches (struct route). Route caches are sprinkled throughout PCBs, the IP fast-forwarding table, and IP tunnel interfaces (gre, gif, stf). Stale IPv6 and ISO route caches will be treated by separate patches. Thank you to Christoph Badura for suggesting the general approach to invalidating route caches that I take here. Here are the details: Add hooks to struct domain for tracking and for invalidating each domain's route caches: dom_rtcache, dom_rtflush, and dom_rtflushall. Introduce helper subroutines, rtflush(ro) for invalidating a route cache, rtflushall(family) for invalidating all route caches in a routing domain, and rtcache(ro) for notifying the domain of a new cached route. Chain together all IPv4 route caches where ro_rt != NULL. Provide in_rtcache() for adding a route to the chain. Provide in_rtflush() and in_rtflushall() for invalidating IPv4 route caches. In in_rtflush(), set ro_rt to NULL, and remove the route from the chain. In in_rtflushall(), walk the chain and remove every route cache. In rtrequest1(), call rtflushall() to invalidate route caches when a route is added. In gif(4), discard the workaround for stale caches that involves expiring them every so often. Replace the pattern 'RTFREE(ro->ro_rt); ro->ro_rt = NULL;' with a call to rtflush(ro). Update ipflow_fastforward() and all other users of route caches so that they expect a cached route, ro->ro_rt, to turn to NULL. Take care when moving a 'struct route' to rtflush() the source and to rtcache() the destination. In domain initializers, use .dom_xxx tags. KNF here and there. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.68 2006/11/23 04:07:07 rpaulo Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.68 2006/11/23 04:07:07 rpaulo Exp $"); d118 7 d213 17 @ 1.68 log @New EtherIP driver based on tap(4) and gif(4) by Hans Rosenfeld. Notable changes: * Fixes PR 34268. * Separates the code from gif(4) (which is more cleaner). * Allows the usage of STP (Spanning Tree Protocol). * Removed EtherIP implementation from gif(4)/tap(4). Some input from Christos. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.67 2006/10/10 21:49:15 dogcow Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.67 2006/10/10 21:49:15 dogcow Exp $"); d253 11 a263 10 AF_INET6, "internet6", NULL, NULL, NULL, (const struct protosw *)inet6sw, (const struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], rn_inithead, offsetof(struct sockaddr_in6, sin6_addr) << 3, sizeof(struct sockaddr_in6), in6_domifattach, in6_domifdetach, { &ip6intrq, NULL }, { NULL }, MOWNER_INIT("","") @ 1.68.4.1 log @Update to today's netbsd-4. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.68.2.1 2007/05/24 19:13:16 pavel Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.68.2.1 2007/05/24 19:13:16 pavel Exp $"); a117 7 #ifdef FAST_IPSEC #include #include #include #endif /* FAST_IPSEC */ a205 17 #ifdef FAST_IPSEC { SOCK_RAW, &inet6domain, IPPROTO_AH, PR_ATOMIC|PR_ADDR, ipsec6_common_input, 0, ah6_ctlinput, 0, 0, 0, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR, ipsec6_common_input, 0, esp6_ctlinput, 0, 0, 0, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR, ipsec6_common_input, 0, 0, 0, 0, 0, 0, 0, 0, }, #endif /* FAST_IPSEC */ @ 1.68.2.1 log @Pull up following revision(s) (requested by degroote in ticket #667): sys/netinet/tcp_input.c: revision 1.260 sys/netinet/tcp_output.c: revision 1.154 sys/netinet/tcp_subr.c: revision 1.210 sys/netinet6/icmp6.c: revision 1.129 sys/netinet6/in6_proto.c: revision 1.70 sys/netinet6/ip6_forward.c: revision 1.54 sys/netinet6/ip6_input.c: revision 1.94 sys/netinet6/ip6_output.c: revision 1.114 sys/netinet6/raw_ip6.c: revision 1.81 sys/netipsec/ipcomp_var.h: revision 1.4 sys/netipsec/ipsec.c: revision 1.26 via patch,1.31-1.32 sys/netipsec/ipsec6.h: revision 1.5 sys/netipsec/ipsec_input.c: revision 1.14 sys/netipsec/ipsec_netbsd.c: revision 1.18,1.26 sys/netipsec/ipsec_output.c: revision 1.21 via patch sys/netipsec/key.c: revision 1.33,1.44 sys/netipsec/xform_ipcomp.c: revision 1.9 sys/netipsec/xform_ipip.c: revision 1.15 sys/opencrypto/deflate.c: revision 1.8 Commit my SoC work Add ipv6 support for fast_ipsec Note that currently, packet with extensions headers are not correctly supported Change the ipcomp logic Add sysctl tree to modify the fast_ipsec options related to ipv6. Similar to the sysctl kame interface. Choose the good default policy, depending of the adress family of the desired policy Increase the refcount for the default ipv6 policy so nobody can reclaim it Always compute the sp index even if we don't have any sp in spd. It will let us to choose the right default policy (based on the adress family requested). While here, fix an error message Use dynamic array instead of an static array to decompress. It lets us to decompress any data, whatever is the radio decompressed data / compressed data. It fixes the last issues with fast_ipsec and ipcomp. While here, bzero -> memset, bcopy -> memcpy, FREE -> free Reviewed a long time ago by sam@@ @ text @d1 1 a1 1 /* $NetBSD$ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD$"); a117 7 #ifdef FAST_IPSEC #include #include #include #endif /* FAST_IPSEC */ a205 17 #ifdef FAST_IPSEC { SOCK_RAW, &inet6domain, IPPROTO_AH, PR_ATOMIC|PR_ADDR, ipsec6_common_input, 0, ah6_ctlinput, 0, 0, 0, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR, ipsec6_common_input, 0, esp6_ctlinput, 0, 0, 0, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR, ipsec6_common_input, 0, 0, 0, 0, 0, 0, 0, 0, }, #endif /* FAST_IPSEC */ @ 1.67 log @change the MOWNER_INIT define to take two args; fix extant struct mowner decls to use it. Makes options MBUFTRACE compile again and not whinge about missing structure declarations. (Also makes initialization consistent.) @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.66 2006/08/30 17:05:30 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.66 2006/08/30 17:05:30 christos Exp $"); d123 5 d218 7 @ 1.66 log @add missing initializers @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.65 2006/08/28 02:51:12 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.65 2006/08/28 02:51:12 christos Exp $"); d250 1 a250 1 MOWNER_INIT @ 1.66.2.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.67 2006/10/10 21:49:15 dogcow Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.67 2006/10/10 21:49:15 dogcow Exp $"); d250 1 a250 1 MOWNER_INIT("","") @ 1.66.2.2 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.69 2006/12/09 05:33:07 dyoung Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.69 2006/12/09 05:33:07 dyoung Exp $"); a122 5 #include "etherip.h" #if NETHERIP > 1 #include #endif a212 7 #if NETHERIP > 1 { SOCK_RAW, &inet6domain, IPPROTO_ETHERIP, PR_ATOMIC|PR_ADDR|PR_LASTHDR, ip6_etherip_input, rip6_output, rip6_ctlinput, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, }, #endif d241 10 a250 11 .dom_family = AF_INET6, .dom_name = "internet6", .dom_init = NULL, .dom_externalize = NULL, .dom_dispose = NULL, .dom_protosw = (const struct protosw *)inet6sw, .dom_protoswNPROTOSW = (const struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], .dom_rtattach = rn_inithead, .dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr) << 3, .dom_maxrtkey = sizeof(struct sockaddr_in6), .dom_ifattach = in6_domifattach, .dom_ifdetach = in6_domifdetach, .dom_ifqueues = { &ip6intrq, NULL }, .dom_link = { NULL }, .dom_mowner = MOWNER_INIT("","") @ 1.66.4.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.66 2006/08/30 17:05:30 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.66 2006/08/30 17:05:30 christos Exp $"); d250 1 a250 1 MOWNER_INIT("","") @ 1.66.4.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.66.4.1 2006/10/22 06:07:35 yamt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.66.4.1 2006/10/22 06:07:35 yamt Exp $"); a122 5 #include "etherip.h" #if NETHERIP > 1 #include #endif a212 7 #if NETHERIP > 1 { SOCK_RAW, &inet6domain, IPPROTO_ETHERIP, PR_ATOMIC|PR_ADDR|PR_LASTHDR, ip6_etherip_input, rip6_output, rip6_ctlinput, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, }, #endif d241 10 a250 11 .dom_family = AF_INET6, .dom_name = "internet6", .dom_init = NULL, .dom_externalize = NULL, .dom_dispose = NULL, .dom_protosw = (const struct protosw *)inet6sw, .dom_protoswNPROTOSW = (const struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], .dom_rtattach = rn_inithead, .dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr) << 3, .dom_maxrtkey = sizeof(struct sockaddr_in6), .dom_ifattach = in6_domifattach, .dom_ifdetach = in6_domifdetach, .dom_ifqueues = { &ip6intrq, NULL }, .dom_link = { NULL }, .dom_mowner = MOWNER_INIT("","") @ 1.65 log @remove extra members @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.64 2006/08/25 19:33:51 matt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.64 2006/08/25 19:33:51 matt Exp $"); d240 12 a251 8 struct domain inet6domain = { AF_INET6, "internet6", 0, 0, 0, (const struct protosw *)inet6sw, (const struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], rn_inithead, offsetof(struct sockaddr_in6, sin6_addr) << 3, sizeof(struct sockaddr_in6), in6_domifattach, in6_domifdetach, { &ip6intrq } }; @ 1.64 log @One step closer to loadable domains. Store pointers to a domain's soft interrupt queues so if_detach can remove packets to removed interfaces from them. This eliminates a lot of conditional ugly code in if.c @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.63 2006/05/18 09:05:51 liamjfoy Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.63 2006/05/18 09:05:51 liamjfoy Exp $"); a141 1 NULL, a146 1 NULL, a155 1 NULL, a186 1 NULL, a192 1 NULL, a198 1 NULL, d217 1 a217 1 0, 0, 0, 0, NULL /* carp_sysctl */ @ 1.63 log @Integrate Common Address Redundancy Procotol (CARP) from OpenBSD 'pseudo-device carp' Thanks to: joerg@@ christos@@ riz@@ and others who tested Ok: core@@ @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.62 2006/03/05 23:47:08 rpaulo Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.62 2006/03/05 23:47:08 rpaulo Exp $"); d253 1 a253 1 in6_domifattach, in6_domifdetach, }; @ 1.62 log @NDP-related improvements: RFC4191 - supports host-side router-preference RFC3542 - if DAD fails on a interface, disables IPv6 operation on the interface - don't advertise MLD report before DAD finishes Others - fixes integer overflow for valid and preferred lifetimes - improves timer granularity for MLD, using callout-timer. - reflects rtadvd's IPv6 host variable information into kernel (router only) - adds a sysctl option to enable/disable pMTUd for multicast packets - performs NUD on PPP/GRE interface by default - Redirect works regardless of ip6_accept_rtadv - removes RFC1885-related code From the KAME project via SUZUKI Shinsuke. Reviewed by core. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.61 2005/12/11 12:25:02 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.61 2005/12/11 12:25:02 christos Exp $"); d118 5 d219 7 @ 1.62.4.1 log @Merge 2006-05-24 NetBSD-current into the "peter-altq" branch. @ text @d1 1 a1 1 /* $NetBSD$ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD$"); a117 5 #include "carp.h" #if NCARP > 0 #include #endif a213 7 #if NCARP > 0 { SOCK_RAW, &inet6domain, IPPROTO_CARP, PR_ATOMIC|PR_ADDR, carp6_proto_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, NULL /* carp_sysctl */ }, #endif /* NCARP */ @ 1.61 log @merge ktrace-lwp. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.47.2.5 2005/11/10 14:11:25 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.47.2.5 2005/11/10 14:11:25 skrll Exp $"); d163 1 a163 2 icmp6_init, icmp6_fasttimo, 0, 0, NULL, d268 1 @ 1.61.6.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.62 2006/03/05 23:47:08 rpaulo Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.62 2006/03/05 23:47:08 rpaulo Exp $"); d163 2 a164 1 icmp6_init, 0, 0, 0, a268 1 int ip6_mcast_pmtu = 0; /* enable pMTU discovery for multicast? */ @ 1.61.6.2 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.61.6.1 2006/04/22 11:40:12 simonb Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.61.6.1 2006/04/22 11:40:12 simonb Exp $"); a117 5 #include "carp.h" #if NCARP > 0 #include #endif a213 7 #if NCARP > 0 { SOCK_RAW, &inet6domain, IPPROTO_CARP, PR_ATOMIC|PR_ADDR, carp6_proto_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, NULL /* carp_sysctl */ }, #endif /* NCARP */ @ 1.61.8.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.61 2005/12/11 12:25:02 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.61 2005/12/11 12:25:02 christos Exp $"); d163 2 a164 1 icmp6_init, 0, 0, 0, a268 1 int ip6_mcast_pmtu = 0; /* enable pMTU discovery for multicast? */ @ 1.61.8.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.61.8.1 2006/03/13 09:07:39 yamt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.61.8.1 2006/03/13 09:07:39 yamt Exp $"); a117 5 #include "carp.h" #if NCARP > 0 #include #endif a213 7 #if NCARP > 0 { SOCK_RAW, &inet6domain, IPPROTO_CARP, PR_ATOMIC|PR_ADDR, carp6_proto_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, NULL /* carp_sysctl */ }, #endif /* NCARP */ @ 1.61.8.3 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.61.8.2 2006/05/24 10:59:09 yamt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.61.8.2 2006/05/24 10:59:09 yamt Exp $"); d142 1 d148 1 d158 1 d190 1 d197 1 d204 1 d223 1 a223 1 0, 0, 0, 0, d246 8 a253 12 struct domain inet6domain = { AF_INET6, "internet6", NULL, NULL, NULL, (const struct protosw *)inet6sw, (const struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], rn_inithead, offsetof(struct sockaddr_in6, sin6_addr) << 3, sizeof(struct sockaddr_in6), in6_domifattach, in6_domifdetach, { &ip6intrq, NULL }, { NULL }, MOWNER_INIT }; @ 1.61.4.1 log @remove in6_pcb.h and include in_pcb.h. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.61 2005/12/11 12:25:02 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.61 2005/12/11 12:25:02 christos Exp $"); d92 1 @ 1.61.4.2 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.66 2006/08/30 17:05:30 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.61.4.1 2006/02/07 04:58:11 rpaulo Exp $"); a116 5 #include "carp.h" #if NCARP > 0 #include #endif d136 1 d142 1 d152 1 d162 2 a163 1 icmp6_init, 0, 0, 0, d185 1 d192 1 d199 1 a213 7 #if NCARP > 0 { SOCK_RAW, &inet6domain, IPPROTO_CARP, PR_ATOMIC|PR_ADDR, carp6_proto_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, }, #endif /* NCARP */ d234 8 a241 12 struct domain inet6domain = { AF_INET6, "internet6", NULL, NULL, NULL, (const struct protosw *)inet6sw, (const struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], rn_inithead, offsetof(struct sockaddr_in6, sin6_addr) << 3, sizeof(struct sockaddr_in6), in6_domifattach, in6_domifdetach, { &ip6intrq, NULL }, { NULL }, MOWNER_INIT }; a267 1 int ip6_mcast_pmtu = 0; /* enable pMTU discovery for multicast? */ @ 1.60 log @Add PR_PURGEIF flag for protocols to indicate that the protocol might store a struct ifnet *, and define it for udp/tcp/rawip for INET and INET6. When deleting a struct ifnet, invoke PRU_PURGEIF on all protocols marked with PR_PURGEIF. Closes PR kern/29580 (mine). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.59 2005/05/29 21:43:51 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.59 2005/05/29 21:43:51 christos Exp $"); @ 1.59 log @- avoid shadowed variables - sprinkle const. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.58 2005/01/23 18:41:57 matt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.58 2005/01/23 18:41:57 matt Exp $"); d139 1 a139 1 { SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR, d145 1 a145 1 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS, d155 1 a155 1 { SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, @ 1.59.2.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.59 2005/05/29 21:43:51 christos Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.59 2005/05/29 21:43:51 christos Exp $"); a117 5 #include "carp.h" #if NCARP > 0 #include #endif d139 1 a139 1 { SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR|PR_PURGEIF, d145 1 a145 1 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS|PR_PURGEIF, d155 1 a155 1 { SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR|PR_PURGEIF, d163 2 a164 1 icmp6_init, 0, 0, 0, a214 7 #if NCARP > 0 { SOCK_RAW, &inet6domain, IPPROTO_CARP, PR_ATOMIC|PR_ADDR, carp6_proto_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, NULL /* carp_sysctl */ }, #endif /* NCARP */ a268 1 int ip6_mcast_pmtu = 0; /* enable pMTU discovery for multicast? */ @ 1.59.2.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.59.2.1 2006/06/21 15:11:08 yamt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.59.2.1 2006/06/21 15:11:08 yamt Exp $"); a122 5 #include "etherip.h" #if NETHERIP > 1 #include #endif d142 1 d148 1 d158 1 d190 1 d197 1 d204 1 a218 7 #if NETHERIP > 1 { SOCK_RAW, &inet6domain, IPPROTO_ETHERIP, PR_ATOMIC|PR_ADDR|PR_LASTHDR, ip6_etherip_input, rip6_output, rip6_ctlinput, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, }, #endif d223 1 a223 1 0, 0, 0, 0, d246 8 a253 13 struct domain inet6domain = { .dom_family = AF_INET6, .dom_name = "internet6", .dom_init = NULL, .dom_externalize = NULL, .dom_dispose = NULL, .dom_protosw = (const struct protosw *)inet6sw, .dom_protoswNPROTOSW = (const struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], .dom_rtattach = rn_inithead, .dom_rtoffset = offsetof(struct sockaddr_in6, sin6_addr) << 3, .dom_maxrtkey = sizeof(struct sockaddr_in6), .dom_ifattach = in6_domifattach, .dom_ifdetach = in6_domifdetach, .dom_ifqueues = { &ip6intrq, NULL }, .dom_link = { NULL }, .dom_mowner = MOWNER_INIT("","") }; @ 1.59.2.3 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.59.2.2 2006/12/30 20:50:38 yamt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.59.2.2 2006/12/30 20:50:38 yamt Exp $"); a117 7 #ifdef FAST_IPSEC #include #include #include #endif /* FAST_IPSEC */ d143 17 a159 28 { .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_init = ip6_init, .pr_slowtimo = frag6_slowtimo, .pr_drain = frag6_drain, }, { .pr_type = SOCK_DGRAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_UDP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF, .pr_input = udp6_input, .pr_ctlinput = udp6_ctlinput, .pr_ctloutput = ip6_ctloutput, .pr_usrreq = udp6_usrreq, .pr_init = udp6_init, }, { .pr_type = SOCK_STREAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_TCP, .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS|PR_PURGEIF, .pr_input = tcp6_input, .pr_ctlinput = tcp6_ctlinput, .pr_ctloutput = tcp_ctloutput, .pr_usrreq = tcp_usrreq, #ifndef INET /* don't call initialization and timeout routines twice */ .pr_init = tcp_init, .pr_slowtimo = tcp_slowtimo, .pr_drain = tcp_drain, d162 9 a170 38 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_RAW, .pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF, .pr_input = rip6_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ICMPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = icmp6_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = icmp6_init, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_DSTOPTS, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = dest6_input, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ROUTING, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = route6_input, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_FRAGMENT, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = frag6_input, d172 4 a175 7 #ifdef IPSEC { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_AH, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ah6_input, .pr_ctlinput = ah6_ctlinput, d177 4 a180 7 #ifdef IPSEC_ESP { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ESP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = esp6_input, .pr_ctlinput = esp6_ctlinput, d182 4 a185 6 #endif { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPCOMP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipcomp6_input, d187 3 a189 4 #endif /* IPSEC */ #ifdef FAST_IPSEC { SOCK_RAW, &inet6domain, IPPROTO_AH, PR_ATOMIC|PR_ADDR, ipsec6_common_input, 0, ah6_ctlinput, 0, d191 1 a191 1 0, 0, 0, 0, d193 3 a195 2 { SOCK_RAW, &inet6domain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR, ipsec6_common_input, 0, esp6_ctlinput, 0, d197 1 a197 1 0, 0, 0, 0, d199 3 a201 2 { SOCK_RAW, &inet6domain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR, ipsec6_common_input, 0, 0, 0, d203 1 a203 1 0, 0, 0, 0, d205 1 a205 1 #endif /* FAST_IPSEC */ d207 4 a210 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV4, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = encap_init, d213 4 a216 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = encap_init, d219 4 a222 9 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ETHERIP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = ip6_etherip_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d226 4 a229 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_CARP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = carp6_proto_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d233 4 a236 11 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_EON, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, /*XXX*/ .pr_init = encap_init, d239 4 a242 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_PIM, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = pim6_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d245 4 a248 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = rip6_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = rip6_init, @ 1.59.2.4 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.59.2.3 2007/02/26 09:11:51 yamt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.59.2.3 2007/02/26 09:11:51 yamt Exp $"); d150 24 a173 24 { .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_init = ip6_init, .pr_slowtimo = frag6_slowtimo, .pr_drain = frag6_drain, }, { .pr_type = SOCK_DGRAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_UDP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF, .pr_input = udp6_input, .pr_ctlinput = udp6_ctlinput, .pr_ctloutput = ip6_ctloutput, .pr_usrreq = udp6_usrreq, .pr_init = udp6_init, }, { .pr_type = SOCK_STREAM, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_TCP, .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS|PR_PURGEIF, .pr_input = tcp6_input, .pr_ctlinput = tcp6_ctlinput, .pr_ctloutput = tcp_ctloutput, .pr_usrreq = tcp_usrreq, d175 3 a177 3 .pr_init = tcp_init, .pr_slowtimo = tcp_slowtimo, .pr_drain = tcp_drain, d180 38 a217 44 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_RAW, .pr_flags = PR_ATOMIC|PR_ADDR|PR_PURGEIF, .pr_input = rip6_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, }, #ifdef GATEWAY { .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_slowtimo = ip6flow_slowtimo, }, #endif /* GATEWAY */ { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ICMPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = icmp6_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = icmp6_init, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_DSTOPTS, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = dest6_input, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ROUTING, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = route6_input, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_FRAGMENT, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = frag6_input, d220 6 a225 6 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_AH, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ah6_input, .pr_ctlinput = ah6_ctlinput, d228 6 a233 6 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ESP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = esp6_input, .pr_ctlinput = esp6_ctlinput, d236 5 a240 5 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPCOMP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipcomp6_input, d244 14 a257 19 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_AH, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipsec6_common_input, .pr_ctlinput = ah6_ctlinput, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ESP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipsec6_common_input, .pr_ctlinput = esp6_ctlinput, }, { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPCOMP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = ipsec6_common_input, d261 10 a270 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV4, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = encap_init, d273 10 a282 10 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_IPV6, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = encap_init, d285 9 a293 9 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_ETHERIP, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = ip6_etherip_input, .pr_output = rip6_output, .pr_ctlinput = rip6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d297 8 a304 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_CARP, .pr_flags = PR_ATOMIC|PR_ADDR, .pr_input = carp6_proto_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d308 11 a318 11 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_EON, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = encap6_input, .pr_output = rip6_output, .pr_ctlinput = encap6_ctlinput, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, /*XXX*/ .pr_init = encap_init, d321 8 a328 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_protocol = IPPROTO_PIM, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = pim6_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, d331 8 a338 8 { .pr_type = SOCK_RAW, .pr_domain = &inet6domain, .pr_flags = PR_ATOMIC|PR_ADDR|PR_LASTHDR, .pr_input = rip6_input, .pr_output = rip6_output, .pr_ctloutput = rip6_ctloutput, .pr_usrreq = rip6_usrreq, .pr_init = rip6_init, d353 1 a353 4 .dom_mowner = MOWNER_INIT("",""), .dom_sa_cmpofs = offsetof(struct sockaddr_in6, sin6_addr), .dom_sa_cmplen = sizeof(struct in6_addr), .dom_rtcache = LIST_HEAD_INITIALIZER(inet6domain.dom_rtcache) a355 22 int sockaddr_in6_cmp(const struct sockaddr *lsa, const struct sockaddr *rsa) { uint_fast8_t len; const uint_fast8_t addrofs = offsetof(struct sockaddr_in6, sin6_addr), addrend = addrofs + sizeof(struct in6_addr); int rc; const struct sockaddr_in6 *lsin6, *rsin6; lsin6 = satocsin6(lsa); rsin6 = satocsin6(rsa); len = MIN(addrend, MIN(lsin6->sin6_len, rsin6->sin6_len)); if (len > addrofs && (rc = memcmp(&lsin6->sin6_addr, &rsin6->sin6_addr, len - addrofs)) != 0) return rc; return lsin6->sin6_len - rsin6->sin6_len; } @ 1.59.2.5 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.59.2.4 2007/09/03 14:43:30 yamt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.59.2.4 2007/09/03 14:43:30 yamt Exp $"); d203 1 a203 1 .pr_ctloutput = icmp6_ctloutput, a352 9 static const struct sockaddr_in6 in6_any = { .sin6_len = sizeof(in6_any) , .sin6_family = AF_INET6 , .sin6_port = 0 , .sin6_flowinfo = 0 , .sin6_addr = IN6ADDR_ANY_INIT , .sin6_scope_id = 0 }; a366 1 .dom_sa_any = (const struct sockaddr *)&in6_any, @ 1.58 log @Change initialzie of domains to use link sets. Switch to using STAILQ. Add a convenience macro DOMAIN_FOREACH to interate through the domain. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.57 2004/04/22 01:01:41 matt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.57 2004/04/22 01:01:41 matt Exp $"); d237 2 a238 2 (struct protosw *)inet6sw, (struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], @ 1.58.6.1 log @Pull up revision 1.60 (requested by gdt in ticket #661): Add PR_PURGEIF flag for protocols to indicate that the protocol might store a struct ifnet *, and define it for udp/tcp/rawip for INET and INET6. When deleting a struct ifnet, invoke PRU_PURGEIF on all protocols marked with PR_PURGEIF. Closes PR kern/29580 (mine). @ text @d1 1 a1 1 /* $NetBSD$ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD$"); d139 1 a139 1 { SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR|PR_PURGEIF, d145 1 a145 1 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS|PR_PURGEIF, d155 1 a155 1 { SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR|PR_PURGEIF, @ 1.57 log @Constify protosw arrays. This can reduce the kernel .data section by over 4K (if all the network protocols) are loaded. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.56 2003/12/04 19:38:24 atatat Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.56 2003/12/04 19:38:24 atatat Exp $"); d130 1 a130 1 extern struct domain inet6domain; d238 1 a238 1 (struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], 0, @ 1.57.4.1 log @sync with -current @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.58 2005/01/23 18:41:57 matt Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.58 2005/01/23 18:41:57 matt Exp $"); d130 1 a130 1 DOMAIN_DEFINE(inet6domain); /* forward declare and add to link set */ d238 1 a238 1 (struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], @ 1.56 log @Dynamic sysctl. Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(), vfs_sysctl(), etc, routines, along with sysctl_int() et al. Now all nodes are registered with the tree, and nodes can be added (or removed) easily, and I/O to and from the tree is handled generically. Since the nodes are registered with the tree, the mapping from name to number (and back again) can now be discovered, instead of having to be hard coded. Adding new nodes to the tree is likewise much simpler -- the new infrastructure handles almost all the work for simple types, and just about anything else can be done with a small helper function. All existing nodes are where they were before (numerically speaking), so all existing consumers of sysctl information should notice no difference. PS - I'm sorry, but there's a distinct lack of documentation at the moment. I'm working on sysctl(3/8/9) right now, and I promise to watch out for buses. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.55 2003/11/03 15:12:06 briggs Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.55 2003/11/03 15:12:06 briggs Exp $"); d132 1 a132 1 struct ip6protosw inet6sw[] = { @ 1.55 log @Revert the change in default value of ipv6_v6only. Further discussion on this topic is required. It should be reintroduced and pursued in the IETF. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.54 2003/10/28 06:31:28 briggs Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.54 2003/10/28 06:31:28 briggs Exp $"); d137 1 a137 1 ip6_sysctl, d143 1 a143 1 udp6_sysctl, d153 1 a153 1 tcp_sysctl, d164 1 a164 1 icmp6_sysctl, d186 1 a186 1 ipsec6_sysctl, d193 1 a193 1 ipsec6_sysctl, d200 1 a200 1 ipsec6_sysctl, @ 1.54 log @Toggle the default value of ip6_v6only. Also provide a sample sysctl to retain the existing behavior. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.53 2003/09/06 03:36:32 itojun Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.53 2003/09/06 03:36:32 itojun Exp $"); d269 1 a269 1 int ip6_v6only = 0; @ 1.53 log @randomize IPv4/v6 fragment ID and IPv6 flowlabel. avoids predictability of these fields. ip_id.c is from openbsd. ip6_id.c is adapted by kame. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.52 2003/09/05 01:35:08 itojun Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.52 2003/09/05 01:35:08 itojun Exp $"); d269 1 a269 1 int ip6_v6only = 1; @ 1.52 log @call tcp_drain() if IPv4-less kernel @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.51 2003/09/04 09:17:07 itojun Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.51 2003/09/04 09:17:07 itojun Exp $"); a264 1 u_int32_t ip6_flow_seq; a270 1 u_int32_t ip6_id = 0UL; @ 1.51 log @revamp inpcb/in6pcb so that they are more aligned with each other. in6pcb lookup now uses hash(9). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.50 2003/08/14 07:57:41 itojun Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.50 2003/08/14 07:57:41 itojun Exp $"); d151 1 a151 1 tcp_init, 0, tcp_slowtimo, 0, @ 1.50 log @enforce ipsec policy on raw wildcard. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.49 2003/08/07 16:33:25 agc Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.49 2003/08/07 16:33:25 agc Exp $"); d149 1 a149 1 0, 0, 0, tcp6_drain, d151 1 a151 1 tcp_init, 0, tcp_slowtimo, tcp6_drain, @ 1.49 log @Move UCB-licensed code from 4-clause to 3-clause licence. Patches provided by Joel Baker in PR 22364, verified by myself. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.48 2003/08/07 08:52:32 itojun Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.48 2003/08/07 08:52:32 itojun Exp $"); d228 1 a228 1 { SOCK_RAW, &inet6domain, 0, PR_ATOMIC|PR_ADDR, @ 1.48 log @make net.inet6.ip6.redirect actually work. from Tomoyuki Sahara via kame @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.47 2003/04/17 19:58:57 thorpej Exp $ */ d45 1 a45 5 * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.47 2003/04/17 19:58:57 thorpej Exp $"); @ 1.47 log @Protect the definition of offsetof(). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.46 2002/11/11 18:26:42 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.46 2002/11/11 18:26:42 itojun Exp $"); a258 4 #ifndef IPV6_SENDREDIRECTS #define IPV6_SENDREDIRECTS 1 #endif d260 1 a260 1 int ip6_sendredirects = IPV6_SENDREDIRECTS; @ 1.47.2.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.57 2004/04/22 01:01:41 matt Exp $ */ d45 5 a49 1 * 3. Neither the name of the University nor the names of its contributors d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.57 2004/04/22 01:01:41 matt Exp $"); d136 1 a136 1 const struct ip6protosw inet6sw[] = { d141 1 a141 1 NULL, d147 1 a147 1 NULL, d153 1 a153 1 0, 0, 0, 0, d155 1 a155 1 tcp_init, 0, tcp_slowtimo, tcp_drain, d157 1 a157 1 NULL, d168 1 a168 1 NULL, d190 1 a190 1 NULL, d197 1 a197 1 NULL, d204 1 a204 1 NULL, d232 1 a232 1 { SOCK_RAW, &inet6domain, 0, PR_ATOMIC|PR_ADDR|PR_LASTHDR, d259 4 d264 1 a264 1 int ip6_sendredirects = 1; d273 1 d280 1 @ 1.47.2.2 log @Sync with HEAD. @ text @@ 1.47.2.3 log @Fix the sync with head I botched. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.47.2.1 2004/08/03 10:55:13 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.47.2.1 2004/08/03 10:55:13 skrll Exp $"); @ 1.47.2.4 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.47.2.3 2004/09/21 13:37:33 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.47.2.3 2004/09/21 13:37:33 skrll Exp $"); d130 1 a130 1 DOMAIN_DEFINE(inet6domain); /* forward declare and add to link set */ d238 1 a238 1 (struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], @ 1.47.2.5 log @Sync with HEAD. Here we go again... @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.47.2.4 2005/01/24 08:35:53 skrll Exp $ */ d65 1 a65 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.47.2.4 2005/01/24 08:35:53 skrll Exp $"); d139 1 a139 1 { SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR|PR_PURGEIF, d145 1 a145 1 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS|PR_PURGEIF, d155 1 a155 1 { SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR|PR_PURGEIF, d237 2 a238 2 (const struct protosw *)inet6sw, (const struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], @ 1.46 log @pmtu_probe is not used anywhere (it is used in KAME TCP6-only code). From: Krister Walfridsson @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.45 2002/08/20 22:06:05 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.45 2002/08/20 22:06:05 itojun Exp $"); d126 1 d128 1 @ 1.45 log @sync up use_deprecated handling with latest kame. - bind(deprecated) is allowed, trusting userland app is doing the right thing - use_deprecated default to 1 @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.44 2002/08/17 22:15:58 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.44 2002/08/17 22:15:58 itojun Exp $"); a288 1 int pmtu_probe = 60*2; @ 1.44 log @set default value for use_deprecated to 0, to avoid consequences with ftpd. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.43 2002/06/09 14:43:12 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.43 2002/06/09 14:43:12 itojun Exp $"); d273 1 a273 1 int ip6_use_deprecated = 0; /* allow deprecated addr (RFC2462 5.5.4) */ @ 1.43 log @whitespace cleanup @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.42 2002/06/08 20:06:44 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.42 2002/06/08 20:06:44 itojun Exp $"); d273 1 a273 1 int ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */ @ 1.42 log @whitespace cleanup @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.41 2002/05/29 02:58:30 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.41 2002/05/29 02:58:30 itojun Exp $"); d170 1 a170 1 0, d175 1 a175 1 0, d180 1 a180 1 0, d186 1 a186 1 0, d193 1 a193 1 0, d200 1 a200 1 0, @ 1.41 log @move per-interface ip6/icmp6 stat to ifnet->if_afdata. sync w/kame @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.40 2002/05/28 03:04:06 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.40 2002/05/28 03:04:06 itojun Exp $"); d170 1 a170 1 0, d175 1 a175 1 0, d180 1 a180 1 0, d186 1 a186 1 0, d193 1 a193 1 0, d200 1 a200 1 0, d225 1 a225 1 pim6_input, rip6_output, 0, rip6_ctloutput, @ 1.40 log @limit number of IPv6 fragments (not the fragment queue size) to fight against lots-of-frags DoS attacks. sync w/kame @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.39 2002/03/15 09:25:43 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.39 2002/03/15 09:25:43 itojun Exp $"); d243 2 a244 1 sizeof(struct sockaddr_in6) }; @ 1.39 log @have tcp6_drain @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.38 2001/12/21 08:54:19 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.38 2001/12/21 08:54:19 itojun Exp $"); d266 1 @ 1.39.6.1 log @Pull up revision 1.44 (requested by itojun in ticket #697): set default value for use_deprecated to 0, to avoid consequences with ftpd. @ text @d1 1 a1 1 /* $NetBSD$ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD$"); d271 1 a271 1 int ip6_use_deprecated = 0; /* allow deprecated addr (RFC2462 5.5.4) */ @ 1.39.6.2 log @Pull up revision 1.45 (requested by itojun in ticket #708): Allow bind() of deprecated addresses, trusting userland application knows what it's doing. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.39.6.1 2002/08/18 00:56:19 lukem Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.39.6.1 2002/08/18 00:56:19 lukem Exp $"); d271 1 a271 1 int ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */ @ 1.39.6.3 log @Pull up revision 1.50 (requested by itojun in ticket #1409): enforce ipsec policy on raw wildcard. @ text @d1 1 a1 1 /* $NetBSD$ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD$"); d230 1 a230 1 { SOCK_RAW, &inet6domain, 0, PR_ATOMIC|PR_ADDR|PR_LASTHDR, @ 1.39.4.1 log @Catch up with -current. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.41 2002/05/29 02:58:30 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.41 2002/05/29 02:58:30 itojun Exp $"); d243 1 a243 2 sizeof(struct sockaddr_in6), in6_domifattach, in6_domifdetach, }; a265 1 int ip6_maxfrags = 200; @ 1.39.4.2 log @catch up with -current. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.43 2002/06/09 14:43:12 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.43 2002/06/09 14:43:12 itojun Exp $"); d170 1 a170 1 0, d175 1 a175 1 0, d180 1 a180 1 0, d186 1 a186 1 0, d193 1 a193 1 0, d200 1 a200 1 0, d225 1 a225 1 pim6_input, rip6_output, 0, rip6_ctloutput, @ 1.39.4.3 log @catch up with -current. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.45 2002/08/20 22:06:05 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.45 2002/08/20 22:06:05 itojun Exp $"); @ 1.38 log @call encap6_ctlinput on icmp6 against tunnelled packet. sync w/kame @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.37 2001/12/21 06:30:44 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.37 2001/12/21 06:30:44 itojun Exp $"); d151 1 a151 1 0, 0, 0, tcp_drain, d153 1 a153 1 tcp_init, 0, tcp_slowtimo, tcp_drain, @ 1.37 log @use radix table for inbound tunnel lookup (would increase performance for machines with a lot of tunnels). update route cache for IPvX-over-IPv6 tunnel on path MTU discovery. snyc with kame @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.36 2001/12/21 03:58:15 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.36 2001/12/21 03:58:15 itojun Exp $"); d207 1 a207 1 encap6_input, rip6_output, 0, rip6_ctloutput, d213 1 a213 1 encap6_input, rip6_output, 0, rip6_ctloutput, d219 1 a219 1 encap6_input, rip6_output, 0, rip6_ctloutput, d225 1 a225 1 pim6_input, rip6_output, 0, rip6_ctloutput, d273 1 a273 1 * walk list every 5 sec. */ @ 1.36 log @move in6_gif_hlim decl to in6_gif.c. sync with kame @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.35 2001/12/21 03:21:51 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.35 2001/12/21 03:21:51 itojun Exp $"); d209 1 a209 1 0, 0, 0, 0, a214 3 #ifndef INET6 0, 0, 0, 0, #else a215 1 #endif d221 1 a221 1 0, 0, 0, 0, @ 1.35 log @move protosw fragment for gif/stf to their own source code. reduce #ifdef in stf code. sync with kame @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.34 2001/11/13 00:57:00 lukem Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.34 2001/11/13 00:57:00 lukem Exp $"); a125 5 #include "gif.h" #if NGIF > 0 #include #endif a274 1 int ip6_gif_hlim = GIF_HLIM; @ 1.34 log @add RCSIDs @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.33 2001/10/24 09:37:00 itojun Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD$"); d124 2 a130 2 #include a245 9 #if NGIF > 0 struct ip6protosw in6_gif_protosw = { SOCK_RAW, &inet6domain, 0/*IPPROTO_IPV[46]*/, PR_ATOMIC|PR_ADDR, in6_gif_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, }; #endif /*NGIF*/ a279 1 #if NGIF > 0 a280 3 #else int ip6_gif_hlim = 0; #endif @ 1.33 log @no tcp_fasttimo any more. PR 14333 @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.32 2001/10/24 06:36:38 itojun Exp $ */ d67 3 @ 1.32 log @more whitespace sync with kame @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.31 2001/10/16 04:57:38 itojun Exp $ */ d155 1 a155 1 tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, @ 1.31 log @remove unused #define. sync whitespace/comment with kame. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.30 2001/10/15 09:51:17 itojun Exp $ */ d117 1 a117 1 #endif /*IPSEC*/ @ 1.31.2.1 log @Sync the thorpej-mips-cache branch with -current. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.33 2001/10/24 09:37:00 itojun Exp $ */ d117 1 a117 1 #endif /* IPSEC */ d155 1 a155 1 tcp_init, 0, tcp_slowtimo, tcp_drain, @ 1.30 log @implement IPV6_V6ONLY socket option from draft-ietf-ipngwg-rfc2553bis-03.txt. IPV6_BINDV6ONLY (netbsd only) is deprecated, but still work just like before. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.29 2001/03/21 19:22:28 thorpej Exp $ */ a108 1 @ 1.29 log @Add a protosw flag, PR_ABRTACPTDIS (Abort on Accept of Disconnected Socket), and add it to the protocols that use that behavior (all PR_LISTEN protocols except for PF_LOCAL stream sockets). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.28 2001/03/01 16:31:41 itojun Exp $ */ d295 1 a295 3 #ifndef INET6_BINDV6ONLY int ip6_bindv6only = 1; #endif @ 1.29.2.1 log @Sync kqueue branch with -current. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.38 2001/12/21 08:54:19 itojun Exp $ */ a67 3 #include __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.38 2001/12/21 08:54:19 itojun Exp $"); d110 1 d118 1 a118 1 #endif /* IPSEC */ d122 5 d156 1 a156 1 tcp_init, 0, tcp_slowtimo, tcp_drain, d210 1 a210 1 encap6_input, rip6_output, encap6_ctlinput, rip6_ctloutput, d212 1 a212 1 encap_init, 0, 0, 0, d216 1 a216 1 encap6_input, rip6_output, encap6_ctlinput, rip6_ctloutput, d218 3 d222 1 d226 1 a226 1 encap6_input, rip6_output, encap6_ctlinput, rip6_ctloutput, d228 1 a228 1 encap_init, 0, 0, 0, d232 1 a232 1 pim6_input, rip6_output, 0, rip6_ctloutput, d244 9 d287 5 d294 4 a297 2 * walk list every 5 sec. */ int ip6_v6only = 1; @ 1.29.2.2 log @catch up with -current on kqueue branch @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.29.2.1 2002/01/10 20:03:18 thorpej Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.29.2.1 2002/01/10 20:03:18 thorpej Exp $"); d151 1 a151 1 0, 0, 0, tcp6_drain, d153 1 a153 1 tcp_init, 0, tcp_slowtimo, tcp6_drain, d170 1 a170 1 0, d175 1 a175 1 0, d180 1 a180 1 0, d186 1 a186 1 0, d193 1 a193 1 0, d200 1 a200 1 0, d225 1 a225 1 pim6_input, rip6_output, 0, rip6_ctloutput, d243 1 a243 2 sizeof(struct sockaddr_in6), in6_domifattach, in6_domifdetach, }; a265 1 int ip6_maxfrags = 200; @ 1.29.2.3 log @sync kqueue branch with HEAD @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.29.2.2 2002/06/23 17:51:14 jdolecek Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.29.2.2 2002/06/23 17:51:14 jdolecek Exp $"); @ 1.28 log @make sure to enforce inbound ipsec policy checking, for any protocols on top of ip (check it when final header is visited). sync with kame. XXX kame team will need to re-check policy engine code @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.27 2001/02/21 00:11:53 itojun Exp $ */ d150 1 a150 1 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN, @ 1.28.2.1 log @Catch up with -current. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.29 2001/03/21 19:22:28 thorpej Exp $ */ d150 1 a150 1 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS, @ 1.28.2.2 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.28.2.1 2001/04/09 01:58:38 nathanw Exp $ */ d110 1 d295 3 a297 1 int ip6_v6only = 1; @ 1.28.2.3 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD$ */ a67 3 #include __KERNEL_RCSID(0, "$NetBSD$"); d117 1 a117 1 #endif /* IPSEC */ d155 1 a155 1 tcp_init, 0, tcp_slowtimo, tcp_drain, @ 1.28.2.4 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.28.2.3 2001/11/14 19:18:08 nathanw Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.28.2.3 2001/11/14 19:18:08 nathanw Exp $"); d124 5 d212 1 a212 1 encap6_input, rip6_output, encap6_ctlinput, rip6_ctloutput, d214 1 a214 1 encap_init, 0, 0, 0, d218 1 a218 1 encap6_input, rip6_output, encap6_ctlinput, rip6_ctloutput, d220 3 d224 1 d228 1 a228 1 encap6_input, rip6_output, encap6_ctlinput, rip6_ctloutput, d230 1 a230 1 encap_init, 0, 0, 0, d234 1 a234 1 pim6_input, rip6_output, 0, rip6_ctloutput, d246 9 d289 5 d296 1 a296 1 * walk list every 5 sec. */ @ 1.28.2.5 log @Catch up to -current. (CVS: It's not just a program. It's an adventure!) @ text @d1 1 a1 1 /* $NetBSD$ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD$"); d151 1 a151 1 0, 0, 0, tcp6_drain, d153 1 a153 1 tcp_init, 0, tcp_slowtimo, tcp6_drain, @ 1.28.2.6 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.28.2.5 2002/04/01 07:48:50 nathanw Exp $ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD: in6_proto.c,v 1.28.2.5 2002/04/01 07:48:50 nathanw Exp $"); d170 1 a170 1 0, d175 1 a175 1 0, d180 1 a180 1 0, d186 1 a186 1 0, d193 1 a193 1 0, d200 1 a200 1 0, d225 1 a225 1 pim6_input, rip6_output, 0, rip6_ctloutput, d243 1 a243 2 sizeof(struct sockaddr_in6), in6_domifattach, in6_domifdetach, }; a265 1 int ip6_maxfrags = 200; @ 1.28.2.7 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD$ */ d69 1 a69 1 __KERNEL_RCSID(0, "$NetBSD$"); d289 1 @ 1.27 log @need PR_ADDR|PR_ATOMIC for IPPROTO_EON. fix typo. from chopps, sync with kame @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.26 2001/02/20 08:49:16 itojun Exp $ */ d144 1 a144 1 { SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC | PR_ADDR, d160 1 a160 1 { SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC | PR_ADDR, d165 1 a165 1 { SOCK_RAW, &inet6domain, IPPROTO_ICMPV6, PR_ATOMIC | PR_ADDR, d209 1 a209 1 { SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR, d215 1 a215 1 { SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR, d225 1 a225 1 { SOCK_RAW, &inet6domain, IPPROTO_EON, PR_ATOMIC|PR_ADDR, d231 1 a231 1 { SOCK_RAW, &inet6domain, IPPROTO_PIM, PR_ATOMIC|PR_ADDR, d237 1 a237 1 { SOCK_RAW, &inet6domain, 0, PR_ATOMIC | PR_ADDR, @ 1.26 log @ISO over IPv4/v6 by EON encapsulation. from chopps, sync with kame. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.25 2001/02/11 06:49:52 itojun Exp $ */ d225 1 a225 1 { SOCK_RAW, &inet6domain, IPPROTO_EON, 0, d227 1 a227 1 rip_usrreq, /*XXX*/ @ 1.25 log @pull latest kame pcbnotify code. synchronizes ICMPv6 path mtu discovery behavior with other protocols (i.e. validation, use of hiwat/lowat). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.24 2001/02/11 05:25:04 itojun Exp $ */ d70 1 d224 7 @ 1.24 log @whitespace sync with kame @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.23 2000/10/19 20:23:02 itojun Exp $ */ d165 1 a165 1 icmp6_input, rip6_output, 0, rip6_ctloutput, @ 1.23 log @remove #ifdef TCP6. it is not likely for us to bring in sys/netinet6/tcp6*.c (separate TCP/IPv6 stack) into netbsd-current. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.22 2000/10/18 21:14:15 itojun Exp $ */ d246 1 a246 1 { AF_INET6, "internet6", 0, 0, 0, @ 1.22 log @verify ICMPv6 too big messages based on TCP pcbs, and/or IPsec SA. TODO: udp6, and sendto consideration. as pmtud is mandatory for IPv6, it is rather important for us to support those cases. TODO: more testing TODO: kame sync @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.21 2000/10/10 16:26:44 itojun Exp $ */ a85 1 #ifndef TCP6 a87 2 #endif #ifndef TCP6 a88 1 #endif a93 1 #ifndef TCP6 a100 7 #else #include #include #include #include #include #endif a148 8 #ifdef TCP6 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN, tcp6_input, 0, tcp6_ctlinput, tcp6_ctloutput, tcp6_usrreq, tcp6_init, tcp6_fasttimo, tcp6_slowtimo, tcp6_drain, tcp6_sysctl, }, #else a158 1 #endif /*TCP6*/ a318 75 #ifdef TCP6 /* TCP on IP6 parameters */ int tcp6_sendspace = 1024 * 8; int tcp6_recvspace = 1024 * 8; int tcp6_mssdflt = TCP6_MSS; int tcp6_rttdflt = TCP6TV_SRTTDFLT / PR_SLOWHZ; int tcp6_do_rfc1323 = 1; int tcp6_conntimeo = TCP6TV_KEEP_INIT; /* initial connection timeout */ int tcp6_43maxseg = 0; int tcp6_pmtu = 0; /* * Parameters for keepalive option. * Connections for which SO_KEEPALIVE is set will be probed * after being idle for a time of tcp6_keepidle (in units of PR_SLOWHZ). * Starting at that time, the connection is probed at intervals * of tcp6_keepintvl (same units) until a response is received * or until tcp6_keepcnt probes have been made, at which time * the connection is dropped. Note that a tcp6_keepidle value * under 2 hours is nonconformant with RFC-1122, Internet Host Requirements. */ int tcp6_keepidle = TCP6TV_KEEP_IDLE; /* time before probing idle */ int tcp6_keepintvl = TCP6TV_KEEPINTVL; /* interval betwn idle probes */ int tcp6_keepcnt = TCP6TV_KEEPCNT; /* max idle probes */ int tcp6_maxpersistidle = TCP6TV_KEEP_IDLE; /* max idle time in persist */ #ifndef INET_SERVER #define TCP6_LISTEN_HASH_SIZE 17 #define TCP6_CONN_HASH_SIZE 97 #define TCP6_SYN_HASH_SIZE 293 #define TCP6_SYN_BUCKET_SIZE 35 #else #define TCP6_LISTEN_HASH_SIZE 97 #define TCP6_CONN_HASH_SIZE 9973 #define TCP6_SYN_HASH_SIZE 997 #define TCP6_SYN_BUCKET_SIZE 35 #endif int tcp6_listen_hash_size = TCP6_LISTEN_HASH_SIZE; int tcp6_conn_hash_size = TCP6_CONN_HASH_SIZE; struct tcp6_hash_list tcp6_listen_hash[TCP6_LISTEN_HASH_SIZE], tcp6_conn_hash[TCP6_CONN_HASH_SIZE]; int tcp6_syn_cache_size = TCP6_SYN_HASH_SIZE; int tcp6_syn_cache_limit = TCP6_SYN_HASH_SIZE*TCP6_SYN_BUCKET_SIZE; int tcp6_syn_bucket_limit = 3*TCP6_SYN_BUCKET_SIZE; struct syn_cache_head6 tcp6_syn_cache[TCP6_SYN_HASH_SIZE]; struct syn_cache_head6 *tcp6_syn_cache_first; int tcp6_syn_cache_interval = 8; /* runs timer every 4 seconds */ int tcp6_syn_cache_timeo = TCP6TV_KEEP_INIT; /* * Parameters for computing a desirable data segment size * given an upper bound (either interface MTU, or peer's MSS option)_. * As applications tend to use a buffer size that is a multiple * of kilobytes, try for something that divides evenly. However, * do not round down too much. * * Round segment size down to a multiple of TCP6_ROUNDSIZE if this * does not result in lowering by more than (size/TCP6_ROUNDFRAC). * For example, round 536 to 512. Older versions of the system * effectively used MCLBYTES (1K or 2K) as TCP6_ROUNDSIZE, with * a value of 1 for TCP6_ROUNDFRAC (eliminating its effect). * We round to a multiple of 256 for SLIP. */ #ifndef TCP6_ROUNDSIZE #define TCP6_ROUNDSIZE 256 /* round to multiple of 256 */ #endif #ifndef TCP6_ROUNDFRAC #define TCP6_ROUNDFRAC 10 /* round down at most N/10, or 10% */ #endif int tcp6_roundsize = TCP6_ROUNDSIZE; int tcp6_roundfrac = TCP6_ROUNDFRAC; #endif /*TCP6*/ @ 1.21 log @sync with kame ($KAME$) @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.20 2000/10/10 13:25:28 enami Exp $ */ d208 1 a208 1 ah6_input, 0, 0, 0, d215 1 a215 1 esp6_input, 0, 0, 0, @ 1.20 log @Don't initialize TCP twice on v4/v6 dual stack kernel. @ text @d1 2 a2 2 /* $NetBSD: in6_proto.c,v 1.19 2000/07/28 04:06:59 itojun Exp $ */ /* $KAME: in6_proto.c,v 1.64 2000/06/20 16:20:27 itojun Exp $ */ @ 1.19 log @nuke the following sysctl variables. "ppsratelimit" should work better. need to recompile sbin/sysctl after updating /usr/include. net.inet.tcp.rstratelimit net.inet.icmp.errratelimit net.inet6.icmp6.errratelimit @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.18 2000/07/06 12:36:18 itojun Exp $ */ d172 2 a173 2 #ifdef INET /* don't call timeout routines twice */ tcp_init, 0, 0, tcp_drain, @ 1.18 log @- do not use bitfield for router renumbering header. - add protection mechanism against ND cache corruption due to bad NUD hints. - more stats - icmp6 pps limitation. TOOD: should implement ppsratecheck(9). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.17 2000/04/19 06:30:56 itojun Exp $ */ a337 1 struct timeval icmp6errratelim = { 0, 0 }; /* no ratelimit */ @ 1.17 log @introduce sys/netinet/ip_encap.c, to dispatch inbound packets to protocol handlers, based on src/dst (for ip proto #4/41). see comment in ip_encap.c for details of the problem we have. there are too many protocol specs for ip proto #4/41. backward compatibility with MROUTING case is now provided in ip_encap.c. fix ipip to work with gif (using ip_encap.c). sorry for breakage. gif now uses ip_encap.c. introduce stf pseudo interface (implements 6to4, another IPv6-over-IPv4 code with ip proto #41). @ text @d1 2 a2 2 /* $NetBSD: in6_proto.c,v 1.16 2000/02/26 09:09:17 itojun Exp $ */ /* $KAME: in6_proto.c,v 1.40 2000/02/24 16:34:49 itojun Exp $ */ d7 1 a7 1 * d19 1 a19 1 * d338 2 a339 1 struct timeval icmp6errratelim = { 0, 1000 }; /* 1000usec = 1msec */ @ 1.17.4.1 log @pullup (approved by releng-1-5) switch from net.inet*.*.*ratelimit to net.inet*.*.ppslimit. (tags are rough estimate - we had some try-and-error in main trunc) sys/netinet/icmp6.h 1.9 -> 1.11 sys/netinet/icmp_var.h 1.15 -> 1.17 sys/netinet/in_proto.c 1.39 -> 1.42 sys/netinet/ip_icmp.c 1.50 -> 1.51, 1.52 -> 1.54 sys/netinet/tcp_input.c 1.111 -> 1.112, 1.115 -> 1.117 sys/netinet/tcp_usrreq.c 1.52 -> 1.53 sys/netinet/tcp_var.h 1.72 -> 1.75 sys/netinet6/icmp6.c 1.34 -> 1.35, 1.36 -> 1.38 sys/netinet6/in6_proto.c 1.17 -> 1.19 @ text @d1 2 a2 2 /* $NetBSD: in6_proto.c,v 1.17 2000/04/19 06:30:56 itojun Exp $ */ /* $KAME: in6_proto.c,v 1.64 2000/06/20 16:20:27 itojun Exp $ */ d7 1 a7 1 * d19 1 a19 1 * d338 1 a338 1 int icmp6errppslim = 100; /* 100pps */ @ 1.17.4.2 log @Pullup 1.20 [enami]: Don't initialize TCP twice on v4/v6 dual stack kernel. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.17.4.1 2000/08/16 01:22:26 itojun Exp $ */ d172 2 a173 2 #ifdef INET /* don't call initialization and timeout routines twice */ 0, 0, 0, tcp_drain, @ 1.17.4.3 log @Pull up revision 1.28 (via patch, requested by itojun): Ensure that we enforce inbound IPsec policy on all IP protocols, not just TCP, UDP and ICMP. @ text @d1 2 a2 2 /* $NetBSD: in6_proto.c,v 1.17.4.2 2000/10/17 21:40:26 tv Exp $ */ /* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */ d155 1 a155 1 { SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR, d180 1 a180 1 { SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, d185 2 a186 2 { SOCK_RAW, &inet6domain, IPPROTO_ICMPV6, PR_ATOMIC|PR_ADDR|PR_LASTHDR, icmp6_input, rip6_output, rip6_ctlinput, rip6_ctloutput, d229 1 a229 1 { SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR|PR_LASTHDR, d235 1 a235 1 { SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR|PR_LASTHDR, d244 1 a244 1 { SOCK_RAW, &inet6domain, IPPROTO_PIM, PR_ATOMIC|PR_ADDR|PR_LASTHDR, d250 1 a250 1 { SOCK_RAW, &inet6domain, 0, PR_ATOMIC|PR_ADDR, @ 1.17.4.4 log @Pull up rev. 1.50 (requested by itojun in ticket #50): enforce ipsec policy on raw wildcard. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.17.4.3 2001/03/11 21:12:19 he Exp $ */ d250 1 a250 1 { SOCK_RAW, &inet6domain, 0, PR_ATOMIC|PR_ADDR|PR_LASTHDR, @ 1.16 log @implement rip6_ctlinput, to cope with routing changes correctly. (IMHO we need rip_ctlinput as well) @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.15 2000/02/26 09:01:59 itojun Exp $ */ d85 1 d228 1 a228 1 #if NGIF > 0 d230 2 a231 2 in6_gif_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, d234 1 a234 1 #ifdef INET6 d236 3 a238 2 in6_gif_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, d240 3 a243 2 #endif /* INET6 */ #endif /* GIF */ d256 9 @ 1.15 log @make it possible to throw IPv6 packet with proto=4/41. (in normal case we don't do it, but this is how IPv4 in_proto is written) @ text @d1 2 a2 1 /* $NetBSD: in6_proto.c,v 1.14 2000/02/14 19:45:50 thorpej Exp $ */ d180 1 a180 1 rip6_input, rip6_output, 0, rip6_ctloutput, @ 1.14 log @Use ratecheck() for ICMP6 rate limiting. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.13 2000/02/06 12:49:45 itojun Exp $ */ d228 2 a229 2 in6_gif_input,0, 0, 0, 0, d234 2 a235 2 in6_gif_input,0, 0, 0, 0, d248 2 a249 2 rip6_usrreq, rip6_init, 0, 0, 0, @ 1.13 log @fix include pathname for better rfc2292 compliance. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.12 2000/01/06 15:46:09 itojun Exp $ */ d325 1 a325 1 u_int icmp6errratelim = 1000; /* 1000usec = 1msec */ @ 1.12 log @remove extra portability #ifdef (like #ifdef __FreeBSD__) in KAME IPv6/IPsec code, from netbsd-current repository. #ifdef'ed version is always available from ftp.kame.net. XXX please do not make too many diff-unfriendly changes, we'll need to take bunch of diffs on upgrade... @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.11 2000/01/06 06:41:19 itojun Exp $ */ d91 1 a91 1 #include d93 1 a93 1 #include @ 1.11 log @make IPV6_BINDV6ONLY setsockopt available. it controls behavior of AF_INET6 wildcard listening socket. heavily documented in ip6(4). net.inet6.ip6.bindv6only defines default value. default is 1. "options INET6_BINDV6ONLY" removes any code fragment that supports IPV6_BINDV6ONLY == 0 case (not defopt'ed as use of this is rare). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.10 2000/01/02 16:31:18 itojun Exp $ */ a66 1 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__NetBSD__) a67 1 #ifdef __NetBSD__ /*XXX*/ a68 2 #endif #endif a71 3 #if defined(__FreeBSD__) #include #endif a75 4 #ifdef __FreeBSD__ #include #include #endif d84 1 a84 1 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || (defined(__NetBSD__) && !defined(TCP6)) || defined(__OpenBSD__) || (defined(__bsdi__) && _BSDI_VERSION >= 199802) d88 1 a88 1 #if (defined(__NetBSD__) && !defined(TCP6)) || defined(__OpenBSD__) || (defined(__bsdi__) && _BSDI_VERSION >= 199802) a93 1 #if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(__OpenBSD__) && !(defined(__bsdi__) && _BSDI_VERSION >= 199802) a94 1 #endif d96 1 a96 8 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__OpenBSD__) || (defined(__bsdi__) && _BSDI_VERSION >= 199802) #include #include #include #include #include #else #if defined(__NetBSD__) && !defined(TCP6) a110 1 #endif a111 1 #if !defined(__OpenBSD__) && !(defined(__bsdi__) && _BSDI_VERSION >= 199802) a113 1 #endif a117 3 #ifdef __FreeBSD__ #include #endif a118 3 #ifdef __OpenBSD__ /*KAME IPSEC*/ #undef IPSEC #endif a144 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 static struct pr_usrreqs nousrreqs; #endif a150 1 #ifndef __FreeBSD__ a151 5 #else # if __FreeBSD__ >= 3 &nousrreqs, # endif #endif d155 1 a155 7 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, 0, #elif defined(HAVE_NRL_INPCB) udp6_usrreq, 0, #else udp6_usrreq, udp6_init, #endif a156 4 #ifndef __FreeBSD__ #ifdef HAVE_NRL_INPCB udp_sysctl, #else a157 6 #endif #else # if __FreeBSD__ >= 3 &udp6_usrreqs, # endif #endif a163 1 #ifndef __FreeBSD__ a164 5 #else # if __FreeBSD__ >= 3 &tcp6_usrreqs, # endif #endif a168 5 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, #elif defined(HAVE_NRL_INPCB) tcp6_usrreq, #else a169 1 #endif a174 1 #ifndef __FreeBSD__ a175 5 #else # if __FreeBSD__ >= 3 &tcp6_usrreqs, # endif #endif a179 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, #else a180 1 #endif a181 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &rip6_usrreqs #endif a184 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, #else a185 1 #endif a186 1 #ifndef __FreeBSD__ a187 5 #else # if __FreeBSD__ >= 3 &rip6_usrreqs # endif #endif a192 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif a197 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif a202 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif a208 1 #ifndef __FreeBSD__ a209 5 #else # if __FreeBSD__ >= 3 &nousrreqs, # endif #endif a215 1 #ifndef __FreeBSD__ a216 5 #else # if __FreeBSD__ >= 3 &nousrreqs, # endif #endif a222 1 #ifndef __FreeBSD__ a223 5 #else # if __FreeBSD__ >= 3 &nousrreqs, # endif #endif a230 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif a236 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif a241 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, #else a242 1 #endif a243 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &rip6_usrreqs # endif a247 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, 0, #else a248 1 #endif a249 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &rip6_usrreqs #endif a252 4 #ifdef __FreeBSD__ extern int in6_inithead __P((void **, int)); #endif a256 3 #ifdef __FreeBSD__ in6_inithead, #else a257 1 #endif a260 4 #ifdef __FreeBSD__ DOMAIN_SET(inet6); #endif d295 1 a295 4 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 && defined(MAPPED_ADDR_ENABLED) int ip6_mapped_addr_on = 1; #endif #if defined(__NetBSD__) && !defined(INET6_BINDV6ONLY) a303 1 #ifndef __bsdi__ a310 1 #endif a406 164 #ifdef __FreeBSD__ /* * sysctl related items. */ SYSCTL_NODE(_net, PF_INET6, inet6, CTLFLAG_RW, 0, "Internet6 Family"); /* net.inet6 */ SYSCTL_NODE(_net_inet6, IPPROTO_IPV6, ip6, CTLFLAG_RW, 0, "IP6"); SYSCTL_NODE(_net_inet6, IPPROTO_ICMPV6, icmp6, CTLFLAG_RW, 0, "ICMP6"); SYSCTL_NODE(_net_inet6, IPPROTO_UDP, udp6, CTLFLAG_RW, 0, "UDP6"); SYSCTL_NODE(_net_inet6, IPPROTO_TCP, tcp6, CTLFLAG_RW, 0, "TCP6"); #ifdef IPSEC SYSCTL_NODE(_net_inet6, IPPROTO_ESP, ipsec6, CTLFLAG_RW, 0, "IPSEC6"); #endif /* IPSEC */ /* net.inet6.ip6 */ static int sysctl_ip6_forwarding SYSCTL_HANDLER_ARGS { int error = 0; int old_ip6_forwarding; int changed; error = SYSCTL_OUT(req, arg1, sizeof(int)); if (error || !req->newptr) return (error); old_ip6_forwarding = ip6_forwarding; error = SYSCTL_IN(req, arg1, sizeof(int)); if (error != 0) return (error); changed = (ip6_forwarding ? 1 : 0) ^ (old_ip6_forwarding ? 1 : 0); if (changed == 0) return (error); if (ip6_forwarding != 0) { /* host becomes router */ int s = splnet(); struct nd_prefix *pr, *next; for (pr = nd_prefix.lh_first; pr; pr = next) { next = pr->ndpr_next; if (!IN6_IS_ADDR_UNSPECIFIED(&pr->ndpr_addr)) in6_ifdel(pr->ndpr_ifp, &pr->ndpr_addr); prelist_remove(pr); } splx(s); } else { /* router becomes host */ struct socket so; /* XXX: init dummy so */ bzero(&so, sizeof(so)); while(!LIST_EMPTY(&rr_prefix)) delete_each_prefix(&so, LIST_FIRST(&rr_prefix), PR_ORIG_KERNEL); } return (error); } SYSCTL_OID(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding, CTLTYPE_INT|CTLFLAG_RW, &ip6_forwarding, 0, sysctl_ip6_forwarding, "I", ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_SENDREDIRECTS, redirect, CTLFLAG_RW, &ip6_sendredirects, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM, hlim, CTLFLAG_RW, &ip6_defhlim, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets, CTLFLAG_RW, &ip6_maxfragpackets, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv, CTLFLAG_RW, &ip6_accept_rtadv, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_KEEPFAITH, keepfaith, CTLFLAG_RW, &ip6_keepfaith, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_LOG_INTERVAL, log_interval, CTLFLAG_RW, &ip6_log_interval, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_HDRNESTLIMIT, hdrnestlimit, CTLFLAG_RW, &ip6_hdrnestlimit, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DAD_COUNT, dad_count, CTLFLAG_RW, &ip6_dad_count, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_FLOWLABEL, auto_flowlabel, CTLFLAG_RW, &ip6_auto_flowlabel, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFMCASTHLIM, defmcasthlim, CTLFLAG_RW, &ip6_defmcasthlim, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, CTLFLAG_RW, &ip6_gif_hlim, 0, ""); SYSCTL_STRING(_net_inet6_ip6, IPV6CTL_KAME_VERSION, kame_version, CTLFLAG_RD, __KAME_VERSION, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USE_DEPRECATED, use_deprecated, CTLFLAG_RW, &ip6_use_deprecated, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RR_PRUNE, rr_prune, CTLFLAG_RW, &ip6_rr_prune, 0, ""); #if defined(__FreeBSD__) && __FreeBSD__ >= 3 && defined(MAPPED_ADDR_ENABLED) SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAPPED_ADDR, mapped_addr, CTLFLAG_RW, &ip6_mapped_addr_on, 0, ""); #endif /* MAPPED_ADDR_ENABLED */ /* net.inet6.icmp6 */ SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRACCEPT, rediraccept, CTLFLAG_RW, &icmp6_rediraccept, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRTIMEOUT, redirtimeout, CTLFLAG_RW, &icmp6_redirtimeout, 0, ""); SYSCTL_STRUCT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, CTLFLAG_RD, &icmp6stat, icmp6stat, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ERRRATELIMIT, errratelimit, CTLFLAG_RW, &icmp6errratelim, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PRUNE, nd6_prune, CTLFLAG_RW, &nd6_prune, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DELAY, nd6_delay, CTLFLAG_RW, &nd6_delay, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_UMAXTRIES, nd6_umaxtries, CTLFLAG_RW, &nd6_umaxtries, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MMAXTRIES, nd6_mmaxtries, CTLFLAG_RW, &nd6_mmaxtries, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_USELOOPBACK, nd6_useloopback, CTLFLAG_RW, &nd6_useloopback, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PROXYALL, nd6_proxyall, CTLFLAG_RW, &nd6_proxyall, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO, nodeinfo, CTLFLAG_RW, &icmp6_nodeinfo, 0, ""); #if __FreeBSD__ < 3 /* net.inet6.udp6 */ SYSCTL_INT(_net_inet6_udp6, UDP6CTL_SENDMAX, sendmax, CTLFLAG_RW, &udp6_sendspace, 0, ""); SYSCTL_INT(_net_inet6_udp6, UDP6CTL_RECVSPACE, recvspace, CTLFLAG_RW, &udp6_recvspace, 0, ""); /* net.inet6.tcp6 */ SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_MSSDFLT, mssdflt, CTLFLAG_RW, &tcp6_mssdflt, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_DO_RFC1323, do_rfc1323, CTLFLAG_RW, &tcp6_do_rfc1323, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_KEEPIDLE, keepidle, CTLFLAG_RW, &tcp6_keepidle, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_KEEPINTVL, keepintvl, CTLFLAG_RW, &tcp6_keepintvl, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_KEEPCNT, keepcnt, CTLFLAG_RW, &tcp6_keepcnt, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_MAXPERSISTIDLE, maxpersistidle, CTLFLAG_RW, &tcp6_maxpersistidle, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SENDSPACE, sendspace, CTLFLAG_RW, &tcp6_sendspace, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_RECVSPACE, recvspace, CTLFLAG_RW, &tcp6_recvspace, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_CONNTIMEO, conntimeo, CTLFLAG_RW, &tcp6_conntimeo, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_PMTU, pmtu, CTLFLAG_RW, &tcp6_pmtu, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_PMTU_EXPIRE, pmtu_expire, CTLFLAG_RW, &pmtu_expire, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_PMTU_PROBE, pmtu_probe, CTLFLAG_RW, &pmtu_probe, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_43MAXSEG, pmtu_43maxseg, CTLFLAG_RW, &tcp6_43maxseg, 0, ""); SYSCTL_STRUCT(_net_inet6_tcp6, TCP6CTL_STATS, stats, CTLFLAG_RD, &tcp6stat, tcp6stat, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SYN_CACHE_LIMIT, syn_cache_limit, CTLFLAG_RW, &tcp6_syn_cache_limit, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SYN_BUCKET_LIMIT, syn_bucket_limit, CTLFLAG_RW, &tcp6_syn_bucket_limit, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SYN_CACHE_INTER, syn_cache_interval, CTLFLAG_RW, &tcp6_syn_cache_interval, 0, ""); #endif /* !(defined(__FreeBSD__) && __FreeBSD__ >= 3) */ #endif /* __FreeBSD__ */ @ 1.10 log @add net.inet6.icmp6.nodeinfo sysctl. this allows you to disable/enable ICMPv6 node information query/reply processing (which tells remote end the gethostname(3) setting, interface addresses on the node, and some other things - documented in draft-ietf-ipngwg-icmp-name-lookup* or something alike). to test it, try ping6 -w ::1 with nodeinfo=0 and nodeinfo=1. (sync with kame change) @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.9 1999/12/13 15:17:22 itojun Exp $ */ d443 7 d650 4 @ 1.9 log @sync IPv6 part with latest KAME tree. IPsec part is left unmodified due to massive changes in KAME side. - IPv6 output goes through nd6_output - faith can capture IPv4 packets as well - you can run IPv4-to-IPv6 translator using heavily modified DNS servers - per-interface statistics (required for IPv6 MIB) - interface autoconfig is revisited - udp input handling has a big change for mapped address support. - introduce in4_cksum() for non-overwriting checksumming - introduce m_pulldown() - neighbor discovery cleanups/improvements - netinet/in.h strictly conforms to RFC2553 (no extra defs visible to userland) - IFA_STATS is fixed a bit (not tested) - and more more more. TODO: - cleanup os-independency #ifdef - avoid rcvif dual use (for IPsec) to help ifdetach (sorry for jumbo commit, I can't separate this any more...) @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.8 1999/07/31 18:41:16 itojun Exp $ */ d472 1 d665 2 @ 1.8 log @sync with recent KAME. - loosen ipsec restriction on packet diredtion. - revise icmp6 redirect handling on IsRouter bit. - tcp/udp notification processing (link-local address case) - cosmetic fixes (better code share across *BSD). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.7 1999/07/30 10:35:36 itojun Exp $ */ d76 3 d83 4 d95 1 a95 1 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || (defined(__NetBSD__) && !defined(TCP6)) d99 1 a99 1 #if defined(__NetBSD__) && !defined(TCP6) d105 1 a105 1 #if !defined(__FreeBSD__) || __FreeBSD__ < 3 d109 1 a109 1 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) d133 1 d136 1 d141 7 d150 1 d165 2 d174 3 d182 8 a189 1 ip6_init, 0, frag6_slowtimo, frag6_drain, ip6_sysctl d193 19 a211 2 udp6_usrreq, udp6_init, 0, 0, 0, udp6_sysctl d214 1 a214 1 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED | PR_WANTRCVD | PR_LISTEN, d217 8 a224 1 tcp6_init, tcp6_fasttimo, tcp6_slowtimo, tcp6_drain, tcp6_sysctl d227 1 a227 1 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED | PR_WANTRCVD | PR_LISTEN, d229 5 d235 8 a242 3 #ifdef INET /* If inet4, no need to have tcp_slowtimo and tcp_fasttimo happen TWICE */ tcp_init, NULL, NULL, tcp_drain, tcp_sysctl d244 3 a246 1 tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, tcp_sysctl d249 1 a249 1 #endif d252 3 d256 5 a260 1 0, 0, 0, 0, 0 d264 3 d268 9 a276 1 icmp6_init, icmp6_fasttimo, 0, 0, icmp6_sysctl d282 3 d290 3 d298 3 d306 8 a313 1 0, 0, 0, 0, ipsec6_sysctl d319 8 a326 1 0, 0, 0, 0, ipsec6_sysctl d332 8 a339 1 0, 0, 0, 0, ipsec6_sysctl d347 3 d356 3 d364 3 d368 1 d370 3 d377 9 a385 2 rip6_usrreq, rip6_init, 0, 0, 0, d389 4 d397 6 a402 1 rn_inithead, offsetof(struct sockaddr_in6, sin6_addr) << 3, d440 3 a442 1 d448 6 d456 1 d570 44 a613 2 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding, CTLFLAG_RW, &ip6_forwarding, 0, ""); d636 6 d665 1 d707 1 @ 1.8.2.1 log @Update thorpej_scsipi to -current as of a month ago @ text @d1 1 a1 2 /* $NetBSD: in6_proto.c,v 1.23 2000/10/19 20:23:02 itojun Exp $ */ /* $KAME: in6_proto.c,v 1.66 2000/10/10 15:35:47 itojun Exp $ */ d6 1 a6 1 * d18 1 a18 1 * d67 1 d69 1 d71 2 d88 1 a88 1 #include d91 2 d94 2 a95 1 #include d97 2 a98 1 #include d100 1 d102 8 d117 8 a132 1 a133 1 #include a147 2 #include d160 1 a160 2 ip6_init, 0, frag6_slowtimo, frag6_drain, ip6_sysctl, d164 8 a171 3 udp6_usrreq, udp6_init, 0, 0, 0, udp6_sysctl, d173 2 a174 1 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN, d177 3 a179 2 #ifdef INET /* don't call initialization and timeout routines twice */ 0, 0, 0, tcp_drain, d181 1 a181 1 tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, a182 1 tcp_sysctl, d184 1 d186 1 a186 1 rip6_input, rip6_output, rip6_ctlinput, rip6_ctloutput, d188 1 a188 1 0, 0, 0, 0, d193 1 a193 2 icmp6_init, icmp6_fasttimo, 0, 0, icmp6_sysctl, d212 1 a212 1 ah6_input, 0, ah6_ctlinput, 0, d214 1 a214 2 0, 0, 0, 0, ipsec6_sysctl, d218 1 a218 1 esp6_input, 0, esp6_ctlinput, 0, d220 1 a220 2 0, 0, 0, 0, ipsec6_sysctl, d226 1 a226 2 0, 0, 0, 0, ipsec6_sysctl, d229 1 a229 1 #ifdef INET d231 2 a232 2 encap6_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, d235 1 a235 1 #endif d237 2 a238 3 encap6_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, #ifndef INET6 a239 3 #else encap_init, 0, 0, 0, #endif d241 2 a255 9 #if NGIF > 0 struct ip6protosw in6_gif_protosw = { SOCK_RAW, &inet6domain, 0/*IPPROTO_IPV[46]*/, PR_ATOMIC|PR_ADDR, in6_gif_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, }; #endif /*NGIF*/ d260 1 a260 2 rn_inithead, offsetof(struct sockaddr_in6, sin6_addr) << 3, d263 4 a297 6 int ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */ int ip6_rr_prune = 5; /* router renumbering prefix * walk list every 5 sec. */ #ifndef INET6_BINDV6ONLY int ip6_bindv6only = 1; #endif a303 5 /* * BSDI4 defines these variables in in_proto.c... * XXX: what if we don't define INET? Should we define pmtu6_expire * or so? (jinmei@@kame.net 19990310) */ d320 76 a395 2 int icmp6errppslim = 100; /* 100pps */ int icmp6_nodeinfo = 1; /* enable/disable NI response */ d401 108 @ 1.8.2.2 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.8.2.1 2000/11/20 18:10:50 bouyer Exp $ */ d165 1 a165 1 icmp6_input, rip6_output, rip6_ctlinput, rip6_ctloutput, d246 1 a246 1 { AF_INET6, "internet6", 0, 0, 0, @ 1.8.2.3 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.8.2.2 2001/02/11 19:17:24 bouyer Exp $ */ a69 1 #include "opt_iso.h" d143 1 a143 1 { SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR, d159 1 a159 1 { SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR, d164 1 a164 1 { SOCK_RAW, &inet6domain, IPPROTO_ICMPV6, PR_ATOMIC|PR_ADDR|PR_LASTHDR, d208 1 a208 1 { SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR|PR_LASTHDR, d214 1 a214 1 { SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR|PR_LASTHDR, d223 1 a223 8 #ifdef ISO { SOCK_RAW, &inet6domain, IPPROTO_EON, PR_ATOMIC|PR_ADDR|PR_LASTHDR, encap6_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, /*XXX*/ 0, 0, 0, 0, }, #endif { SOCK_RAW, &inet6domain, IPPROTO_PIM, PR_ATOMIC|PR_ADDR|PR_LASTHDR, d229 1 a229 1 { SOCK_RAW, &inet6domain, 0, PR_ATOMIC|PR_ADDR, @ 1.8.2.4 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD$ */ d150 1 a150 1 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS, @ 1.8.8.1 log @Pull up to last week's -current. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.9 1999/12/13 15:17:22 itojun Exp $ */ a75 3 #if defined(__FreeBSD__) #include #endif a79 4 #ifdef __FreeBSD__ #include #include #endif d88 1 a88 1 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || (defined(__NetBSD__) && !defined(TCP6)) || defined(__OpenBSD__) || (defined(__bsdi__) && _BSDI_VERSION >= 199802) d92 1 a92 1 #if (defined(__NetBSD__) && !defined(TCP6)) || defined(__OpenBSD__) || (defined(__bsdi__) && _BSDI_VERSION >= 199802) d98 1 a98 1 #if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(__OpenBSD__) && !(defined(__bsdi__) && _BSDI_VERSION >= 199802) d102 1 a102 1 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__OpenBSD__) || (defined(__bsdi__) && _BSDI_VERSION >= 199802) a125 1 #if !defined(__OpenBSD__) && !(defined(__bsdi__) && _BSDI_VERSION >= 199802) a127 1 #endif a131 7 #ifdef __FreeBSD__ #include #endif #ifdef __OpenBSD__ /*KAME IPSEC*/ #undef IPSEC #endif a133 1 #include a147 2 #include a154 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 static struct pr_usrreqs nousrreqs; #endif d160 1 a160 8 ip6_init, 0, frag6_slowtimo, frag6_drain, #ifndef __FreeBSD__ ip6_sysctl, #else # if __FreeBSD__ >= 3 &nousrreqs, # endif #endif d164 2 a165 19 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, 0, #elif defined(HAVE_NRL_INPCB) udp6_usrreq, 0, #else udp6_usrreq, udp6_init, #endif 0, 0, 0, #ifndef __FreeBSD__ #ifdef HAVE_NRL_INPCB udp_sysctl, #else udp6_sysctl, #endif #else # if __FreeBSD__ >= 3 &udp6_usrreqs, # endif #endif d168 1 a168 1 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN, d171 1 a171 8 tcp6_init, tcp6_fasttimo, tcp6_slowtimo, tcp6_drain, #ifndef __FreeBSD__ tcp6_sysctl, #else # if __FreeBSD__ >= 3 &tcp6_usrreqs, # endif #endif d174 1 a174 1 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN, a175 5 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, #elif defined(HAVE_NRL_INPCB) tcp6_usrreq, #else d177 3 a179 3 #endif #ifdef INET /* don't call timeout routines twice */ tcp_init, 0, 0, tcp_drain, d181 1 a181 1 tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, d183 1 a183 6 #ifndef __FreeBSD__ tcp_sysctl, #else # if __FreeBSD__ >= 3 &tcp6_usrreqs, # endif a184 2 }, #endif /*TCP6*/ a186 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, #else d188 1 a188 5 #endif 0, 0, 0, 0, #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &rip6_usrreqs #endif a191 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, #else d193 1 a193 9 #endif icmp6_init, icmp6_fasttimo, 0, 0, #ifndef __FreeBSD__ icmp6_sysctl, #else # if __FreeBSD__ >= 3 &rip6_usrreqs # endif #endif a198 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif a203 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif a208 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif d214 1 a214 8 0, 0, 0, 0, #ifndef __FreeBSD__ ipsec6_sysctl, #else # if __FreeBSD__ >= 3 &nousrreqs, # endif #endif d220 1 a220 8 0, 0, 0, 0, #ifndef __FreeBSD__ ipsec6_sysctl, #else # if __FreeBSD__ >= 3 &nousrreqs, # endif #endif d226 1 a226 8 0, 0, 0, 0, #ifndef __FreeBSD__ ipsec6_sysctl, #else # if __FreeBSD__ >= 3 &nousrreqs, # endif #endif a233 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif a239 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif a244 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, #else a245 1 #endif a246 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &rip6_usrreqs # endif d251 2 a252 9 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, 0, #else rip6_usrreq, rip6_init, #endif 0, 0, 0, #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &rip6_usrreqs #endif a255 4 #ifdef __FreeBSD__ extern int in6_inithead __P((void **, int)); #endif d260 1 a260 6 #ifdef __FreeBSD__ in6_inithead, #else rn_inithead, #endif offsetof(struct sockaddr_in6, sin6_addr) << 3, d298 1 a298 3 int ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */ int ip6_rr_prune = 5; /* router renumbering prefix * walk list every 5 sec. */ a303 6 #ifndef __bsdi__ /* * BSDI4 defines these variables in in_proto.c... * XXX: what if we don't define INET? Should we define pmtu6_expire * or so? (jinmei@@kame.net 19990310) */ a305 1 #endif d419 2 a420 44 static int sysctl_ip6_forwarding SYSCTL_HANDLER_ARGS { int error = 0; int old_ip6_forwarding; int changed; error = SYSCTL_OUT(req, arg1, sizeof(int)); if (error || !req->newptr) return (error); old_ip6_forwarding = ip6_forwarding; error = SYSCTL_IN(req, arg1, sizeof(int)); if (error != 0) return (error); changed = (ip6_forwarding ? 1 : 0) ^ (old_ip6_forwarding ? 1 : 0); if (changed == 0) return (error); if (ip6_forwarding != 0) { /* host becomes router */ int s = splnet(); struct nd_prefix *pr, *next; for (pr = nd_prefix.lh_first; pr; pr = next) { next = pr->ndpr_next; if (!IN6_IS_ADDR_UNSPECIFIED(&pr->ndpr_addr)) in6_ifdel(pr->ndpr_ifp, &pr->ndpr_addr); prelist_remove(pr); } splx(s); } else { /* router becomes host */ struct socket so; /* XXX: init dummy so */ bzero(&so, sizeof(so)); while(!LIST_EMPTY(&rr_prefix)) delete_each_prefix(&so, LIST_FIRST(&rr_prefix), PR_ORIG_KERNEL); } return (error); } SYSCTL_OID(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding, CTLTYPE_INT|CTLFLAG_RW, &ip6_forwarding, 0, sysctl_ip6_forwarding, "I", ""); a442 6 SYSCTL_STRING(_net_inet6_ip6, IPV6CTL_KAME_VERSION, kame_version, CTLFLAG_RD, __KAME_VERSION, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USE_DEPRECATED, use_deprecated, CTLFLAG_RW, &ip6_use_deprecated, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RR_PRUNE, rr_prune, CTLFLAG_RW, &ip6_rr_prune, 0, ""); a465 1 #if __FreeBSD__ < 3 a506 1 #endif /* !(defined(__FreeBSD__) && __FreeBSD__ >= 3) */ @ 1.7 log @remove reference to in6_systm.h (file itself will be removed afterwords) @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.6 1999/07/27 06:23:57 explorer Exp $ */ d69 1 d71 1 @ 1.6 log @Fix a problem where tcp_slowtimo was called twice, once for ipv4 tcp and once for ipv6. This patch makes the ipv6 case pass NULLs in for fast and slow timeouts iff defined(INET) and passes in the right function if !defined(INET). Reveiwed by itojun@@iijlab.net. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.5 1999/07/22 03:59:42 itojun Exp $ */ a85 1 #include @ 1.5 log @change unnecessary u_long/long into u_int32_t or something relevant. more fixes should follow. @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.4 1999/07/09 22:57:27 thorpej Exp $ */ d176 4 d181 1 @ 1.4 log @defopt IPSEC and IPSEC_ESP (both into opt_ipsec.h). @ text @d1 1 a1 1 /* $NetBSD: in6_proto.c,v 1.3 1999/07/03 21:30:18 thorpej Exp $ */ d293 1 a293 1 u_long ip6_id = 0UL; @ 1.3 log @RCS ID police. @ text @d1 1 a1 1 /* $NetBSD$ */ d69 1 @ 1.2 log @IPv6 kernel code, based on KAME/NetBSD 1.4, SNAP kit 19990628. (Sorry for a big commit, I can't separate this into several pieces...) Pls check sys/netinet6/TODO and sys/netinet6/IMPLEMENTATION for details. - sys/kern: do not assume single mbuf, accept chained mbuf on passing data from userland to kernel (or other way round). - "midway" ATM card: ATM PVC pseudo device support, like those done in ALTQ package (ftp://ftp.csl.sony.co.jp/pub/kjc/). - sys/netinet/tcp*: IPv4/v6 dual stack tcp support. - sys/netinet/{ip6,icmp6}.h, sys/net/pfkeyv2.h: IETF document assumes those file to be there so we patch it up. - sys/netinet: IPsec additions are here and there. - sys/netinet6/*: most of IPv6 code sits here. - sys/netkey: IPsec key management code - dev/pci/pcidevs: regen In my understanding no code here is subject to export control so it should be safe. @ text @d1 2 @ 1.2.2.1 log @file in6_proto.c was added on branch chs-ubc2 on 1999-07-01 23:48:28 +0000 @ text @d1 499 @ 1.2.2.2 log @Sync w/ -current. @ text @a0 499 /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 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. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. 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. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @@(#)in_proto.c 8.1 (Berkeley) 6/10/93 */ #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__NetBSD__) #include "opt_inet.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || (defined(__NetBSD__) && !defined(TCP6)) #include #include #endif #if defined(__NetBSD__) && !defined(TCP6) #include #endif #include #include #include #if !defined(__FreeBSD__) || __FreeBSD__ < 3 #include #endif #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) #include #include #include #include #include #else #if defined(__NetBSD__) && !defined(TCP6) #include #include #include #include #include #include #include #else #include #include #include #include #include #endif #endif #include #include #include #include #ifdef IPSEC #include #ifdef IPSEC_ESP #include #endif #include #endif /*IPSEC*/ #include #include "gif.h" #if NGIF > 0 #include #endif #define offsetof(type, member) ((size_t)(&((type *)0)->member)) /* * TCP/IP protocol family: IP6, ICMP6, UDP, TCP. */ extern struct domain inet6domain; struct ip6protosw inet6sw[] = { { 0, &inet6domain, IPPROTO_IPV6, 0, 0, 0, 0, 0, 0, ip6_init, 0, frag6_slowtimo, frag6_drain, ip6_sysctl }, { SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC | PR_ADDR, udp6_input, 0, udp6_ctlinput, ip6_ctloutput, udp6_usrreq, udp6_init, 0, 0, 0, udp6_sysctl }, #ifdef TCP6 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED | PR_WANTRCVD | PR_LISTEN, tcp6_input, 0, tcp6_ctlinput, tcp6_ctloutput, tcp6_usrreq, tcp6_init, tcp6_fasttimo, tcp6_slowtimo, tcp6_drain, tcp6_sysctl }, #else { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED | PR_WANTRCVD | PR_LISTEN, tcp6_input, 0, tcp6_ctlinput, tcp_ctloutput, tcp_usrreq, tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, tcp_sysctl }, #endif { SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC | PR_ADDR, rip6_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, 0 }, { SOCK_RAW, &inet6domain, IPPROTO_ICMPV6, PR_ATOMIC | PR_ADDR, icmp6_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, icmp6_init, icmp6_fasttimo, 0, 0, icmp6_sysctl }, { SOCK_RAW, &inet6domain, IPPROTO_DSTOPTS,PR_ATOMIC|PR_ADDR, dest6_input, 0, 0, 0, 0, 0, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_ROUTING,PR_ATOMIC|PR_ADDR, route6_input, 0, 0, 0, 0, 0, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_FRAGMENT,PR_ATOMIC|PR_ADDR, frag6_input, 0, 0, 0, 0, 0, 0, 0, 0, }, #ifdef IPSEC { SOCK_RAW, &inet6domain, IPPROTO_AH, PR_ATOMIC|PR_ADDR, ah6_input, 0, 0, 0, 0, 0, 0, 0, 0, ipsec6_sysctl }, #ifdef IPSEC_ESP { SOCK_RAW, &inet6domain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR, esp6_input, 0, 0, 0, 0, 0, 0, 0, 0, ipsec6_sysctl }, #endif { SOCK_RAW, &inet6domain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR, ipcomp6_input, 0, 0, 0, 0, 0, 0, 0, 0, ipsec6_sysctl }, #endif /* IPSEC */ #if NGIF > 0 { SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR, in6_gif_input,0, 0, 0, 0, 0, 0, 0, 0, }, #ifdef INET6 { SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR, in6_gif_input,0, 0, 0, 0, 0, 0, 0, 0, }, #endif /* INET6 */ #endif /* GIF */ { SOCK_RAW, &inet6domain, IPPROTO_PIM, PR_ATOMIC|PR_ADDR, pim6_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, }, /* raw wildcard */ { SOCK_RAW, &inet6domain, 0, PR_ATOMIC | PR_ADDR, rip6_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, rip6_init, 0, 0, 0, }, }; struct domain inet6domain = { AF_INET6, "internet6", 0, 0, 0, (struct protosw *)inet6sw, (struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], 0, rn_inithead, offsetof(struct sockaddr_in6, sin6_addr) << 3, sizeof(struct sockaddr_in6) }; #ifdef __FreeBSD__ DOMAIN_SET(inet6); #endif /* * Internet configuration info */ #ifndef IPV6FORWARDING #ifdef GATEWAY6 #define IPV6FORWARDING 1 /* forward IP6 packets not for us */ #else #define IPV6FORWARDING 0 /* don't forward IP6 packets not for us */ #endif /* GATEWAY6 */ #endif /* !IPV6FORWARDING */ #ifndef IPV6_SENDREDIRECTS #define IPV6_SENDREDIRECTS 1 #endif int ip6_forwarding = IPV6FORWARDING; /* act as router? */ int ip6_sendredirects = IPV6_SENDREDIRECTS; int ip6_defhlim = IPV6_DEFHLIM; int ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS; int ip6_accept_rtadv = 0; /* "IPV6FORWARDING ? 0 : 1" is dangerous */ int ip6_maxfragpackets = 200; int ip6_log_interval = 5; int ip6_hdrnestlimit = 50; /* appropriate? */ int ip6_dad_count = 1; /* DupAddrDetectionTransmits */ u_int32_t ip6_flow_seq; int ip6_auto_flowlabel = 1; #if NGIF > 0 int ip6_gif_hlim = GIF_HLIM; #else int ip6_gif_hlim = 0; #endif u_long ip6_id = 0UL; int ip6_keepfaith = 0; time_t ip6_log_time = (time_t)0L; /* icmp6 */ int pmtu_expire = 60*10; int pmtu_probe = 60*2; /* raw IP6 parameters */ /* * Nominal space allocated to a raw ip socket. */ #define RIPV6SNDQ 8192 #define RIPV6RCVQ 8192 u_long rip6_sendspace = RIPV6SNDQ; u_long rip6_recvspace = RIPV6RCVQ; /* ICMPV6 parameters */ int icmp6_rediraccept = 1; /* accept and process redirects */ int icmp6_redirtimeout = 10 * 60; /* 10 minutes */ u_int icmp6errratelim = 1000; /* 1000usec = 1msec */ #ifdef TCP6 /* TCP on IP6 parameters */ int tcp6_sendspace = 1024 * 8; int tcp6_recvspace = 1024 * 8; int tcp6_mssdflt = TCP6_MSS; int tcp6_rttdflt = TCP6TV_SRTTDFLT / PR_SLOWHZ; int tcp6_do_rfc1323 = 1; int tcp6_conntimeo = TCP6TV_KEEP_INIT; /* initial connection timeout */ int tcp6_43maxseg = 0; int tcp6_pmtu = 0; /* * Parameters for keepalive option. * Connections for which SO_KEEPALIVE is set will be probed * after being idle for a time of tcp6_keepidle (in units of PR_SLOWHZ). * Starting at that time, the connection is probed at intervals * of tcp6_keepintvl (same units) until a response is received * or until tcp6_keepcnt probes have been made, at which time * the connection is dropped. Note that a tcp6_keepidle value * under 2 hours is nonconformant with RFC-1122, Internet Host Requirements. */ int tcp6_keepidle = TCP6TV_KEEP_IDLE; /* time before probing idle */ int tcp6_keepintvl = TCP6TV_KEEPINTVL; /* interval betwn idle probes */ int tcp6_keepcnt = TCP6TV_KEEPCNT; /* max idle probes */ int tcp6_maxpersistidle = TCP6TV_KEEP_IDLE; /* max idle time in persist */ #ifndef INET_SERVER #define TCP6_LISTEN_HASH_SIZE 17 #define TCP6_CONN_HASH_SIZE 97 #define TCP6_SYN_HASH_SIZE 293 #define TCP6_SYN_BUCKET_SIZE 35 #else #define TCP6_LISTEN_HASH_SIZE 97 #define TCP6_CONN_HASH_SIZE 9973 #define TCP6_SYN_HASH_SIZE 997 #define TCP6_SYN_BUCKET_SIZE 35 #endif int tcp6_listen_hash_size = TCP6_LISTEN_HASH_SIZE; int tcp6_conn_hash_size = TCP6_CONN_HASH_SIZE; struct tcp6_hash_list tcp6_listen_hash[TCP6_LISTEN_HASH_SIZE], tcp6_conn_hash[TCP6_CONN_HASH_SIZE]; int tcp6_syn_cache_size = TCP6_SYN_HASH_SIZE; int tcp6_syn_cache_limit = TCP6_SYN_HASH_SIZE*TCP6_SYN_BUCKET_SIZE; int tcp6_syn_bucket_limit = 3*TCP6_SYN_BUCKET_SIZE; struct syn_cache_head6 tcp6_syn_cache[TCP6_SYN_HASH_SIZE]; struct syn_cache_head6 *tcp6_syn_cache_first; int tcp6_syn_cache_interval = 8; /* runs timer every 4 seconds */ int tcp6_syn_cache_timeo = TCP6TV_KEEP_INIT; /* * Parameters for computing a desirable data segment size * given an upper bound (either interface MTU, or peer's MSS option)_. * As applications tend to use a buffer size that is a multiple * of kilobytes, try for something that divides evenly. However, * do not round down too much. * * Round segment size down to a multiple of TCP6_ROUNDSIZE if this * does not result in lowering by more than (size/TCP6_ROUNDFRAC). * For example, round 536 to 512. Older versions of the system * effectively used MCLBYTES (1K or 2K) as TCP6_ROUNDSIZE, with * a value of 1 for TCP6_ROUNDFRAC (eliminating its effect). * We round to a multiple of 256 for SLIP. */ #ifndef TCP6_ROUNDSIZE #define TCP6_ROUNDSIZE 256 /* round to multiple of 256 */ #endif #ifndef TCP6_ROUNDFRAC #define TCP6_ROUNDFRAC 10 /* round down at most N/10, or 10% */ #endif int tcp6_roundsize = TCP6_ROUNDSIZE; int tcp6_roundfrac = TCP6_ROUNDFRAC; #endif /*TCP6*/ /* UDP on IP6 parameters */ int udp6_sendspace = 9216; /* really max datagram size */ int udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6)); /* 40 1K datagrams */ #ifdef __FreeBSD__ /* * sysctl related items. */ SYSCTL_NODE(_net, PF_INET6, inet6, CTLFLAG_RW, 0, "Internet6 Family"); /* net.inet6 */ SYSCTL_NODE(_net_inet6, IPPROTO_IPV6, ip6, CTLFLAG_RW, 0, "IP6"); SYSCTL_NODE(_net_inet6, IPPROTO_ICMPV6, icmp6, CTLFLAG_RW, 0, "ICMP6"); SYSCTL_NODE(_net_inet6, IPPROTO_UDP, udp6, CTLFLAG_RW, 0, "UDP6"); SYSCTL_NODE(_net_inet6, IPPROTO_TCP, tcp6, CTLFLAG_RW, 0, "TCP6"); #ifdef IPSEC SYSCTL_NODE(_net_inet6, IPPROTO_ESP, ipsec6, CTLFLAG_RW, 0, "IPSEC6"); #endif /* IPSEC */ /* net.inet6.ip6 */ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding, CTLFLAG_RW, &ip6_forwarding, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_SENDREDIRECTS, redirect, CTLFLAG_RW, &ip6_sendredirects, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM, hlim, CTLFLAG_RW, &ip6_defhlim, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets, CTLFLAG_RW, &ip6_maxfragpackets, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv, CTLFLAG_RW, &ip6_accept_rtadv, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_KEEPFAITH, keepfaith, CTLFLAG_RW, &ip6_keepfaith, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_LOG_INTERVAL, log_interval, CTLFLAG_RW, &ip6_log_interval, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_HDRNESTLIMIT, hdrnestlimit, CTLFLAG_RW, &ip6_hdrnestlimit, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DAD_COUNT, dad_count, CTLFLAG_RW, &ip6_dad_count, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_FLOWLABEL, auto_flowlabel, CTLFLAG_RW, &ip6_auto_flowlabel, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFMCASTHLIM, defmcasthlim, CTLFLAG_RW, &ip6_defmcasthlim, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, CTLFLAG_RW, &ip6_gif_hlim, 0, ""); /* net.inet6.icmp6 */ SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRACCEPT, rediraccept, CTLFLAG_RW, &icmp6_rediraccept, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRTIMEOUT, redirtimeout, CTLFLAG_RW, &icmp6_redirtimeout, 0, ""); SYSCTL_STRUCT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, CTLFLAG_RD, &icmp6stat, icmp6stat, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ERRRATELIMIT, errratelimit, CTLFLAG_RW, &icmp6errratelim, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PRUNE, nd6_prune, CTLFLAG_RW, &nd6_prune, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DELAY, nd6_delay, CTLFLAG_RW, &nd6_delay, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_UMAXTRIES, nd6_umaxtries, CTLFLAG_RW, &nd6_umaxtries, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MMAXTRIES, nd6_mmaxtries, CTLFLAG_RW, &nd6_mmaxtries, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_USELOOPBACK, nd6_useloopback, CTLFLAG_RW, &nd6_useloopback, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PROXYALL, nd6_proxyall, CTLFLAG_RW, &nd6_proxyall, 0, ""); /* net.inet6.udp6 */ SYSCTL_INT(_net_inet6_udp6, UDP6CTL_SENDMAX, sendmax, CTLFLAG_RW, &udp6_sendspace, 0, ""); SYSCTL_INT(_net_inet6_udp6, UDP6CTL_RECVSPACE, recvspace, CTLFLAG_RW, &udp6_recvspace, 0, ""); /* net.inet6.tcp6 */ SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_MSSDFLT, mssdflt, CTLFLAG_RW, &tcp6_mssdflt, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_DO_RFC1323, do_rfc1323, CTLFLAG_RW, &tcp6_do_rfc1323, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_KEEPIDLE, keepidle, CTLFLAG_RW, &tcp6_keepidle, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_KEEPINTVL, keepintvl, CTLFLAG_RW, &tcp6_keepintvl, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_KEEPCNT, keepcnt, CTLFLAG_RW, &tcp6_keepcnt, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_MAXPERSISTIDLE, maxpersistidle, CTLFLAG_RW, &tcp6_maxpersistidle, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SENDSPACE, sendspace, CTLFLAG_RW, &tcp6_sendspace, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_RECVSPACE, recvspace, CTLFLAG_RW, &tcp6_recvspace, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_CONNTIMEO, conntimeo, CTLFLAG_RW, &tcp6_conntimeo, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_PMTU, pmtu, CTLFLAG_RW, &tcp6_pmtu, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_PMTU_EXPIRE, pmtu_expire, CTLFLAG_RW, &pmtu_expire, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_PMTU_PROBE, pmtu_probe, CTLFLAG_RW, &pmtu_probe, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_43MAXSEG, pmtu_43maxseg, CTLFLAG_RW, &tcp6_43maxseg, 0, ""); SYSCTL_STRUCT(_net_inet6_tcp6, TCP6CTL_STATS, stats, CTLFLAG_RD, &tcp6stat, tcp6stat, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SYN_CACHE_LIMIT, syn_cache_limit, CTLFLAG_RW, &tcp6_syn_cache_limit, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SYN_BUCKET_LIMIT, syn_bucket_limit, CTLFLAG_RW, &tcp6_syn_bucket_limit, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SYN_CACHE_INTER, syn_cache_interval, CTLFLAG_RW, &tcp6_syn_cache_interval, 0, ""); #endif /* __FreeBSD__ */ @ 1.2.2.3 log @Update from trunk. @ text @a0 2 /* $NetBSD: in6_proto.c,v 1.2.2.2 1999/08/02 22:36:04 thorpej Exp $ */ a66 3 #ifdef __NetBSD__ /*XXX*/ #include "opt_ipsec.h" #endif d83 1 a172 4 #ifdef INET /* If inet4, no need to have tcp_slowtimo and tcp_fasttimo happen TWICE */ tcp_init, NULL, NULL, tcp_drain, tcp_sysctl #else a173 1 #endif d290 1 a290 1 u_int32_t ip6_id = 0UL; @ 1.1 log @file in6_proto.c was initially added on branch kame. @ text @d1 499 @ 1.1.2.1 log @KAME/NetBSD 1.4 SNAP kit, dated 19990628. NOTE: this branch (kame) is used just for refernce. this may not compile due to multiple reasons. @ text @a0 519 /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 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. * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 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. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. 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. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @@(#)in_proto.c 8.1 (Berkeley) 6/10/93 */ #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__NetBSD__) #include "opt_inet.h" #endif #include #include #include #include #include #include #include #ifdef RADISH #include #else /* RADISH */ #include #endif /* RADISH */ #include #include #include #include #include #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || (defined(__NetBSD__) && !defined(TCP6)) #include #include #endif #if defined(__NetBSD__) && !defined(TCP6) #include #endif #include #include #include #if !defined(__FreeBSD__) || __FreeBSD__ < 3 #include #endif #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) #include #include #include #include #include #else #if defined(__NetBSD__) && !defined(TCP6) #include #include #include #include #include #include #include #else #include #include #include #include #include #endif #endif #include #include #include #include #ifdef IPSEC #include #ifdef IPSEC_ESP #include #endif #include #endif /*IPSEC*/ #include #include "gif.h" #if NGIF > 0 #include #endif #define offsetof(type, member) ((size_t)(&((type *)0)->member)) /* * TCP/IP protocol family: IP6, ICMP6, UDP, TCP. */ extern struct domain inet6domain; struct ip6protosw inet6sw[] = { { 0, &inet6domain, IPPROTO_IPV6, 0, 0, 0, 0, 0, 0, ip6_init, 0, frag6_slowtimo, frag6_drain, ip6_sysctl }, { SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC | PR_ADDR, udp6_input, 0, udp6_ctlinput, ip6_ctloutput, udp6_usrreq, udp6_init, 0, 0, 0, udp6_sysctl }, #ifdef TCP6 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED | PR_WANTRCVD, tcp6_input, 0, tcp6_ctlinput, tcp6_ctloutput, tcp6_usrreq, tcp6_init, tcp6_fasttimo, tcp6_slowtimo, tcp6_drain, tcp6_sysctl }, #else { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED | PR_WANTRCVD, tcp6_input, 0, tcp6_ctlinput, tcp_ctloutput, tcp_usrreq, tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, tcp_sysctl }, #endif { SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC | PR_ADDR, rip6_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, 0 }, { SOCK_RAW, &inet6domain, IPPROTO_ICMPV6, PR_ATOMIC | PR_ADDR, icmp6_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, icmp6_init, icmp6_fasttimo, 0, 0, icmp6_sysctl }, { SOCK_RAW, &inet6domain, IPPROTO_DSTOPTS,PR_ATOMIC|PR_ADDR, dest6_input, 0, 0, 0, 0, 0, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_ROUTING,PR_ATOMIC|PR_ADDR, route6_input, 0, 0, 0, 0, 0, 0, 0, 0, }, { SOCK_RAW, &inet6domain, IPPROTO_FRAGMENT,PR_ATOMIC|PR_ADDR, frag6_input, 0, 0, 0, 0, 0, 0, 0, 0, }, #ifdef IPSEC { SOCK_RAW, &inet6domain, IPPROTO_AH, PR_ATOMIC|PR_ADDR, ah6_input, 0, 0, 0, 0, 0, 0, 0, 0, ipsec6_sysctl }, #ifdef IPSEC_ESP { SOCK_RAW, &inet6domain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR, esp6_input, 0, 0, 0, 0, 0, 0, 0, 0, ipsec6_sysctl }, #endif { SOCK_RAW, &inet6domain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR, ipcomp6_input, 0, 0, 0, 0, 0, 0, 0, 0, ipsec6_sysctl }, #endif /* IPSEC */ #if NGIF > 0 { SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR, in6_gif_input,0, 0, 0, 0, 0, 0, 0, 0, }, #ifdef INET6 { SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR, in6_gif_input,0, 0, 0, 0, 0, 0, 0, 0, }, #endif /* INET6 */ #endif /* GIF */ { SOCK_RAW, &inet6domain, IPPROTO_PIM, PR_ATOMIC|PR_ADDR, pim6_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, 0, 0, 0, 0, }, /* raw wildcard */ { SOCK_RAW, &inet6domain, 0, PR_ATOMIC | PR_ADDR, rip6_input, rip6_output, 0, rip6_ctloutput, rip6_usrreq, rip6_init, 0, 0, 0, }, }; #ifdef RADISH struct domain inet6domain = { AF_INET6, "internet6", 0, 0, 0, inet6sw, &inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], 0, rn_inithead, sizeof(struct sockaddr_in6), 8, 16, in6_rd_match}; #else /* RADISH */ struct domain inet6domain = { AF_INET6, "internet6", 0, 0, 0, (struct protosw *)inet6sw, (struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], 0, rn_inithead, offsetof(struct sockaddr_in6, sin6_addr) << 3, sizeof(struct sockaddr_in6) }; #endif /* RADISH */ #ifdef __FreeBSD__ DOMAIN_SET(inet6); #endif /* * Internet configuration info */ #ifndef IPV6FORWARDING #ifdef GATEWAY6 #define IPV6FORWARDING 1 /* forward IP6 packets not for us */ #else #define IPV6FORWARDING 0 /* don't forward IP6 packets not for us */ #endif /* GATEWAY6 */ #endif /* !IPV6FORWARDING */ #ifndef IPV6_SENDREDIRECTS #define IPV6_SENDREDIRECTS 1 #endif int ip6_forwarding = IPV6FORWARDING; /* act as router? */ int ip6_sendredirects = IPV6_SENDREDIRECTS; int ip6_defhlim = IPV6_DEFHLIM; int ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS; int ip6_accept_rtadv = 0; /* "IPV6FORWARDING ? 0 : 1" is dangerous */ int ip6_maxfragpackets = 200; int ip6_log_interval = 5; int ip6_hdrnestlimit = 50; /* appropriate? */ int ip6_dad_count = 1; /* DupAddrDetectionTransmits */ u_int32_t ip6_flow_seq; int ip6_auto_flowlabel = 1; #if NGIF > 0 int ip6_gif_hlim = GIF_HLIM; #else int ip6_gif_hlim = 0; #endif u_long ip6_id = 0UL; int ip6_keepfaith = 0; time_t ip6_log_time = (time_t)0L; #ifdef MAPPED_ADDR_ENABLED int ip6_mapped_addr_on = 0; #endif /* MAPPED_ADDR_ENABLED */ /* icmp6 */ int pmtu_expire = 60*10; int pmtu_probe = 60*2; /* raw IP6 parameters */ /* * Nominal space allocated to a raw ip socket. */ #define RIPV6SNDQ 8192 #define RIPV6RCVQ 8192 u_long rip6_sendspace = RIPV6SNDQ; u_long rip6_recvspace = RIPV6RCVQ; /* ICMPV6 parameters */ int icmp6_rediraccept = 1; /* accept and process redirects */ int icmp6_redirtimeout = 10 * 60; /* 10 minutes */ u_int icmp6errratelim = 1000; /* 1000usec = 1msec */ #ifdef TCP6 /* TCP on IP6 parameters */ int tcp6_sendspace = 1024 * 8; int tcp6_recvspace = 1024 * 8; int tcp6_mssdflt = TCP6_MSS; int tcp6_rttdflt = TCP6TV_SRTTDFLT / PR_SLOWHZ; int tcp6_do_rfc1323 = 1; int tcp6_conntimeo = TCP6TV_KEEP_INIT; /* initial connection timeout */ int tcp6_43maxseg = 0; int tcp6_pmtu = 0; /* * Parameters for keepalive option. * Connections for which SO_KEEPALIVE is set will be probed * after being idle for a time of tcp6_keepidle (in units of PR_SLOWHZ). * Starting at that time, the connection is probed at intervals * of tcp6_keepintvl (same units) until a response is received * or until tcp6_keepcnt probes have been made, at which time * the connection is dropped. Note that a tcp6_keepidle value * under 2 hours is nonconformant with RFC-1122, Internet Host Requirements. */ int tcp6_keepidle = TCP6TV_KEEP_IDLE; /* time before probing idle */ int tcp6_keepintvl = TCP6TV_KEEPINTVL; /* interval betwn idle probes */ int tcp6_keepcnt = TCP6TV_KEEPCNT; /* max idle probes */ int tcp6_maxpersistidle = TCP6TV_KEEP_IDLE; /* max idle time in persist */ #ifndef INET_SERVER #define TCP6_LISTEN_HASH_SIZE 17 #define TCP6_CONN_HASH_SIZE 97 #define TCP6_SYN_HASH_SIZE 293 #define TCP6_SYN_BUCKET_SIZE 35 #else #define TCP6_LISTEN_HASH_SIZE 97 #define TCP6_CONN_HASH_SIZE 9973 #define TCP6_SYN_HASH_SIZE 997 #define TCP6_SYN_BUCKET_SIZE 35 #endif int tcp6_listen_hash_size = TCP6_LISTEN_HASH_SIZE; int tcp6_conn_hash_size = TCP6_CONN_HASH_SIZE; struct tcp6_hash_list tcp6_listen_hash[TCP6_LISTEN_HASH_SIZE], tcp6_conn_hash[TCP6_CONN_HASH_SIZE]; int tcp6_syn_cache_size = TCP6_SYN_HASH_SIZE; int tcp6_syn_cache_limit = TCP6_SYN_HASH_SIZE*TCP6_SYN_BUCKET_SIZE; int tcp6_syn_bucket_limit = 3*TCP6_SYN_BUCKET_SIZE; struct syn_cache_head6 tcp6_syn_cache[TCP6_SYN_HASH_SIZE]; struct syn_cache_head6 *tcp6_syn_cache_first; int tcp6_syn_cache_interval = 8; /* runs timer every 4 seconds */ int tcp6_syn_cache_timeo = TCP6TV_KEEP_INIT; /* * Parameters for computing a desirable data segment size * given an upper bound (either interface MTU, or peer's MSS option)_. * As applications tend to use a buffer size that is a multiple * of kilobytes, try for something that divides evenly. However, * do not round down too much. * * Round segment size down to a multiple of TCP6_ROUNDSIZE if this * does not result in lowering by more than (size/TCP6_ROUNDFRAC). * For example, round 536 to 512. Older versions of the system * effectively used MCLBYTES (1K or 2K) as TCP6_ROUNDSIZE, with * a value of 1 for TCP6_ROUNDFRAC (eliminating its effect). * We round to a multiple of 256 for SLIP. */ #ifndef TCP6_ROUNDSIZE #define TCP6_ROUNDSIZE 256 /* round to multiple of 256 */ #endif #ifndef TCP6_ROUNDFRAC #define TCP6_ROUNDFRAC 10 /* round down at most N/10, or 10% */ #endif int tcp6_roundsize = TCP6_ROUNDSIZE; int tcp6_roundfrac = TCP6_ROUNDFRAC; #endif /*TCP6*/ /* UDP on IP6 parameters */ int udp6_sendspace = 9216; /* really max datagram size */ int udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6)); /* 40 1K datagrams */ #ifdef __FreeBSD__ /* * sysctl related items. */ SYSCTL_NODE(_net, PF_INET6, inet6, CTLFLAG_RW, 0, "Internet6 Family"); /* net.inet6 */ SYSCTL_NODE(_net_inet6, IPPROTO_IPV6, ip6, CTLFLAG_RW, 0, "IP6"); SYSCTL_NODE(_net_inet6, IPPROTO_ICMPV6, icmp6, CTLFLAG_RW, 0, "ICMP6"); SYSCTL_NODE(_net_inet6, IPPROTO_UDP, udp6, CTLFLAG_RW, 0, "UDP6"); SYSCTL_NODE(_net_inet6, IPPROTO_TCP, tcp6, CTLFLAG_RW, 0, "TCP6"); #ifdef IPSEC SYSCTL_NODE(_net_inet6, IPPROTO_ESP, ipsec6, CTLFLAG_RW, 0, "IPSEC6"); #endif /* IPSEC */ /* net.inet6.ip6 */ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding, CTLFLAG_RW, &ip6_forwarding, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_SENDREDIRECTS, redirect, CTLFLAG_RW, &ip6_sendredirects, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM, hlim, CTLFLAG_RW, &ip6_defhlim, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS, maxfragpackets, CTLFLAG_RW, &ip6_maxfragpackets, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV, accept_rtadv, CTLFLAG_RW, &ip6_accept_rtadv, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_KEEPFAITH, keepfaith, CTLFLAG_RW, &ip6_keepfaith, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_LOG_INTERVAL, log_interval, CTLFLAG_RW, &ip6_log_interval, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_HDRNESTLIMIT, hdrnestlimit, CTLFLAG_RW, &ip6_hdrnestlimit, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DAD_COUNT, dad_count, CTLFLAG_RW, &ip6_dad_count, 0, ""); #ifdef MAPPED_ADDR_ENABLED SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAPPED_ADDR, mapped_addr, CTLFLAG_RW, &ip6_mapped_addr_on, 0, ""); #endif /* MAPPED_ADDR_ENABLED */ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_FLOWLABEL, auto_flowlabel, CTLFLAG_RW, &ip6_auto_flowlabel, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFMCASTHLIM, defmcasthlim, CTLFLAG_RW, &ip6_defmcasthlim, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, CTLFLAG_RW, &ip6_gif_hlim, 0, ""); /* net.inet6.icmp6 */ SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRACCEPT, rediraccept, CTLFLAG_RW, &icmp6_rediraccept, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRTIMEOUT, redirtimeout, CTLFLAG_RW, &icmp6_redirtimeout, 0, ""); SYSCTL_STRUCT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, CTLFLAG_RD, &icmp6stat, icmp6stat, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ERRRATELIMIT, errratelimit, CTLFLAG_RW, &icmp6errratelim, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PRUNE, nd6_prune, CTLFLAG_RW, &nd6_prune, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DELAY, nd6_delay, CTLFLAG_RW, &nd6_delay, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_UMAXTRIES, nd6_umaxtries, CTLFLAG_RW, &nd6_umaxtries, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MMAXTRIES, nd6_mmaxtries, CTLFLAG_RW, &nd6_mmaxtries, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_USELOOPBACK, nd6_useloopback, CTLFLAG_RW, &nd6_useloopback, 0, ""); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PROXYALL, nd6_proxyall, CTLFLAG_RW, &nd6_proxyall, 0, ""); /* net.inet6.udp6 */ SYSCTL_INT(_net_inet6_udp6, UDP6CTL_SENDMAX, sendmax, CTLFLAG_RW, &udp6_sendspace, 0, ""); SYSCTL_INT(_net_inet6_udp6, UDP6CTL_RECVSPACE, recvspace, CTLFLAG_RW, &udp6_recvspace, 0, ""); /* net.inet6.tcp6 */ SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_MSSDFLT, mssdflt, CTLFLAG_RW, &tcp6_mssdflt, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_DO_RFC1323, do_rfc1323, CTLFLAG_RW, &tcp6_do_rfc1323, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_KEEPIDLE, keepidle, CTLFLAG_RW, &tcp6_keepidle, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_KEEPINTVL, keepintvl, CTLFLAG_RW, &tcp6_keepintvl, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_KEEPCNT, keepcnt, CTLFLAG_RW, &tcp6_keepcnt, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_MAXPERSISTIDLE, maxpersistidle, CTLFLAG_RW, &tcp6_maxpersistidle, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SENDSPACE, sendspace, CTLFLAG_RW, &tcp6_sendspace, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_RECVSPACE, recvspace, CTLFLAG_RW, &tcp6_recvspace, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_CONNTIMEO, conntimeo, CTLFLAG_RW, &tcp6_conntimeo, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_PMTU, pmtu, CTLFLAG_RW, &tcp6_pmtu, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_PMTU_EXPIRE, pmtu_expire, CTLFLAG_RW, &pmtu_expire, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_PMTU_PROBE, pmtu_probe, CTLFLAG_RW, &pmtu_probe, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_43MAXSEG, pmtu_43maxseg, CTLFLAG_RW, &tcp6_43maxseg, 0, ""); SYSCTL_STRUCT(_net_inet6_tcp6, TCP6CTL_STATS, stats, CTLFLAG_RD, &tcp6stat, tcp6stat, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SYN_CACHE_LIMIT, syn_cache_limit, CTLFLAG_RW, &tcp6_syn_cache_limit, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SYN_BUCKET_LIMIT, syn_bucket_limit, CTLFLAG_RW, &tcp6_syn_bucket_limit, 0, ""); SYSCTL_INT(_net_inet6_tcp6, TCP6CTL_SYN_CACHE_INTER, syn_cache_interval, CTLFLAG_RW, &tcp6_syn_cache_interval, 0, ""); #endif /* __FreeBSD__ */ @ 1.1.2.2 log @KAME/NetBSD 1.4, SNAP kit 1999/07/05. NOTE: this branch is just for reference purposes (i.e. for taking cvs diff). do not touch anything on the branch. actual work must be done on HEAD branch. @ text @d77 3 d81 1 d251 7 d264 1 d306 4 d444 4 @ 1.1.2.3 log @bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch just for reference purposes. This commit includes 1.4 -> 1.4.1 sync for kame branch. The branch does not compile at all (due to the lack of ALTQ and some other source code). Please do not try to modify the branch, this is just for referenre purposes. synchronization to latest KAME will take place on HEAD branch soon. @ text @a66 3 #ifdef __NetBSD__ /*XXX*/ #include "opt_ipsec.h" #endif a70 3 #if defined(__FreeBSD__) #include #endif a74 4 #ifdef __FreeBSD__ #include #include #endif d83 2 a84 1 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || (defined(__NetBSD__) && !defined(TCP6)) || defined(__OpenBSD__) || (defined(__bsdi__) && _BSDI_VERSION >= 199802) d88 1 a88 1 #if (defined(__NetBSD__) && !defined(TCP6)) || defined(__OpenBSD__) || (defined(__bsdi__) && _BSDI_VERSION >= 199802) d94 1 a94 1 #if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(__OpenBSD__) && !(defined(__bsdi__) && _BSDI_VERSION >= 199802) d98 1 a98 1 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__OpenBSD__) || (defined(__bsdi__) && _BSDI_VERSION >= 199802) a121 1 #if !defined(__OpenBSD__) && !(defined(__bsdi__) && _BSDI_VERSION >= 199802) a123 1 #endif a127 7 #ifdef __FreeBSD__ #include #endif #ifdef __OpenBSD__ /*KAME IPSEC*/ #undef IPSEC #endif a129 1 #include a143 2 #include a150 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 static struct pr_usrreqs nousrreqs; #endif d156 1 a156 8 ip6_init, 0, frag6_slowtimo, frag6_drain, #ifndef __FreeBSD__ ip6_sysctl, #else # if __FreeBSD__ >= 3 &nousrreqs, # endif #endif d160 2 a161 19 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, 0, #elif defined(HAVE_NRL_INPCB) udp6_usrreq, 0, #else udp6_usrreq, udp6_init, #endif 0, 0, 0, #ifndef __FreeBSD__ #ifdef HAVE_NRL_INPCB udp_sysctl, #else udp6_sysctl, #endif #else # if __FreeBSD__ >= 3 &udp6_usrreqs, # endif #endif d167 1 a167 8 tcp6_init, tcp6_fasttimo, tcp6_slowtimo, tcp6_drain, #ifndef __FreeBSD__ tcp6_sysctl, #else # if __FreeBSD__ >= 3 &tcp6_usrreqs, # endif #endif a171 5 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, #elif defined(HAVE_NRL_INPCB) tcp6_usrreq, #else d173 2 a175 14 #ifdef INET /* don't call timeout routines twice */ tcp_init, 0, 0, tcp_drain, #else tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain, #endif #ifndef __FreeBSD__ tcp_sysctl, #else # if __FreeBSD__ >= 3 &tcp6_usrreqs, # endif #endif }, #endif /*TCP6*/ a177 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, #else d179 1 a179 5 #endif 0, 0, 0, 0, #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &rip6_usrreqs #endif a182 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, #else d184 1 a184 9 #endif icmp6_init, icmp6_fasttimo, 0, 0, #ifndef __FreeBSD__ icmp6_sysctl, #else # if __FreeBSD__ >= 3 &rip6_usrreqs # endif #endif a189 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif a194 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif a199 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif d205 1 a205 8 0, 0, 0, 0, #ifndef __FreeBSD__ ipsec6_sysctl, #else # if __FreeBSD__ >= 3 &nousrreqs, # endif #endif d211 1 a211 8 0, 0, 0, 0, #ifndef __FreeBSD__ ipsec6_sysctl, #else # if __FreeBSD__ >= 3 &nousrreqs, # endif #endif d217 1 a217 8 0, 0, 0, 0, #ifndef __FreeBSD__ ipsec6_sysctl, #else # if __FreeBSD__ >= 3 &nousrreqs, # endif #endif a224 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif a230 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &nousrreqs #endif a235 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, #else a236 1 #endif a237 3 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &rip6_usrreqs # endif d242 2 a243 9 #if defined(__FreeBSD__) && __FreeBSD__ >= 3 0, 0, #else rip6_usrreq, rip6_init, #endif 0, 0, 0, #if defined(__FreeBSD__) && __FreeBSD__ >= 3 &rip6_usrreqs #endif a246 4 #ifdef __FreeBSD__ extern int in6_inithead __P((void **, int)); #endif d251 1 a251 6 #ifdef __FreeBSD__ in6_inithead, #else rn_inithead, #endif offsetof(struct sockaddr_in6, sin6_addr) << 3, a288 6 int ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */ int ip6_rr_prune = 5; /* router renumbering prefix * walk list every 5 sec. */ #ifdef MAPPED_ADDR_ENABLED int ip6_mapped_addr_on = 1; #endif /* MAPPED_ADDR_ENABLED */ d290 1 a290 1 u_int32_t ip6_id = 0UL; a294 6 #ifndef __bsdi__ /* * BSDI4 defines these variables in in_proto.c... * XXX: what if we don't define INET? Should we define pmtu6_expire * or so? (jinmei@@kame.net 19990310) */ a296 1 #endif d410 2 a411 44 static int sysctl_ip6_forwarding SYSCTL_HANDLER_ARGS { int error = 0; int old_ip6_forwarding; int changed; error = SYSCTL_OUT(req, arg1, sizeof(int)); if (error || !req->newptr) return (error); old_ip6_forwarding = ip6_forwarding; error = SYSCTL_IN(req, arg1, sizeof(int)); if (error != 0) return (error); changed = (ip6_forwarding ? 1 : 0) ^ (old_ip6_forwarding ? 1 : 0); if (changed == 0) return (error); if (ip6_forwarding != 0) { /* host becomes router */ int s = splnet(); struct nd_prefix *pr, *next; for (pr = nd_prefix.lh_first; pr; pr = next) { next = pr->ndpr_next; if (!IN6_IS_ADDR_UNSPECIFIED(&pr->ndpr_addr)) in6_ifdel(pr->ndpr_ifp, &pr->ndpr_addr); prelist_remove(pr); } splx(s); } else { /* router becomes host */ struct socket so; /* XXX: init dummy so */ bzero(&so, sizeof(so)); while(!LIST_EMPTY(&rr_prefix)) delete_each_prefix(&so, LIST_FIRST(&rr_prefix), PR_ORIG_KERNEL); } return (error); } SYSCTL_OID(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding, CTLTYPE_INT|CTLFLAG_RW, &ip6_forwarding, 0, sysctl_ip6_forwarding, "I", ""); a433 10 SYSCTL_STRING(_net_inet6_ip6, IPV6CTL_KAME_VERSION, kame_version, CTLFLAG_RD, __KAME_VERSION, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USE_DEPRECATED, use_deprecated, CTLFLAG_RW, &ip6_use_deprecated, 0, ""); SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RR_PRUNE, rr_prune, CTLFLAG_RW, &ip6_rr_prune, 0, ""); #ifdef MAPPED_ADDR_ENABLED SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAPPED_ADDR, mapped_addr, CTLFLAG_RW, &ip6_mapped_addr_on, 0, ""); #endif /* MAPPED_ADDR_ENABLED */ a456 1 #if __FreeBSD__ < 3 a497 1 #endif /* !(defined(__FreeBSD__) && __FreeBSD__ >= 3) */ @