head 1.39; access; symbols netbsd-10-0-RELEASE:1.39 netbsd-10-0-RC6:1.39 netbsd-10-0-RC5:1.39 netbsd-10-0-RC4:1.39 netbsd-10-0-RC3:1.39 netbsd-10-0-RC2:1.39 thorpej-ifq:1.39.0.32 thorpej-ifq-base:1.39 thorpej-altq-separation:1.39.0.30 thorpej-altq-separation-base:1.39 netbsd-10-0-RC1:1.39 netbsd-10:1.39.0.28 netbsd-10-base:1.39 bouyer-sunxi-drm:1.39.0.26 bouyer-sunxi-drm-base:1.39 netbsd-9-3-RELEASE:1.39 thorpej-i2c-spi-conf2:1.39.0.24 thorpej-i2c-spi-conf2-base:1.39 thorpej-futex2:1.39.0.22 thorpej-futex2-base:1.39 thorpej-cfargs2:1.39.0.20 thorpej-cfargs2-base:1.39 cjep_sun2x-base1:1.39 cjep_sun2x:1.39.0.18 cjep_sun2x-base:1.39 cjep_staticlib_x-base1:1.39 netbsd-9-2-RELEASE:1.39 cjep_staticlib_x:1.39.0.16 cjep_staticlib_x-base:1.39 thorpej-i2c-spi-conf:1.39.0.14 thorpej-i2c-spi-conf-base:1.39 thorpej-cfargs:1.39.0.12 thorpej-cfargs-base:1.39 thorpej-futex:1.39.0.10 thorpej-futex-base:1.39 netbsd-9-1-RELEASE:1.39 bouyer-xenpvh-base2:1.39 phil-wifi-20200421:1.39 bouyer-xenpvh-base1:1.39 phil-wifi-20200411:1.39 bouyer-xenpvh:1.39.0.8 bouyer-xenpvh-base:1.39 is-mlppp:1.39.0.6 is-mlppp-base:1.39 phil-wifi-20200406:1.39 netbsd-8-2-RELEASE:1.38 ad-namecache-base3:1.39 netbsd-9-0-RELEASE:1.39 netbsd-9-0-RC2:1.39 ad-namecache-base2:1.39 ad-namecache-base1:1.39 ad-namecache:1.39.0.4 ad-namecache-base:1.39 netbsd-9-0-RC1:1.39 phil-wifi-20191119:1.39 netbsd-9:1.39.0.2 netbsd-9-base:1.39 phil-wifi-20190609:1.38 netbsd-8-1-RELEASE:1.38 netbsd-8-1-RC1:1.38 isaki-audio2:1.38.0.32 isaki-audio2-base:1.38 pgoyette-compat-merge-20190127:1.38 pgoyette-compat-20190127:1.38 pgoyette-compat-20190118:1.38 pgoyette-compat-1226:1.38 pgoyette-compat-1126:1.38 pgoyette-compat-1020:1.38 pgoyette-compat-0930:1.38 pgoyette-compat-0906:1.38 netbsd-7-2-RELEASE:1.38 pgoyette-compat-0728:1.38 netbsd-8-0-RELEASE:1.38 phil-wifi:1.38.0.30 phil-wifi-base:1.38 pgoyette-compat-0625:1.38 netbsd-8-0-RC2:1.38 pgoyette-compat-0521:1.38 pgoyette-compat-0502:1.38 pgoyette-compat-0422:1.38 netbsd-8-0-RC1:1.38 pgoyette-compat-0415:1.38 pgoyette-compat-0407:1.38 pgoyette-compat-0330:1.38 pgoyette-compat-0322:1.38 pgoyette-compat-0315:1.38 netbsd-7-1-2-RELEASE:1.38 pgoyette-compat:1.38.0.28 pgoyette-compat-base:1.38 netbsd-7-1-1-RELEASE:1.38 tls-maxphys-base-20171202:1.38 matt-nb8-mediatek:1.38.0.26 matt-nb8-mediatek-base:1.38 nick-nhusb-base-20170825:1.38 perseant-stdc-iso10646:1.38.0.24 perseant-stdc-iso10646-base:1.38 netbsd-8:1.38.0.22 netbsd-8-base:1.38 prg-localcount2-base3:1.38 prg-localcount2-base2:1.38 prg-localcount2-base1:1.38 prg-localcount2:1.38.0.20 prg-localcount2-base:1.38 pgoyette-localcount-20170426:1.38 bouyer-socketcan-base1:1.38 jdolecek-ncq:1.38.0.18 jdolecek-ncq-base:1.38 pgoyette-localcount-20170320:1.38 netbsd-7-1:1.38.0.16 netbsd-7-1-RELEASE:1.38 netbsd-7-1-RC2:1.38 nick-nhusb-base-20170204:1.38 netbsd-7-nhusb-base-20170116:1.38 bouyer-socketcan:1.38.0.14 bouyer-socketcan-base:1.38 pgoyette-localcount-20170107:1.38 netbsd-7-1-RC1:1.38 nick-nhusb-base-20161204:1.38 pgoyette-localcount-20161104:1.38 netbsd-7-0-2-RELEASE:1.38 nick-nhusb-base-20161004:1.38 localcount-20160914:1.38 netbsd-7-nhusb:1.38.0.12 netbsd-7-nhusb-base:1.38 pgoyette-localcount-20160806:1.38 pgoyette-localcount-20160726:1.38 pgoyette-localcount:1.38.0.10 pgoyette-localcount-base:1.38 nick-nhusb-base-20160907:1.38 nick-nhusb-base-20160529:1.38 netbsd-7-0-1-RELEASE:1.38 nick-nhusb-base-20160422:1.38 nick-nhusb-base-20160319:1.38 nick-nhusb-base-20151226:1.38 netbsd-7-0:1.38.0.8 netbsd-7-0-RELEASE:1.38 nick-nhusb-base-20150921:1.38 netbsd-7-0-RC3:1.38 netbsd-7-0-RC2:1.38 netbsd-7-0-RC1:1.38 nick-nhusb-base-20150606:1.38 nick-nhusb-base-20150406:1.38 nick-nhusb:1.38.0.6 nick-nhusb-base:1.38 netbsd-5-2-3-RELEASE:1.34 netbsd-5-1-5-RELEASE:1.34 netbsd-6-0-6-RELEASE:1.37 netbsd-6-1-5-RELEASE:1.37 netbsd-7:1.38.0.4 netbsd-7-base:1.38 yamt-pagecache-base9:1.38 yamt-pagecache-tag8:1.37 netbsd-6-1-4-RELEASE:1.37 netbsd-6-0-5-RELEASE:1.37 tls-earlyentropy:1.38.0.2 tls-earlyentropy-base:1.38 riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.38 riastradh-drm2-base3:1.38 netbsd-6-1-3-RELEASE:1.37 netbsd-6-0-4-RELEASE:1.37 netbsd-5-2-2-RELEASE:1.34 netbsd-5-1-4-RELEASE:1.34 netbsd-6-1-2-RELEASE:1.37 netbsd-6-0-3-RELEASE:1.37 netbsd-5-2-1-RELEASE:1.34 netbsd-5-1-3-RELEASE:1.34 rmind-smpnet-nbase:1.38 netbsd-6-1-1-RELEASE:1.37 riastradh-drm2-base2:1.37 riastradh-drm2-base1:1.37 riastradh-drm2:1.37.0.30 riastradh-drm2-base:1.37 rmind-smpnet:1.37.0.22 rmind-smpnet-base:1.38 netbsd-6-1:1.37.0.28 netbsd-6-0-2-RELEASE:1.37 netbsd-6-1-RELEASE:1.37 khorben-n900:1.37.0.26 netbsd-6-1-RC4:1.37 netbsd-6-1-RC3:1.37 agc-symver:1.37.0.24 agc-symver-base:1.37 netbsd-6-1-RC2:1.37 netbsd-6-1-RC1:1.37 yamt-pagecache-base8:1.37 netbsd-5-2:1.34.0.12 netbsd-6-0-1-RELEASE:1.37 yamt-pagecache-base7:1.37 netbsd-5-2-RELEASE:1.34 netbsd-5-2-RC1:1.34 matt-nb6-plus-nbase:1.37 yamt-pagecache-base6:1.37 netbsd-6-0:1.37.0.20 netbsd-6-0-RELEASE:1.37 netbsd-6-0-RC2:1.37 tls-maxphys:1.37.0.18 tls-maxphys-base:1.38 matt-nb6-plus:1.37.0.16 matt-nb6-plus-base:1.37 netbsd-6-0-RC1:1.37 jmcneill-usbmp-base10:1.37 yamt-pagecache-base5:1.37 jmcneill-usbmp-base9:1.37 yamt-pagecache-base4:1.37 jmcneill-usbmp-base8:1.37 jmcneill-usbmp-base7:1.37 jmcneill-usbmp-base6:1.37 jmcneill-usbmp-base5:1.37 jmcneill-usbmp-base4:1.37 jmcneill-usbmp-base3:1.37 jmcneill-usbmp-pre-base2:1.37 jmcneill-usbmp-base2:1.37 netbsd-6:1.37.0.14 netbsd-6-base:1.37 netbsd-5-1-2-RELEASE:1.34 netbsd-5-1-1-RELEASE:1.34 jmcneill-usbmp:1.37.0.12 jmcneill-usbmp-base:1.37 jmcneill-audiomp3:1.37.0.10 jmcneill-audiomp3-base:1.37 yamt-pagecache-base3:1.37 yamt-pagecache-base2:1.37 yamt-pagecache:1.37.0.8 yamt-pagecache-base:1.37 rmind-uvmplock-nbase:1.37 cherry-xenmp:1.37.0.6 cherry-xenmp-base:1.37 bouyer-quota2-nbase:1.37 bouyer-quota2:1.37.0.4 bouyer-quota2-base:1.37 jruoho-x86intr:1.37.0.2 jruoho-x86intr-base:1.37 matt-mips64-premerge-20101231:1.37 matt-nb5-mips64-premerge-20101231:1.34 matt-nb5-pq3:1.34.0.10 matt-nb5-pq3-base:1.34 netbsd-5-1:1.34.0.8 netbsd-5-1-RELEASE:1.34 uebayasi-xip-base4:1.37 uebayasi-xip-base3:1.37 yamt-nfs-mp-base11:1.37 netbsd-5-1-RC4:1.34 matt-nb5-mips64-k15:1.34 uebayasi-xip-base2:1.37 yamt-nfs-mp-base10:1.37 netbsd-5-1-RC3:1.34 netbsd-5-1-RC2:1.34 uebayasi-xip-base1:1.37 netbsd-5-1-RC1:1.34 rmind-uvmplock:1.36.0.2 rmind-uvmplock-base:1.37 yamt-nfs-mp-base9:1.36 uebayasi-xip:1.35.0.6 uebayasi-xip-base:1.35 netbsd-5-0-2-RELEASE:1.34 matt-nb5-mips64-premerge-20091211:1.34 matt-premerge-20091211:1.35 yamt-nfs-mp-base8:1.35 matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.34 matt-nb4-mips64-k7-u2a-k9b:1.34 matt-nb5-mips64-u1-k1-k5:1.34 yamt-nfs-mp-base7:1.35 matt-nb5-mips64:1.34.0.6 netbsd-5-0-1-RELEASE:1.34 jymxensuspend-base:1.35 yamt-nfs-mp-base6:1.35 yamt-nfs-mp-base5:1.35 yamt-nfs-mp-base4:1.35 jym-xensuspend-nbase:1.35 yamt-nfs-mp-base3:1.35 nick-hppapmap-base4:1.35 nick-hppapmap-base3:1.35 netbsd-5-0:1.34.0.4 netbsd-5-0-RELEASE:1.34 netbsd-5-0-RC4:1.34 netbsd-5-0-RC3:1.34 nick-hppapmap-base2:1.35 netbsd-5-0-RC2:1.34 jym-xensuspend:1.35.0.4 jym-xensuspend-base:1.35 netbsd-5-0-RC1:1.34 haad-dm-base2:1.35 haad-nbase2:1.35 ad-audiomp2:1.35.0.2 ad-audiomp2-base:1.35 netbsd-5:1.34.0.2 netbsd-5-base:1.34 nick-hppapmap:1.33.0.2 nick-hppapmap-base:1.35 matt-mips64-base2:1.33 matt-mips64:1.30.0.32 haad-dm-base1:1.32 wrstuden-revivesa-base-4:1.32 netbsd-4-0-1-RELEASE:1.29 wrstuden-revivesa-base-3:1.32 wrstuden-revivesa-base-2:1.32 wrstuden-fixsa-newbase:1.29 nick-csl-alignment-base5:1.30 haad-dm:1.32.0.6 haad-dm-base:1.35 wrstuden-revivesa-base-1:1.32 simonb-wapbl-nbase:1.32 yamt-pf42-base4:1.32 simonb-wapbl:1.32.0.4 simonb-wapbl-base:1.32 yamt-pf42-base3:1.32 hpcarm-cleanup-nbase:1.32 yamt-pf42-baseX:1.31 yamt-pf42-base2:1.32 yamt-nfs-mp-base2:1.32 wrstuden-revivesa:1.32.0.2 wrstuden-revivesa-base:1.32 yamt-nfs-mp:1.31.0.10 yamt-nfs-mp-base:1.31 yamt-pf42:1.31.0.8 yamt-pf42-base:1.31 ad-socklock-base1:1.31 yamt-lazymbuf-base15:1.31 yamt-lazymbuf-base14:1.31 keiichi-mipv6-nbase:1.31 mjf-devfs2:1.31.0.6 mjf-devfs2-base:1.35 nick-net80211-sync:1.31.0.4 nick-net80211-sync-base:1.31 keiichi-mipv6:1.31.0.2 keiichi-mipv6-base:1.31 bouyer-xeni386-merge1:1.30.28.1 matt-armv6-prevmlocking:1.30 wrstuden-fixsa-base-1:1.29 vmlocking2-base3:1.30 netbsd-4-0:1.29.0.22 netbsd-4-0-RELEASE:1.29 bouyer-xeni386-nbase:1.31 yamt-kmem-base3:1.30 cube-autoconf:1.30.0.30 cube-autoconf-base:1.30 yamt-kmem-base2:1.30 bouyer-xeni386:1.30.0.28 bouyer-xeni386-base:1.31 yamt-kmem:1.30.0.26 yamt-kmem-base:1.30 vmlocking2-base2:1.30 reinoud-bufcleanup-nbase:1.30 vmlocking2:1.30.0.24 vmlocking2-base1:1.30 netbsd-4-0-RC5:1.29 matt-nb4-arm:1.29.0.20 matt-nb4-arm-base:1.29 matt-armv6-nbase:1.31 jmcneill-base:1.30 netbsd-4-0-RC4:1.29 mjf-devfs:1.30.0.22 mjf-devfs-base:1.31 bouyer-xenamd64-base2:1.30 vmlocking-nbase:1.30 yamt-x86pmap-base4:1.30 bouyer-xenamd64:1.30.0.20 bouyer-xenamd64-base:1.30 netbsd-4-0-RC3:1.29 yamt-x86pmap-base3:1.30 yamt-x86pmap-base2:1.30 netbsd-4-0-RC2:1.29 yamt-x86pmap:1.30.0.18 yamt-x86pmap-base:1.30 netbsd-4-0-RC1:1.29 matt-armv6:1.30.0.16 matt-armv6-base:1.31 matt-mips64-base:1.30 jmcneill-pm:1.30.0.14 jmcneill-pm-base:1.30 hpcarm-cleanup:1.30.0.12 hpcarm-cleanup-base:1.31 nick-csl-alignment:1.30.0.10 nick-csl-alignment-base:1.30 netbsd-3-1-1-RELEASE:1.24 netbsd-3-0-3-RELEASE:1.24 yamt-idlelwp-base8:1.30 wrstuden-fixsa:1.29.0.18 wrstuden-fixsa-base:1.29 thorpej-atomic:1.30.0.8 thorpej-atomic-base:1.30 reinoud-bufcleanup:1.30.0.6 reinoud-bufcleanup-base:1.30 mjf-ufs-trans:1.30.0.4 mjf-ufs-trans-base:1.30 vmlocking:1.30.0.2 vmlocking-base:1.30 ad-audiomp:1.29.0.16 ad-audiomp-base:1.29 yamt-idlelwp:1.29.0.14 post-newlock2-merge:1.29 newlock2-nbase:1.29 yamt-splraiseipl-base5:1.29 yamt-splraiseipl-base4:1.29 yamt-splraiseipl-base3:1.29 abandoned-netbsd-4-base:1.29 abandoned-netbsd-4:1.29.0.6 netbsd-3-1:1.24.0.14 netbsd-3-1-RELEASE:1.24 netbsd-3-0-2-RELEASE:1.24 yamt-splraiseipl-base2:1.29 netbsd-3-1-RC4:1.24 yamt-splraiseipl:1.29.0.10 yamt-splraiseipl-base:1.29 netbsd-3-1-RC3:1.24 yamt-pdpolicy-base9:1.29 newlock2:1.29.0.8 newlock2-base:1.29 yamt-pdpolicy-base8:1.29 netbsd-3-1-RC2:1.24 netbsd-3-1-RC1:1.24 yamt-pdpolicy-base7:1.29 netbsd-4:1.29.0.12 netbsd-4-base:1.29 yamt-pdpolicy-base6:1.29 chap-midi-nbase:1.29 netbsd-3-0-1-RELEASE:1.24 gdamore-uart:1.29.0.4 gdamore-uart-base:1.29 simonb-timcounters-final:1.26.6.1 yamt-pdpolicy-base5:1.29 chap-midi:1.29.0.2 chap-midi-base:1.29 yamt-pdpolicy-base4:1.26 yamt-pdpolicy-base3:1.26 peter-altq-base:1.26 peter-altq:1.26.0.12 yamt-pdpolicy-base2:1.26 elad-kernelauth-base:1.29 elad-kernelauth:1.26.0.10 yamt-pdpolicy:1.26.0.8 yamt-pdpolicy-base:1.26 yamt-uio_vmspace-base5:1.26 simonb-timecounters:1.26.0.6 simonb-timecounters-base:1.29 rpaulo-netinet-merge-pcb:1.26.0.4 rpaulo-netinet-merge-pcb-base:1.29 yamt-uio_vmspace:1.26.0.2 netbsd-3-0:1.24.0.12 netbsd-3-0-RELEASE:1.24 netbsd-3-0-RC6:1.24 yamt-readahead-base3:1.25 netbsd-3-0-RC5:1.24 netbsd-3-0-RC4:1.24 netbsd-3-0-RC3:1.24 yamt-readahead-base2:1.25 netbsd-3-0-RC2:1.24 yamt-readahead-pervnode:1.25 yamt-readahead-perfile:1.25 yamt-readahead:1.25.0.8 yamt-readahead-base:1.25 netbsd-3-0-RC1:1.24 yamt-vop-base3:1.25 netbsd-2-0-3-RELEASE:1.23 netbsd-2-1:1.23.0.8 yamt-vop-base2:1.25 thorpej-vnode-attr:1.25.0.6 thorpej-vnode-attr-base:1.25 netbsd-2-1-RELEASE:1.23 yamt-vop:1.25.0.4 yamt-vop-base:1.25 netbsd-2-1-RC6:1.23 netbsd-2-1-RC5:1.23 netbsd-2-1-RC4:1.23 netbsd-2-1-RC3:1.23 netbsd-2-1-RC2:1.23 netbsd-2-1-RC1:1.23 yamt-lazymbuf:1.25.0.2 yamt-km-base4:1.24 netbsd-2-0-2-RELEASE:1.23 yamt-km-base3:1.24 netbsd-3:1.24.0.10 netbsd-3-base:1.24 yamt-km-base2:1.24 yamt-km:1.24.0.6 yamt-km-base:1.24 kent-audio2:1.24.0.4 kent-audio2-base:1.24 netbsd-2-0-1-RELEASE:1.23 kent-audio1-beforemerge:1.24 netbsd-2:1.23.0.6 netbsd-2-base:1.23 kent-audio1:1.24.0.2 kent-audio1-base:1.24 netbsd-2-0-RELEASE:1.23 netbsd-2-0-RC5:1.23 netbsd-2-0-RC4:1.23 netbsd-2-0-RC3:1.23 netbsd-2-0-RC2:1.23 netbsd-2-0-RC1:1.23 netbsd-2-0:1.23.0.4 netbsd-2-0-base:1.23 netbsd-1-6-PATCH002-RELEASE:1.19 netbsd-1-6-PATCH002:1.19 netbsd-1-6-PATCH002-RC4:1.19 netbsd-1-6-PATCH002-RC3:1.19 netbsd-1-6-PATCH002-RC2:1.19 netbsd-1-6-PATCH002-RC1:1.19 ktrace-lwp:1.23.0.2 ktrace-lwp-base:1.25 netbsd-1-6-PATCH001:1.19 netbsd-1-6-PATCH001-RELEASE:1.19 netbsd-1-6-PATCH001-RC3:1.19 netbsd-1-6-PATCH001-RC2:1.19 netbsd-1-6-PATCH001-RC1:1.19 nathanw_sa_end:1.17.2.3 nathanw_sa_before_merge:1.20 fvdl_fs64_base:1.20 gmcgarry_ctxsw:1.20.0.4 gmcgarry_ctxsw_base:1.20 gmcgarry_ucred:1.20.0.2 gmcgarry_ucred_base:1.20 nathanw_sa_base:1.20 kqueue-aftermerge:1.20 kqueue-beforemerge:1.20 netbsd-1-6-RELEASE:1.19 netbsd-1-6-RC3:1.19 netbsd-1-6-RC2:1.19 netbsd-1-6-RC1:1.19 netbsd-1-6:1.19.0.10 netbsd-1-6-base:1.19 gehenna-devsw:1.19.0.8 gehenna-devsw-base:1.19 netbsd-1-5-PATCH003:1.15 eeh-devprop:1.19.0.6 eeh-devprop-base:1.19 newlock:1.19.0.4 newlock-base:1.19 ifpoll-base:1.19 thorpej-mips-cache:1.18.0.2 thorpej-mips-cache-base:1.19 thorpej-devvp-base3:1.17 thorpej-devvp-base2:1.17 post-chs-ubcperf:1.17 pre-chs-ubcperf:1.17 thorpej-devvp:1.17.0.6 thorpej-devvp-base:1.17 netbsd-1-5-PATCH002:1.15 kqueue:1.17.0.4 kqueue-base:1.20 netbsd-1-5-PATCH001:1.15 thorpej_scsipi_beforemerge:1.17 nathanw_sa:1.17.0.2 thorpej_scsipi_nbase:1.17 netbsd-1-5-RELEASE:1.15 netbsd-1-5-BETA2:1.15 netbsd-1-5-BETA:1.15 netbsd-1-4-PATCH003:1.11 netbsd-1-5-ALPHA2:1.15 netbsd-1-5:1.15.0.12 netbsd-1-5-base:1.15 minoura-xpg4dl-base:1.15 minoura-xpg4dl:1.15.0.10 netbsd-1-4-PATCH002:1.11 chs-ubc2-newbase:1.15 wrstuden-devbsize-19991221:1.15 wrstuden-devbsize:1.15.0.8 wrstuden-devbsize-base:1.15 kame_141_19991130:1.11 comdex-fall-1999:1.15.0.6 comdex-fall-1999-base:1.15 fvdl-softdep:1.15.0.4 fvdl-softdep-base:1.15 thorpej_scsipi:1.15.0.2 thorpej_scsipi_base:1.17 netbsd-1-4-PATCH001:1.11 kame_14_19990705:1.11 kame_14_19990628:1.11 kame:1.11.0.6 chs-ubc2:1.11.0.4 chs-ubc2-base:1.15 netbsd-1-4-RELEASE:1.11 netbsd-1-4:1.11.0.2 netbsd-1-4-base:1.11 netbsd-1-3-PATCH003:1.2.2.1 netbsd-1-3-PATCH003-CANDIDATE2:1.2.2.1 kenh-if-detach:1.10.0.4 kenh-if-detach-base:1.10 netbsd-1-3-PATCH003-CANDIDATE1:1.2.2.1 netbsd-1-3-PATCH003-CANDIDATE0:1.2.2.1 chs-ubc:1.10.0.2 chs-ubc-base:1.10 eeh-paddr_t:1.8.0.2 eeh-paddr_t-base:1.8 netbsd-1-3-PATCH002:1.2.2.1 netbsd-1-3-PATCH001:1.2.2.1 netbsd-1-3-RELEASE:1.2.2.1 netbsd-1-3-BETA:1.2 netbsd-1-3:1.2.0.2 netbsd-1-3-base:1.2 thorpej-signal:1.1.0.4 thorpej-signal-base:1.1 marc-pcmcia-base:1.2 marc-pcmcia:1.1.0.2; locks; strict; comment @ * @; 1.39 date 2019.06.29.17.42.36; author kamil; state Exp; branches; next 1.38; commitid Vvwt3yOknykDQ6tB; 1.38 date 2013.09.12.18.00.18; author drochner; state Exp; branches 1.38.30.1; next 1.37; 1.37 date 2010.03.21.00.10.40; author chs; state Exp; branches 1.37.8.1 1.37.18.1 1.37.22.1; next 1.36; 1.36 date 2010.03.02.23.19.09; author pooka; state Exp; branches 1.36.2.1; next 1.35; 1.35 date 2008.11.19.18.36.09; author ad; state Exp; branches 1.35.6.1; next 1.34; 1.34 date 2008.10.27.10.58.22; author cegger; state Exp; branches; next 1.33; 1.33 date 2008.10.24.17.17.12; author cegger; state Exp; branches 1.33.2.1; next 1.32; 1.32 date 2008.04.28.20.24.10; author martin; state Exp; branches 1.32.6.1; next 1.31; 1.31 date 2008.01.02.19.26.45; author yamt; state Exp; branches 1.31.6.1 1.31.8.1 1.31.10.1; next 1.30; 1.30 date 2007.03.04.06.03.36; author christos; state Exp; branches 1.30.16.1 1.30.22.1 1.30.28.1; next 1.29; 1.29 date 2006.04.15.02.49.25; author christos; state Exp; branches 1.29.14.1; next 1.28; 1.28 date 2006.04.15.02.48.32; author christos; state Exp; branches; next 1.27; 1.27 date 2006.04.15.01.25.01; author christos; state Exp; branches; next 1.26; 1.26 date 2005.12.11.12.25.16; author christos; state Exp; branches 1.26.4.1 1.26.6.1 1.26.8.1 1.26.10.1 1.26.12.1; next 1.25; 1.25 date 2005.05.29.20.58.13; author christos; state Exp; branches 1.25.2.1; next 1.24; 1.24 date 2004.05.22.22.52.15; author jonathan; state Exp; branches; next 1.23; 1.23 date 2003.06.29.22.32.15; author fvdl; state Exp; branches 1.23.2.1; next 1.22; 1.22 date 2003.06.28.14.22.17; author darrenr; state Exp; branches; next 1.21; 1.21 date 2003.02.01.06.23.48; author thorpej; state Exp; branches; next 1.20; 1.20 date 2002.09.22.19.35.22; author jdolecek; state Exp; branches; next 1.19; 1.19 date 2001.11.10.10.59.09; author lukem; state Exp; branches; next 1.18; 1.18 date 2001.10.13.23.25.58; author simonb; state Exp; branches 1.18.2.1; next 1.17; 1.17 date 2000.10.03.17.18.15; author chs; state Exp; branches 1.17.2.1 1.17.4.1; next 1.16; 1.16 date 2000.10.02.04.27.57; author itojun; state Exp; branches; next 1.15; 1.15 date 99.07.26.02.16.35; author enami; state Exp; branches 1.15.2.1; next 1.14; 1.14 date 99.05.07.15.17.26; author drochner; state Exp; branches; next 1.13; 1.13 date 99.04.12.01.05.01; author ross; state Exp; branches; next 1.12; 1.12 date 99.04.11.22.15.25; author gwr; state Exp; branches; next 1.11; 1.11 date 99.02.21.15.07.49; author drochner; state Exp; branches 1.11.4.1; next 1.10; 1.10 date 98.09.13.13.49.29; author christos; state Exp; branches; next 1.9; 1.9 date 98.08.09.21.19.50; author perry; state Exp; branches; next 1.8; 1.8 date 98.06.13.04.33.40; author tv; state Exp; branches; next 1.7; 1.7 date 98.03.01.17.37.32; author veego; state Exp; branches; next 1.6; 1.6 date 98.01.12.21.27.15; author scottr; state Exp; branches; next 1.5; 1.5 date 98.01.09.15.16.55; author drochner; state Exp; branches; next 1.4; 1.4 date 97.12.12.21.09.49; author gwr; state Exp; branches; next 1.3; 1.3 date 97.12.10.20.22.37; author gwr; state Exp; branches; next 1.2; 1.2 date 97.09.09.21.36.35; author gwr; state Exp; branches 1.2.2.1; next 1.1; 1.1 date 97.08.29.16.07.46; author gwr; state Exp; branches 1.1.2.1; next ; 1.38.30.1 date 2020.04.13.08.05.17; author martin; state Exp; branches; next ; commitid X01YhRUPVUDaec4C; 1.37.8.1 date 2014.05.22.11.41.11; author yamt; state Exp; branches; next ; 1.37.18.1 date 2014.08.20.00.04.36; author tls; state Exp; branches; next ; 1.37.22.1 date 2014.05.18.17.46.14; author rmind; state Exp; branches; next ; 1.36.2.1 date 2010.05.30.05.18.03; author rmind; state Exp; branches; next ; 1.35.6.1 date 2010.04.30.14.44.22; author uebayasi; state Exp; branches; next ; 1.33.2.1 date 2009.01.19.13.20.20; author skrll; state Exp; branches; next ; 1.32.6.1 date 2008.12.13.01.15.28; author haad; state Exp; branches; next ; 1.31.6.1 date 2008.06.02.13.24.30; author mjf; state Exp; branches; next 1.31.6.2; 1.31.6.2 date 2009.01.17.13.29.34; author mjf; state Exp; branches; next ; 1.31.8.1 date 2008.05.18.12.35.45; author yamt; state Exp; branches; next ; 1.31.10.1 date 2008.05.16.02.25.49; author yamt; state Exp; branches; next 1.31.10.2; 1.31.10.2 date 2009.05.04.08.14.22; author yamt; state Exp; branches; next 1.31.10.3; 1.31.10.3 date 2010.03.11.15.04.31; author yamt; state Exp; branches; next 1.31.10.4; 1.31.10.4 date 2010.08.11.22.54.58; author yamt; state Exp; branches; next ; 1.30.16.1 date 2008.01.09.01.57.51; author matt; state Exp; branches; next ; 1.30.22.1 date 2008.02.18.21.07.18; author mjf; state Exp; branches; next ; 1.30.28.1 date 2008.01.02.21.57.42; author bouyer; state Exp; branches; next ; 1.29.14.1 date 2007.03.12.06.00.36; author rmind; state Exp; branches; next ; 1.26.4.1 date 2006.09.09.02.59.24; author rpaulo; state Exp; branches; next ; 1.26.6.1 date 2006.04.22.11.40.14; author simonb; state Exp; branches; next ; 1.26.8.1 date 2006.05.24.10.59.15; author yamt; state Exp; branches; next ; 1.26.10.1 date 2006.04.19.05.06.37; author elad; state Exp; branches; next ; 1.26.12.1 date 2006.05.24.15.50.46; author tron; state Exp; branches; next ; 1.25.2.1 date 2006.06.21.15.11.58; author yamt; state Exp; branches; next 1.25.2.2; 1.25.2.2 date 2007.09.03.14.44.17; author yamt; state Exp; branches; next 1.25.2.3; 1.25.2.3 date 2008.01.21.09.47.32; author yamt; state Exp; branches; next ; 1.23.2.1 date 2003.07.02.15.27.08; author darrenr; state Exp; branches; next 1.23.2.2; 1.23.2.2 date 2004.08.03.10.56.17; author skrll; state Exp; branches; next 1.23.2.3; 1.23.2.3 date 2004.09.18.14.56.20; author skrll; state Exp; branches; next 1.23.2.4; 1.23.2.4 date 2004.09.21.13.38.36; author skrll; state Exp; branches; next 1.23.2.5; 1.23.2.5 date 2005.11.10.14.11.55; author skrll; state Exp; branches; next ; 1.18.2.1 date 2001.11.12.21.19.36; author thorpej; state Exp; branches; next ; 1.17.2.1 date 2001.10.22.20.42.10; author nathanw; state Exp; branches; next 1.17.2.2; 1.17.2.2 date 2001.11.14.19.18.43; author nathanw; state Exp; branches; next 1.17.2.3; 1.17.2.3 date 2002.10.18.02.45.34; author nathanw; state Exp; branches; next ; 1.17.4.1 date 2002.01.10.20.04.21; author thorpej; state Exp; branches; next 1.17.4.2; 1.17.4.2 date 2002.10.10.18.44.36; author jdolecek; state Exp; branches; next ; 1.15.2.1 date 2000.11.20.18.11.16; author bouyer; state Exp; branches; next ; 1.11.4.1 date 99.06.21.01.28.55; author thorpej; state Exp; branches; next 1.11.4.2; 1.11.4.2 date 99.08.02.22.38.26; author thorpej; state Exp; branches; next ; 1.2.2.1 date 97.12.14.23.11.30; author mellon; state Exp; branches; next ; 1.1.2.1 date 97.08.29.16.07.46; author thorpej; state dead; branches; next 1.1.2.2; 1.1.2.2 date 97.09.01.21.02.56; author thorpej; state Exp; branches; next 1.1.2.3; 1.1.2.3 date 97.09.16.03.51.24; author thorpej; state Exp; branches; next ; desc @@ 1.39 log @Appease GCC and initialize arps_ip Fixes build as GCC errors with maybe-uninitialized that is a false positive. @ text @/* $NetBSD: nfs_bootparam.c,v 1.38 2013/09/12 18:00:18 drochner Exp $ */ /*- * Copyright (c) 1995, 1997 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Adam Glass and Gordon W. Ross. * * 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. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. */ /* * Support for NFS diskless booting, Sun-style (RPC/bootparams) */ #include __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.38 2013/09/12 18:00:18 drochner Exp $"); #ifdef _KERNEL_OPT #include "opt_nfs_boot.h" #include "arp.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 /* * There are two implementations of NFS diskless boot. * This implementation uses Sun RPC/bootparams, and the * the other uses BOOTP (RFC951 - see nfs_bootdhcp.c). * * The Sun-style boot sequence goes as follows: * (1) Use RARP to get our interface address * (2) Use RPC/bootparam/whoami to get our hostname, * our IP address, and the server's IP address. * (3) Use RPC/bootparam/getfile to get the root path * (4) Use RPC/mountd to get the root file handle * (5) Use RPC/bootparam/getfile to get the swap path * (6) Use RPC/mountd to get the swap file handle */ /* bootparam RPC */ static int bp_whoami (struct sockaddr_in *bpsin, struct in_addr *my_ip, struct in_addr *gw_ip, struct lwp *l); static int bp_getfile (struct sockaddr_in *bpsin, const char *key, struct nfs_dlmount *ndm, struct lwp *l); /* * Get client name, gateway address, then * get root and swap server:pathname info. * RPCs: bootparam/whoami, bootparam/getfile * * Use the old broadcast address for the WHOAMI * call because we do not yet know our netmask. * The server address returned by the WHOAMI call * is used for all subsequent bootparam RPCs. */ int nfs_bootparam(struct nfs_diskless *nd, struct lwp *lwp, int *flags) { struct ifnet *ifp = nd->nd_ifp; struct in_addr my_ip, arps_ip, gw_ip; struct sockaddr_in bp_sin; struct sockaddr_in *sin; #ifndef NFS_BOOTPARAM_NOGATEWAY struct nfs_dlmount *gw_ndm = 0; char *p; u_int32_t mask; #endif int error; /* * Bring up the interface. (just set the "up" flag) */ error = nfs_boot_ifupdown(ifp, lwp, 1); if (error) { printf("nfs_boot: SIFFLAGS, error=%d\n", error); return (error); } error = EADDRNOTAVAIL; memset(&arps_ip, 0, sizeof(arps_ip)); /* GCC */ #if NARP > 0 if (ifp->if_type == IFT_ETHER || ifp->if_type == IFT_FDDI) { /* * Do RARP for the interface address. */ error = revarpwhoarewe(ifp, &arps_ip, &my_ip); } #endif if (error) { printf("revarp failed, error=%d\n", error); goto out; } if (!(*flags & NFS_BOOT_HAS_MYIP)) { nd->nd_myip.s_addr = my_ip.s_addr; printf("nfs_boot: client_addr=%s", inet_ntoa(my_ip)); printf(" (RARP from %s)\n", inet_ntoa(arps_ip)); *flags |= NFS_BOOT_HAS_MYIP; } /* * Do enough of ifconfig(8) so that the chosen interface * can talk to the servers. (just set the address) */ error = nfs_boot_setaddress(ifp, lwp, my_ip.s_addr, INADDR_ANY, INADDR_ANY); if (error) { printf("nfs_boot: set ifaddr, error=%d\n", error); goto out; } /* * Get client name and gateway address. * RPC: bootparam/whoami * Use the old broadcast address for the WHOAMI * call because we do not yet know our netmask. * The server address returned by the WHOAMI call * is used for all subsequent booptaram RPCs. */ sin = &bp_sin; memset((void *)sin, 0, sizeof(*sin)); sin->sin_len = sizeof(*sin); sin->sin_family = AF_INET; sin->sin_addr.s_addr = INADDR_BROADCAST; /* Do the RPC/bootparam/whoami. */ error = bp_whoami(sin, &my_ip, &gw_ip, lwp); if (error) { printf("nfs_boot: bootparam whoami, error=%d\n", error); goto delout; } *flags |= NFS_BOOT_HAS_SERVADDR | NFS_BOOT_HAS_SERVER; printf("nfs_boot: server_addr=%s\n", inet_ntoa(sin->sin_addr)); printf("nfs_boot: hostname=%s\n", hostname); /* * Now fetch the server:pathname strings and server IP * for root and swap. Missing swap is not fatal. */ error = bp_getfile(sin, "root", &nd->nd_root, lwp); if (error) { printf("nfs_boot: bootparam get root: %d\n", error); goto delout; } *flags |= NFS_BOOT_HAS_ROOTPATH; #ifndef NFS_BOOTPARAM_NOGATEWAY gw_ndm = kmem_alloc(sizeof(*gw_ndm), KM_SLEEP); memset((void *)gw_ndm, 0, sizeof(*gw_ndm)); error = bp_getfile(sin, "gateway", gw_ndm, lwp); if (error) { /* No gateway supplied. No error, but try fallback. */ error = 0; goto nogwrepl; } sin = (struct sockaddr_in *) &gw_ndm->ndm_saddr; if (sin->sin_addr.s_addr == 0) goto out; /* no gateway */ /* OK, we have a gateway! */ printf("nfs_boot: gateway=%s\n", inet_ntoa(sin->sin_addr)); /* Just save it. Caller adds the route. */ nd->nd_gwip = sin->sin_addr; *flags |= NFS_BOOT_HAS_GWIP; /* Look for a mask string after the colon. */ p = strchr(gw_ndm->ndm_host, ':'); if (p == 0) goto out; /* no netmask */ /* have pathname */ p++; /* skip ':' */ mask = inet_addr(p); /* libkern */ if (mask == 0) goto out; /* no netmask */ /* Have a netmask too! Save it; update the I/F. */ nd->nd_mask.s_addr = mask; *flags |= NFS_BOOT_HAS_MASK; printf("nfs_boot: my_mask=%s\n", inet_ntoa(nd->nd_mask)); (void) nfs_boot_deladdress(ifp, lwp, my_ip.s_addr); error = nfs_boot_setaddress(ifp, lwp, my_ip.s_addr, mask, INADDR_ANY); if (error) { printf("nfs_boot: set ifmask, error=%d\n", error); goto out; } goto gwok; nogwrepl: #endif #ifdef NFS_BOOT_GATEWAY /* * Note: we normally ignore the gateway address returned * by the "bootparam/whoami" RPC above, because many old * bootparam servers supply a bogus gateway value. * * These deficiencies in the bootparam RPC interface are * circumvented by using the bootparam/getfile RPC. The * parameter "gateway" is requested, and if its returned, * we use the "server" part of the reply as the gateway, * and use the "pathname" part of the reply as the mask. * (The mask comes to us as a string.) */ if (gw_ip.s_addr) { /* Our caller will add the route. */ nd->nd_gwip = gw_ip; *flags |= NFS_BOOT_HAS_GWIP; } #endif delout: if (error) (void) nfs_boot_deladdress(ifp, lwp, my_ip.s_addr); out: if (error) { (void) nfs_boot_ifupdown(ifp, lwp, 0); nfs_boot_flushrt(ifp); } #ifndef NFS_BOOTPARAM_NOGATEWAY gwok: if (gw_ndm) kmem_free(gw_ndm, sizeof(*gw_ndm)); #endif if ((*flags & NFS_BOOT_ALLINFO) != NFS_BOOT_ALLINFO) return error ? error : EADDRNOTAVAIL; return (error); } /* * RPC: bootparam/whoami * Given client IP address, get: * client name (hostname) * domain name (domainname) * gateway address * * The hostname and domainname are set here for convenience. * * Note - bpsin is initialized to the broadcast address, * and will be replaced with the bootparam server address * after this call is complete. Have to use PMAP_PROC_CALL * to make sure we get responses only from a servers that * know about us (don't want to broadcast a getport call). */ static int bp_whoami(struct sockaddr_in *bpsin, struct in_addr *my_ip, struct in_addr *gw_ip, struct lwp *l) { /* RPC structures for PMAPPROC_CALLIT */ struct whoami_call { u_int32_t call_prog; u_int32_t call_vers; u_int32_t call_proc; u_int32_t call_arglen; } *call; struct callit_reply { u_int32_t port; u_int32_t encap_len; /* encapsulated data here */ } *reply; struct mbuf *m, *from; struct sockaddr_in *sin; int error; int16_t port; /* * Build request message for PMAPPROC_CALLIT. */ m = m_get(M_WAIT, MT_DATA); call = mtod(m, struct whoami_call *); m->m_len = sizeof(*call); call->call_prog = txdr_unsigned(BOOTPARAM_PROG); call->call_vers = txdr_unsigned(BOOTPARAM_VERS); call->call_proc = txdr_unsigned(BOOTPARAM_WHOAMI); /* * append encapsulated data (client IP address) */ m->m_next = xdr_inaddr_encode(my_ip); call->call_arglen = txdr_unsigned(m->m_next->m_len); /* RPC: portmap/callit */ bpsin->sin_port = htons(PMAPPORT); error = krpc_call(bpsin, PMAPPROG, PMAPVERS, PMAPPROC_CALLIT, &m, &from, l); if (error) { m_freem(m); return error; } /* * Parse result message. */ if (m->m_len < sizeof(*reply)) { m = m_pullup(m, sizeof(*reply)); if (m == NULL) goto bad; } reply = mtod(m, struct callit_reply *); port = fxdr_unsigned(u_int32_t, reply->port); m_adj(m, sizeof(*reply)); /* * Save bootparam server address */ sin = mtod(from, struct sockaddr_in *); bpsin->sin_port = htons(port); bpsin->sin_addr.s_addr = sin->sin_addr.s_addr; /* client name */ hostnamelen = MAXHOSTNAMELEN-1; m = xdr_string_decode(m, hostname, &hostnamelen); if (m == NULL) goto bad; /* domain name */ domainnamelen = MAXHOSTNAMELEN-1; m = xdr_string_decode(m, domainname, &domainnamelen); if (m == NULL) goto bad; /* gateway address */ m = xdr_inaddr_decode(m, gw_ip); if (m == NULL) goto bad; /* success */ goto out; bad: printf("nfs_boot: bootparam_whoami: bad reply\n"); error = EBADRPC; out: m_freem(from); if (m) m_freem(m); return(error); } /* * RPC: bootparam/getfile * Given client name and file "key", get: * server name * server IP address * server pathname */ static int bp_getfile(struct sockaddr_in *bpsin, const char *key, struct nfs_dlmount *ndm, struct lwp *l) { char pathname[MNAMELEN]; struct in_addr inaddr; struct sockaddr_in *sin; struct mbuf *m; char *serv_name; int error, sn_len, path_len; /* * Build request message. */ /* client name (hostname) */ m = xdr_string_encode(hostname, hostnamelen); if (m == NULL) return (ENOMEM); /* key name (root or swap) */ /*XXXUNCONST*/ m->m_next = xdr_string_encode(__UNCONST(key), strlen(key)); if (m->m_next == NULL) return (ENOMEM); /* RPC: bootparam/getfile */ error = krpc_call(bpsin, BOOTPARAM_PROG, BOOTPARAM_VERS, BOOTPARAM_GETFILE, &m, NULL, l); if (error) return error; /* * Parse result message. */ /* server name */ serv_name = &ndm->ndm_host[0]; sn_len = sizeof(ndm->ndm_host) - 1; m = xdr_string_decode(m, serv_name, &sn_len); if (m == NULL) goto bad; /* server IP address (mountd/NFS) */ m = xdr_inaddr_decode(m, &inaddr); if (m == NULL) goto bad; /* server pathname */ path_len = sizeof(pathname) - 1; m = xdr_string_decode(m, pathname, &path_len); if (m == NULL) goto bad; /* * Store the results in the nfs_dlmount. * The strings become "server:pathname" */ sin = (struct sockaddr_in *) &ndm->ndm_saddr; memset((void *)sin, 0, sizeof(*sin)); sin->sin_len = sizeof(*sin); sin->sin_family = AF_INET; sin->sin_addr = inaddr; if ((sn_len + 1 + path_len + 1) > sizeof(ndm->ndm_host)) { printf("nfs_boot: getfile name too long\n"); error = EIO; goto out; } ndm->ndm_host[sn_len] = ':'; memcpy(ndm->ndm_host + sn_len + 1, pathname, path_len + 1); /* success */ goto out; bad: printf("nfs_boot: bootparam_getfile: bad reply\n"); error = EBADRPC; out: m_freem(m); return(0); } @ 1.38 log @tyop in comment, from Eivind Evensen via OpenBSD @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.37 2010/03/21 00:10:40 chs Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.37 2010/03/21 00:10:40 chs Exp $"); d130 1 @ 1.38.30.1 log @Mostly merge changes from HEAD upto 20200411 @ text @d1 1 a1 1 /* $NetBSD$ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD$"); a129 1 memset(&arps_ip, 0, sizeof(arps_ip)); /* GCC */ @ 1.37 log @in nfs_bootparam(), set the corresponding flag for each field that we fill in. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.36 2010/03/02 23:19:09 pooka Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.36 2010/03/02 23:19:09 pooka Exp $"); d104 1 a104 1 * is used for all subsequent booptaram RPCs. @ 1.37.18.1 log @Rebase to HEAD as of a few days ago. @ text @d1 1 a1 1 /* $NetBSD$ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD$"); d104 1 a104 1 * is used for all subsequent bootparam RPCs. @ 1.37.8.1 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: nfs_bootparam.c,v 1.37 2010/03/21 00:10:40 chs Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.37 2010/03/21 00:10:40 chs Exp $"); d104 1 a104 1 * is used for all subsequent bootparam RPCs. @ 1.37.22.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.37 2010/03/21 00:10:40 chs Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.37 2010/03/21 00:10:40 chs Exp $"); d104 1 a104 1 * is used for all subsequent bootparam RPCs. @ 1.36 log @Get rid of dependency on fs_nfs.h, i.e. source modules with conditional content depending on if the NFS client is wanted or not. The server can now be made an independent module not depending on the nfs client. Tested with rump_nfs (standalone client), rump_nfsd (standalone nfsd) and a qemu installation with both the client and the server. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.35 2008/11/19 18:36:09 ad Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.35 2008/11/19 18:36:09 ad Exp $"); d181 1 d194 1 d213 1 d227 1 d255 1 @ 1.36.2.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.36 2010/03/02 23:19:09 pooka Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.36 2010/03/02 23:19:09 pooka Exp $"); a180 1 *flags |= NFS_BOOT_HAS_SERVADDR | NFS_BOOT_HAS_SERVER; a192 1 *flags |= NFS_BOOT_HAS_ROOTPATH; a210 1 *flags |= NFS_BOOT_HAS_GWIP; a223 1 *flags |= NFS_BOOT_HAS_MASK; a250 1 *flags |= NFS_BOOT_HAS_GWIP; @ 1.35 log @Make the emulations, exec formats, coredump, NFS, and the NFS server into modules. By and large this commit: - shuffles header files and ifdefs - splits code out where necessary to be modular - adds module glue for each of the components - adds/replaces hooks for things that can be installed at runtime @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.34 2008/10/27 10:58:22 cegger Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.34 2008/10/27 10:58:22 cegger Exp $"); d54 1 @ 1.35.6.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD$ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD$"); a53 1 #include a179 1 *flags |= NFS_BOOT_HAS_SERVADDR | NFS_BOOT_HAS_SERVER; a191 1 *flags |= NFS_BOOT_HAS_ROOTPATH; a209 1 *flags |= NFS_BOOT_HAS_GWIP; a222 1 *flags |= NFS_BOOT_HAS_MASK; a249 1 *flags |= NFS_BOOT_HAS_GWIP; @ 1.34 log @change nfs boot behaviour to automatically try next boot method if boot information are incomplete to succeed. That way, it is possible combine static and dhcp boot: For example, to boot diskless you can specify the nfs-server and the rootpath statically. All other information will be taken via dhcp. Patch has been presented on port-xen, tech-kern and tech-net: http://mail-index.netbsd.org/port-xen/2008/10/24/msg004488.html http://mail-index.netbsd.org/tech-kern/2008/10/24/msg003255.html http://mail-index.netbsd.org/tech-net/2008/10/24/msg000864.html No comments, no objections. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.33 2008/10/24 17:17:12 cegger Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.33 2008/10/24 17:17:12 cegger Exp $"); d39 1 d41 2 a42 1 #include "opt_inet.h" a72 2 #include "arp.h" a128 1 #ifdef INET a136 1 #endif @ 1.33 log @- ansify function definition - de- __P - u_int32_t -> uint32_t No functional changes. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.32 2008/04/28 20:24:10 martin Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.32 2008/04/28 20:24:10 martin Exp $"); d106 1 a106 1 nfs_bootparam(struct nfs_diskless *nd, struct lwp *lwp) d144 6 a149 3 nd->nd_myip.s_addr = my_ip.s_addr; printf("nfs_boot: client_addr=%s", inet_ntoa(my_ip)); printf(" (RARP from %s)\n", inet_ntoa(arps_ip)); d268 3 @ 1.33.2.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.35 2008/11/19 18:36:09 ad Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.35 2008/11/19 18:36:09 ad Exp $"); a38 1 #ifdef _KERNEL_OPT d40 1 a40 2 #include "arp.h" #endif d71 2 d106 1 a106 1 nfs_bootparam(struct nfs_diskless *nd, struct lwp *lwp, int *flags) d129 1 d138 1 d144 3 a146 6 if (!(*flags & NFS_BOOT_HAS_MYIP)) { nd->nd_myip.s_addr = my_ip.s_addr; printf("nfs_boot: client_addr=%s", inet_ntoa(my_ip)); printf(" (RARP from %s)\n", inet_ntoa(arps_ip)); *flags |= NFS_BOOT_HAS_MYIP; } a264 3 if ((*flags & NFS_BOOT_ALLINFO) != NFS_BOOT_ALLINFO) return error ? error : EADDRNOTAVAIL; @ 1.32 log @Remove clause 3 and 4 from TNF licenses @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.31 2008/01/02 19:26:45 yamt Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.31 2008/01/02 19:26:45 yamt Exp $"); d89 4 a92 4 static int bp_whoami __P((struct sockaddr_in *bpsin, struct in_addr *my_ip, struct in_addr *gw_ip, struct lwp *l)); static int bp_getfile __P((struct sockaddr_in *bpsin, const char *key, struct nfs_dlmount *ndm, struct lwp *l)); d106 1 a106 3 nfs_bootparam(nd, lwp) struct nfs_diskless *nd; struct lwp *lwp; d285 2 a286 5 bp_whoami(bpsin, my_ip, gw_ip, l) struct sockaddr_in *bpsin; struct in_addr *my_ip; struct in_addr *gw_ip; struct lwp *l; d390 2 a391 5 bp_getfile(bpsin, key, ndm, l) struct sockaddr_in *bpsin; const char *key; struct nfs_dlmount *ndm; struct lwp *l; @ 1.32.6.1 log @Update haad-dm branch to haad-dm-base2. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.35 2008/11/19 18:36:09 ad Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.35 2008/11/19 18:36:09 ad Exp $"); a38 1 #ifdef _KERNEL_OPT d40 1 a40 2 #include "arp.h" #endif d71 2 d89 4 a92 4 static int bp_whoami (struct sockaddr_in *bpsin, struct in_addr *my_ip, struct in_addr *gw_ip, struct lwp *l); static int bp_getfile (struct sockaddr_in *bpsin, const char *key, struct nfs_dlmount *ndm, struct lwp *l); d106 3 a108 1 nfs_bootparam(struct nfs_diskless *nd, struct lwp *lwp, int *flags) d131 1 d140 1 d146 3 a148 6 if (!(*flags & NFS_BOOT_HAS_MYIP)) { nd->nd_myip.s_addr = my_ip.s_addr; printf("nfs_boot: client_addr=%s", inet_ntoa(my_ip)); printf(" (RARP from %s)\n", inet_ntoa(arps_ip)); *flags |= NFS_BOOT_HAS_MYIP; } a266 3 if ((*flags & NFS_BOOT_ALLINFO) != NFS_BOOT_ALLINFO) return error ? error : EADDRNOTAVAIL; d287 5 a291 2 bp_whoami(struct sockaddr_in *bpsin, struct in_addr *my_ip, struct in_addr *gw_ip, struct lwp *l) d395 5 a399 2 bp_getfile(struct sockaddr_in *bpsin, const char *key, struct nfs_dlmount *ndm, struct lwp *l) @ 1.31 log @use kmem_alloc instead of malloc. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.30 2007/03/04 06:03:36 christos Exp $ */ a17 7 * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.30 2007/03/04 06:03:36 christos Exp $"); @ 1.31.6.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD$ */ d18 7 d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD$"); @ 1.31.6.2 log @Sync with HEAD. @ text @a38 1 #ifdef _KERNEL_OPT d40 1 a40 2 #include "arp.h" #endif d71 2 d89 4 a92 4 static int bp_whoami (struct sockaddr_in *bpsin, struct in_addr *my_ip, struct in_addr *gw_ip, struct lwp *l); static int bp_getfile (struct sockaddr_in *bpsin, const char *key, struct nfs_dlmount *ndm, struct lwp *l); d106 3 a108 1 nfs_bootparam(struct nfs_diskless *nd, struct lwp *lwp, int *flags) d131 1 d140 1 d146 3 a148 6 if (!(*flags & NFS_BOOT_HAS_MYIP)) { nd->nd_myip.s_addr = my_ip.s_addr; printf("nfs_boot: client_addr=%s", inet_ntoa(my_ip)); printf(" (RARP from %s)\n", inet_ntoa(arps_ip)); *flags |= NFS_BOOT_HAS_MYIP; } a266 3 if ((*flags & NFS_BOOT_ALLINFO) != NFS_BOOT_ALLINFO) return error ? error : EADDRNOTAVAIL; d287 5 a291 2 bp_whoami(struct sockaddr_in *bpsin, struct in_addr *my_ip, struct in_addr *gw_ip, struct lwp *l) d395 5 a399 2 bp_getfile(struct sockaddr_in *bpsin, const char *key, struct nfs_dlmount *ndm, struct lwp *l) @ 1.31.8.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.31 2008/01/02 19:26:45 yamt Exp $ */ d18 7 d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.31 2008/01/02 19:26:45 yamt Exp $"); @ 1.31.10.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.31 2008/01/02 19:26:45 yamt Exp $ */ d18 7 d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.31 2008/01/02 19:26:45 yamt Exp $"); @ 1.31.10.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.31.10.1 2008/05/16 02:25:49 yamt Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.31.10.1 2008/05/16 02:25:49 yamt Exp $"); a38 1 #ifdef _KERNEL_OPT d40 1 a40 2 #include "arp.h" #endif d71 2 d89 4 a92 4 static int bp_whoami (struct sockaddr_in *bpsin, struct in_addr *my_ip, struct in_addr *gw_ip, struct lwp *l); static int bp_getfile (struct sockaddr_in *bpsin, const char *key, struct nfs_dlmount *ndm, struct lwp *l); d106 3 a108 1 nfs_bootparam(struct nfs_diskless *nd, struct lwp *lwp, int *flags) d131 1 d140 1 d146 3 a148 6 if (!(*flags & NFS_BOOT_HAS_MYIP)) { nd->nd_myip.s_addr = my_ip.s_addr; printf("nfs_boot: client_addr=%s", inet_ntoa(my_ip)); printf(" (RARP from %s)\n", inet_ntoa(arps_ip)); *flags |= NFS_BOOT_HAS_MYIP; } a266 3 if ((*flags & NFS_BOOT_ALLINFO) != NFS_BOOT_ALLINFO) return error ? error : EADDRNOTAVAIL; d287 5 a291 2 bp_whoami(struct sockaddr_in *bpsin, struct in_addr *my_ip, struct in_addr *gw_ip, struct lwp *l) d395 5 a399 2 bp_getfile(struct sockaddr_in *bpsin, const char *key, struct nfs_dlmount *ndm, struct lwp *l) @ 1.31.10.3 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.31.10.2 2009/05/04 08:14:22 yamt Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.31.10.2 2009/05/04 08:14:22 yamt Exp $"); a53 1 #include @ 1.31.10.4 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.31.10.3 2010/03/11 15:04:31 yamt Exp $ */ d37 1 a37 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.31.10.3 2010/03/11 15:04:31 yamt Exp $"); a180 1 *flags |= NFS_BOOT_HAS_SERVADDR | NFS_BOOT_HAS_SERVER; a192 1 *flags |= NFS_BOOT_HAS_ROOTPATH; a210 1 *flags |= NFS_BOOT_HAS_GWIP; a223 1 *flags |= NFS_BOOT_HAS_MASK; a250 1 *flags |= NFS_BOOT_HAS_GWIP; @ 1.30 log @Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.29 2006/04/15 02:49:25 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.29 2006/04/15 02:49:25 christos Exp $"); d202 1 a202 1 gw_ndm = malloc(sizeof(*gw_ndm), M_NFSMNT, M_WAITOK); d272 1 a272 1 free(gw_ndm, M_NFSMNT); @ 1.30.22.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.31 2008/01/02 19:26:45 yamt Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.31 2008/01/02 19:26:45 yamt Exp $"); d202 1 a202 1 gw_ndm = kmem_alloc(sizeof(*gw_ndm), KM_SLEEP); d272 1 a272 1 kmem_free(gw_ndm, sizeof(*gw_ndm)); @ 1.30.16.1 log @sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.30 2007/03/04 06:03:36 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.30 2007/03/04 06:03:36 christos Exp $"); d202 1 a202 1 gw_ndm = kmem_alloc(sizeof(*gw_ndm), KM_SLEEP); d272 1 a272 1 kmem_free(gw_ndm, sizeof(*gw_ndm)); @ 1.30.28.1 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD$ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD$"); d202 1 a202 1 gw_ndm = kmem_alloc(sizeof(*gw_ndm), KM_SLEEP); d272 1 a272 1 kmem_free(gw_ndm, sizeof(*gw_ndm)); @ 1.29 log @m_freem takes one arg. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.28 2006/04/15 02:48:32 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.28 2006/04/15 02:48:32 christos Exp $"); d177 1 a177 1 memset((caddr_t)sin, 0, sizeof(*sin)); d203 1 a203 1 memset((caddr_t)gw_ndm, 0, sizeof(*gw_ndm)); d463 1 a463 1 memset((caddr_t)sin, 0, sizeof(*sin)); @ 1.29.14.1 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.29 2006/04/15 02:49:25 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.29 2006/04/15 02:49:25 christos Exp $"); d177 1 a177 1 memset((void *)sin, 0, sizeof(*sin)); d203 1 a203 1 memset((void *)gw_ndm, 0, sizeof(*gw_ndm)); d463 1 a463 1 memset((void *)sin, 0, sizeof(*sin)); @ 1.28 log @s/mfree/m_freem/ @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.27 2006/04/15 01:25:01 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.27 2006/04/15 01:25:01 christos Exp $"); d339 1 a339 1 m_freem(m, MT_DATA); @ 1.27 log @Don't leak mbufs on error. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.26 2005/12/11 12:25:16 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.26 2005/12/11 12:25:16 christos Exp $"); d339 1 a339 1 mfree(m, MT_DATA); @ 1.26 log @merge ktrace-lwp. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.23.2.5 2005/11/10 14:11:55 skrll Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.23.2.5 2005/11/10 14:11:55 skrll Exp $"); a335 1 from = NULL; d338 2 a339 1 if (error) d341 1 d387 1 a387 2 if (from) m_freem(from); @ 1.26.4.1 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.29 2006/04/15 02:49:25 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.29 2006/04/15 02:49:25 christos Exp $"); d336 1 d339 1 a339 2 if (error) { m_freem(m); a340 1 } d386 2 a387 1 m_freem(from); @ 1.26.12.1 log @Merge 2006-05-24 NetBSD-current into the "peter-altq" branch. @ text @d1 1 a1 1 /* $NetBSD$ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD$"); d336 1 d339 1 a339 2 if (error) { m_freem(m); a340 1 } d386 2 a387 1 m_freem(from); @ 1.26.8.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.26 2005/12/11 12:25:16 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.26 2005/12/11 12:25:16 christos Exp $"); d336 1 d339 1 a339 2 if (error) { m_freem(m); a340 1 } d386 2 a387 1 m_freem(from); @ 1.26.6.1 log @Sync with head. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.29 2006/04/15 02:49:25 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.29 2006/04/15 02:49:25 christos Exp $"); d336 1 d339 1 a339 2 if (error) { m_freem(m); a340 1 } d386 2 a387 1 m_freem(from); @ 1.26.10.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.29 2006/04/15 02:49:25 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.29 2006/04/15 02:49:25 christos Exp $"); d336 1 d339 1 a339 2 if (error) { m_freem(m); a340 1 } d386 2 a387 1 m_freem(from); @ 1.25 log @- sprinkle const - avoid shadowed variables - mark bad const use with XXXUNCONST @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.24 2004/05/22 22:52:15 jonathan Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.24 2004/05/22 22:52:15 jonathan Exp $"); d97 1 a97 1 struct in_addr *my_ip, struct in_addr *gw_ip, struct proc *p)); d99 1 a99 1 struct nfs_dlmount *ndm, struct proc *p)); d113 1 a113 1 nfs_bootparam(nd, procp) d115 1 a115 1 struct proc *procp; d131 1 a131 1 error = nfs_boot_ifupdown(ifp, procp, 1); d161 1 a161 1 error = nfs_boot_setaddress(ifp, procp, my_ip.s_addr, d183 1 a183 1 error = bp_whoami(sin, &my_ip, &gw_ip, procp); d195 1 a195 1 error = bp_getfile(sin, "root", &nd->nd_root, procp); d204 1 a204 1 error = bp_getfile(sin, "gateway", gw_ndm, procp); d232 2 a233 2 (void) nfs_boot_deladdress(ifp, procp, my_ip.s_addr); error = nfs_boot_setaddress(ifp, procp, my_ip.s_addr, d263 1 a263 1 (void) nfs_boot_deladdress(ifp, procp, my_ip.s_addr); d266 1 a266 1 (void) nfs_boot_ifupdown(ifp, procp, 0); d294 1 a294 1 bp_whoami(bpsin, my_ip, gw_ip, p) d298 1 a298 1 struct proc *p; d338 1 a338 1 PMAPPROC_CALLIT, &m, &from, p); d402 1 a402 1 bp_getfile(bpsin, key, ndm, p) d406 1 a406 1 struct proc *p; d432 1 a432 1 BOOTPARAM_GETFILE, &m, NULL, p); @ 1.25.2.1 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.25 2005/05/29 20:58:13 christos Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.25 2005/05/29 20:58:13 christos Exp $"); d97 1 a97 1 struct in_addr *my_ip, struct in_addr *gw_ip, struct lwp *l)); d99 1 a99 1 struct nfs_dlmount *ndm, struct lwp *l)); d113 1 a113 1 nfs_bootparam(nd, lwp) d115 1 a115 1 struct lwp *lwp; d131 1 a131 1 error = nfs_boot_ifupdown(ifp, lwp, 1); d161 1 a161 1 error = nfs_boot_setaddress(ifp, lwp, my_ip.s_addr, d183 1 a183 1 error = bp_whoami(sin, &my_ip, &gw_ip, lwp); d195 1 a195 1 error = bp_getfile(sin, "root", &nd->nd_root, lwp); d204 1 a204 1 error = bp_getfile(sin, "gateway", gw_ndm, lwp); d232 2 a233 2 (void) nfs_boot_deladdress(ifp, lwp, my_ip.s_addr); error = nfs_boot_setaddress(ifp, lwp, my_ip.s_addr, d263 1 a263 1 (void) nfs_boot_deladdress(ifp, lwp, my_ip.s_addr); d266 1 a266 1 (void) nfs_boot_ifupdown(ifp, lwp, 0); d294 1 a294 1 bp_whoami(bpsin, my_ip, gw_ip, l) d298 1 a298 1 struct lwp *l; d336 1 d338 2 a339 3 PMAPPROC_CALLIT, &m, &from, l); if (error) { m_freem(m); a340 1 } d386 2 a387 1 m_freem(from); d402 1 a402 1 bp_getfile(bpsin, key, ndm, l) d406 1 a406 1 struct lwp *l; d432 1 a432 1 BOOTPARAM_GETFILE, &m, NULL, l); @ 1.25.2.2 log @sync with head. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.25.2.1 2006/06/21 15:11:58 yamt Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.25.2.1 2006/06/21 15:11:58 yamt Exp $"); d177 1 a177 1 memset((void *)sin, 0, sizeof(*sin)); d203 1 a203 1 memset((void *)gw_ndm, 0, sizeof(*gw_ndm)); d463 1 a463 1 memset((void *)sin, 0, sizeof(*sin)); @ 1.25.2.3 log @sync with head @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.25.2.2 2007/09/03 14:44:17 yamt Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.25.2.2 2007/09/03 14:44:17 yamt Exp $"); d202 1 a202 1 gw_ndm = kmem_alloc(sizeof(*gw_ndm), KM_SLEEP); d272 1 a272 1 kmem_free(gw_ndm, sizeof(*gw_ndm)); @ 1.24 log @Eliminate several uses of `curproc' from the socket-layer code and from NFS. Add a new explicit `struct proc *p' argument to socreate(), sosend(). Use that argument instead of curproc. Follow-on changes to pass that argument to socreate(), sosend(), and (*so->so_send)() calls. These changes reviewed and independently recoded by Matt Thomas. Changes to soreceive() and (*dom->dom_exernalize() from Matt Thomas: pass soreceive()'s struct uio* uio->uio_procp to unp_externalize(). Eliminate curproc from unp_externalize. Also, now soreceive() uses its uio->uio_procp value, pass that same value downward to ((pr->pru_usrreq)() calls for consistency, instead of (struct proc * )0. Similar changes in sys/nfs to eliminate (most) uses of curproc, either via the req-> r_procp field of a struct nfsreq *req argument, or by passing down new explicit struct proc * arguments. Reviewed by: Matt Thomas, posted to tech-kern. NB: The (*pr->pru_usrreq)() change should be tested on more (all!) protocols. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.23 2003/06/29 22:32:15 fvdl Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.23 2003/06/29 22:32:15 fvdl Exp $"); d98 1 a98 1 static int bp_getfile __P((struct sockaddr_in *bpsin, char *key, d404 1 a404 1 char *key; d425 2 a426 1 m->m_next = xdr_string_encode(key, strlen(key)); @ 1.23 log @Back out the lwp/ktrace changes. They contained a lot of colateral damage, and need to be examined and discussed more. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.21 2003/02/01 06:23:48 thorpej Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.21 2003/02/01 06:23:48 thorpej Exp $"); d97 1 a97 1 struct in_addr *my_ip, struct in_addr *gw_ip)); d99 1 a99 1 struct nfs_dlmount *ndm)); d183 1 a183 1 error = bp_whoami(sin, &my_ip, &gw_ip); d195 1 a195 1 error = bp_getfile(sin, "root", &nd->nd_root); d204 1 a204 1 error = bp_getfile(sin, "gateway", gw_ndm); d294 1 a294 1 bp_whoami(bpsin, my_ip, gw_ip) d298 1 d338 1 a338 1 PMAPPROC_CALLIT, &m, &from); d402 1 a402 1 bp_getfile(bpsin, key, ndm) d406 1 d431 1 a431 1 BOOTPARAM_GETFILE, &m, NULL); @ 1.23.2.1 log @Apply the aborted ktrace-lwp changes to a specific branch. This is just for others to review, I'm concerned that patch fuziness may have resulted in some errant code being generated but I'll look at that later by comparing the diff from the base to the branch with the file I attempt to apply to it. This will, at the very least, put the changes in a better context for others to review them and attempt to tinker with removing passing of 'struct lwp' through the kernel. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.23 2003/06/29 22:32:15 fvdl Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.23 2003/06/29 22:32:15 fvdl Exp $"); d113 1 a113 1 nfs_bootparam(nd, lwp) d115 1 a115 1 struct lwp *lwp; d131 1 a131 1 error = nfs_boot_ifupdown(ifp, lwp, 1); d161 1 a161 1 error = nfs_boot_setaddress(ifp, lwp, my_ip.s_addr, d232 2 a233 2 (void) nfs_boot_deladdress(ifp, lwp, my_ip.s_addr); error = nfs_boot_setaddress(ifp, lwp, my_ip.s_addr, d263 1 a263 1 (void) nfs_boot_deladdress(ifp, lwp, my_ip.s_addr); d266 1 a266 1 (void) nfs_boot_ifupdown(ifp, lwp, 0); @ 1.23.2.2 log @Sync with HEAD @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.23.2.1 2003/07/02 15:27:08 darrenr Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.23.2.1 2003/07/02 15:27:08 darrenr Exp $"); d97 1 a97 1 struct in_addr *my_ip, struct in_addr *gw_ip, struct lwp *l)); d99 1 a99 1 struct nfs_dlmount *ndm, struct lwp *l)); d183 1 a183 1 error = bp_whoami(sin, &my_ip, &gw_ip, lwp); d195 1 a195 1 error = bp_getfile(sin, "root", &nd->nd_root, lwp); d204 1 a204 1 error = bp_getfile(sin, "gateway", gw_ndm, lwp); d294 1 a294 1 bp_whoami(bpsin, my_ip, gw_ip, l) a297 1 struct lwp *l; d337 1 a337 1 PMAPPROC_CALLIT, &m, &from, l); d401 1 a401 1 bp_getfile(bpsin, key, ndm, l) a404 1 struct lwp *l; d429 1 a429 1 BOOTPARAM_GETFILE, &m, NULL, l); @ 1.23.2.3 log @Sync with HEAD. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.24 2004/05/22 22:52:15 jonathan Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.24 2004/05/22 22:52:15 jonathan Exp $"); d97 1 a97 1 struct in_addr *my_ip, struct in_addr *gw_ip, struct proc *p)); d99 1 a99 1 struct nfs_dlmount *ndm, struct proc *p)); d113 1 a113 1 nfs_bootparam(nd, procp) d115 1 a115 1 struct proc *procp; d131 1 a131 1 error = nfs_boot_ifupdown(ifp, procp, 1); d161 1 a161 1 error = nfs_boot_setaddress(ifp, procp, my_ip.s_addr, d183 1 a183 1 error = bp_whoami(sin, &my_ip, &gw_ip, procp); d195 1 a195 1 error = bp_getfile(sin, "root", &nd->nd_root, procp); d204 1 a204 1 error = bp_getfile(sin, "gateway", gw_ndm, procp); d232 2 a233 2 (void) nfs_boot_deladdress(ifp, procp, my_ip.s_addr); error = nfs_boot_setaddress(ifp, procp, my_ip.s_addr, d263 1 a263 1 (void) nfs_boot_deladdress(ifp, procp, my_ip.s_addr); d266 1 a266 1 (void) nfs_boot_ifupdown(ifp, procp, 0); d294 1 a294 1 bp_whoami(bpsin, my_ip, gw_ip, p) d298 1 a298 1 struct proc *p; d338 1 a338 1 PMAPPROC_CALLIT, &m, &from, p); d402 1 a402 1 bp_getfile(bpsin, key, ndm, p) d406 1 a406 1 struct proc *p; d431 1 a431 1 BOOTPARAM_GETFILE, &m, NULL, p); @ 1.23.2.4 log @Fix the sync with head I botched. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.23.2.2 2004/08/03 10:56:17 skrll Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.23.2.2 2004/08/03 10:56:17 skrll Exp $"); d97 1 a97 1 struct in_addr *my_ip, struct in_addr *gw_ip, struct lwp *l)); d99 1 a99 1 struct nfs_dlmount *ndm, struct lwp *l)); d113 1 a113 1 nfs_bootparam(nd, lwp) d115 1 a115 1 struct lwp *lwp; d131 1 a131 1 error = nfs_boot_ifupdown(ifp, lwp, 1); d161 1 a161 1 error = nfs_boot_setaddress(ifp, lwp, my_ip.s_addr, d183 1 a183 1 error = bp_whoami(sin, &my_ip, &gw_ip, lwp); d195 1 a195 1 error = bp_getfile(sin, "root", &nd->nd_root, lwp); d204 1 a204 1 error = bp_getfile(sin, "gateway", gw_ndm, lwp); d232 2 a233 2 (void) nfs_boot_deladdress(ifp, lwp, my_ip.s_addr); error = nfs_boot_setaddress(ifp, lwp, my_ip.s_addr, d263 1 a263 1 (void) nfs_boot_deladdress(ifp, lwp, my_ip.s_addr); d266 1 a266 1 (void) nfs_boot_ifupdown(ifp, lwp, 0); d294 1 a294 1 bp_whoami(bpsin, my_ip, gw_ip, l) d298 1 a298 1 struct lwp *l; d338 1 a338 1 PMAPPROC_CALLIT, &m, &from, l); d402 1 a402 1 bp_getfile(bpsin, key, ndm, l) d406 1 a406 1 struct lwp *l; d431 1 a431 1 BOOTPARAM_GETFILE, &m, NULL, l); @ 1.23.2.5 log @Sync with HEAD. Here we go again... @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.23.2.4 2004/09/21 13:38:36 skrll Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.23.2.4 2004/09/21 13:38:36 skrll Exp $"); d98 1 a98 1 static int bp_getfile __P((struct sockaddr_in *bpsin, const char *key, d404 1 a404 1 const char *key; d425 1 a425 2 /*XXXUNCONST*/ m->m_next = xdr_string_encode(__UNCONST(key), strlen(key)); @ 1.22 log @Pass lwp pointers throughtout the kernel, as required, so that the lwpid can be inserted into ktrace records. The general change has been to replace "struct proc *" with "struct lwp *" in various function prototypes, pass the lwp through and use l_proc to get the process pointer when needed. Bump the kernel rev up to 1.6V @ text @d113 1 a113 1 nfs_bootparam(nd, lwp) d115 1 a115 1 struct lwp *lwp; d131 1 a131 1 error = nfs_boot_ifupdown(ifp, lwp, 1); d161 1 a161 1 error = nfs_boot_setaddress(ifp, lwp, my_ip.s_addr, d232 2 a233 2 (void) nfs_boot_deladdress(ifp, lwp, my_ip.s_addr); error = nfs_boot_setaddress(ifp, lwp, my_ip.s_addr, d263 1 a263 1 (void) nfs_boot_deladdress(ifp, lwp, my_ip.s_addr); d266 1 a266 1 (void) nfs_boot_ifupdown(ifp, lwp, 0); @ 1.21 log @Add extensible malloc types, adapted from FreeBSD. This turns malloc types into a structure, a pointer to which is passed around, instead of an int constant. Allow the limit to be adjusted when the malloc type is defined, or with a function call, as suggested by Jonathan Stone. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.20 2002/09/22 19:35:22 jdolecek Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.20 2002/09/22 19:35:22 jdolecek Exp $"); d113 1 a113 1 nfs_bootparam(nd, procp) d115 1 a115 1 struct proc *procp; d131 1 a131 1 error = nfs_boot_ifupdown(ifp, procp, 1); d161 1 a161 1 error = nfs_boot_setaddress(ifp, procp, my_ip.s_addr, d232 2 a233 2 (void) nfs_boot_deladdress(ifp, procp, my_ip.s_addr); error = nfs_boot_setaddress(ifp, procp, my_ip.s_addr, d263 1 a263 1 (void) nfs_boot_deladdress(ifp, procp, my_ip.s_addr); d266 1 a266 1 (void) nfs_boot_ifupdown(ifp, procp, 0); @ 1.20 log @ and are not needed here @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.19 2001/11/10 10:59:09 lukem Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.19 2001/11/10 10:59:09 lukem Exp $"); d76 1 @ 1.19 log @add RCSIDs @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.18 2001/10/13 23:25:58 simonb Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD$"); a51 2 #include #include @ 1.18 log @Remove so variables that are only ever set and never referenced. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.17 2000/10/03 17:18:15 chs Exp $ */ d42 3 @ 1.18.2.1 log @Sync the thorpej-mips-cache branch with -current. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.19 2001/11/10 10:59:09 lukem Exp $ */ a41 3 #include __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.19 2001/11/10 10:59:09 lukem Exp $"); @ 1.17 log @include opt_inet.h, needed by previous check-in. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.16 2000/10/02 04:27:57 itojun Exp $ */ d312 1 a312 1 int error, msg_len; a348 1 msg_len = fxdr_unsigned(u_int32_t, reply->encap_len); @ 1.17.4.1 log @Sync kqueue branch with -current. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.19 2001/11/10 10:59:09 lukem Exp $ */ a42 3 #include __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.19 2001/11/10 10:59:09 lukem Exp $"); d312 1 a312 1 int error; d349 1 @ 1.17.4.2 log @sync kqueue with -current; this includes merge of gehenna-devsw branch, merge of i386 MP branch, and part of autoconf rototil work @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.17.4.1 2002/01/10 20:04:21 thorpej Exp $ */ d44 1 a44 1 __KERNEL_RCSID(0, "$NetBSD: nfs_bootparam.c,v 1.17.4.1 2002/01/10 20:04:21 thorpej Exp $"); d52 2 @ 1.17.2.1 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.17 2000/10/03 17:18:15 chs Exp $ */ d312 1 a312 1 int error; d349 1 @ 1.17.2.2 log @Catch up to -current. @ text @d1 1 a1 1 /* $NetBSD$ */ a41 3 #include __KERNEL_RCSID(0, "$NetBSD$"); @ 1.17.2.3 log @Catch up to -current. @ text @d52 2 @ 1.16 log @perform reverse ARP only if INET is compiled into the kernel @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.15 1999/07/26 02:16:35 enami Exp $ */ d44 1 @ 1.15 log @Don't use the result of inet_ntoa after calling the another inet_ntoa, since they share the same static storage. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.14 1999/05/07 15:17:26 drochner Exp $ */ d135 1 d143 1 @ 1.15.2.1 log @Update thorpej_scsipi to -current as of a month ago @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.17 2000/10/03 17:18:15 chs Exp $ */ a43 1 #include "opt_inet.h" a134 1 #ifdef INET a141 1 #endif @ 1.14 log @-print diskless boot related IP addresses in dot notation -arrange gateway code to fall back to the old method if the new "getfile" is not answered (and both are enabled -- allow to switch off the new method for symmetry) -handle error if setting the netmask fails @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.13 1999/04/12 01:05:01 ross Exp $ */ d149 2 a150 2 printf("nfs_boot: client_addr=%s (RARP from %s)\n", inet_ntoa(my_ip), inet_ntoa(arps_ip)); @ 1.13 log @libkern just got an inet_addr(), but it won't compile, no prototype. Cleanup... * Add prototype to libkern.h. * Remove the almost-identical-copy from libsa/net.[ch]. * Change its type back to the (wrong, but harmless) historical one. (u_long) * Kill the XXX local prototype in nfs_bootparam.c @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.12 1999/04/11 22:15:25 gwr Exp $ */ d118 1 d122 1 d149 2 a150 3 printf("nfs_boot: client_addr=0x%x (RARP from 0x%x)\n", (u_int32_t)ntohl(my_ip.s_addr), (u_int32_t)ntohl(arps_ip.s_addr)); d183 1 a183 2 printf("nfs_boot: server_addr=0x%x\n", (u_int32_t)ntohl(sin->sin_addr.s_addr)); d196 1 a196 18 #ifdef NFS_BOOT_GATEWAY /* * Note: we normally ignore the gateway address returned * by the "bootparam/whoami" RPC above, because many old * bootparam servers supply a bogus gateway value. * * These deficiencies in the bootparam RPC interface are * circumvented by using the bootparam/getfile RPC. The * parameter "gateway" is requested, and if its returned, * we use the "server" part of the reply as the gateway, * and use the "pathname" part of the reply as the mask. * (The mask comes to us as a string.) */ if (gw_ip.s_addr) { /* Our caller will add the route. */ nd->nd_gwip = gw_ip; } #endif d201 1 a201 1 /* Ignore the error. No gateway supplied. */ d203 1 a203 1 goto out; d207 1 a207 1 goto out; /* no gateway */ d210 1 a210 2 printf("nfs_boot: gateway=0x%x\n", (u_int32_t)ntohl(sin->sin_addr.s_addr)); a224 2 printf("nfs_boot: my_mask=0x%x\n", (u_int32_t)ntohl(mask)); d226 1 d232 1 a232 1 error = 0; /* ignore it */ d234 21 d264 2 d268 1 a478 2 @ 1.12 log @Enable the code that gets our gateway+netmask from the bootparam server using the "gateway" pseudo file. (Compatible with sys/lib/libsa/dev_net.c) @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.11 1999/02/21 15:07:49 drochner Exp $ */ a113 1 extern u_int32_t inet_addr __P((char *)); /* XXX libkern */ @ 1.11 log @restructure the diskless NFS boot code to keep track of the used interface and the address allocated, to roll everything back if the mount fails: -put an interface pointer into "struct nfs_diskless" to have it available for cleanup, don't pass it around anymore where the "struct nfs_diskless" is already passed -add a "cleanup" function which shuts the interface down -in the protocol-specific parts, either return with "everything ready" or "completely shut down" -use common functions for interface initialization and shutdown -add a function to delete all routes associate to an interface (why is this necessary and not done by ~IFF_UP?) g/c diskless swap stuff general cleanup @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.10 1998/09/13 13:49:29 christos Exp $ */ d114 1 a118 1 #if 0 /* XXX - not yet */ a121 1 #endif /* XXX */ d133 1 a133 1 error = EADDRNOTAVAIL; /* ??? */ a139 4 if (error) { printf("revarp failed, error=%d\n", error); goto out; } d142 4 a214 1 #if 0 /* XXX - not yet */ a222 1 printf("nfs_boot: gateway=%s\n", gw_ndm->ndm_host); d224 7 d232 2 a233 1 /* Find the pathname part of the "mounted-on" string. */ d236 1 a236 1 goto out; d240 2 a241 4 if (mask == 0) { printf("nfs_boot: gateway netmask missing\n"); goto out; } d243 3 a245 1 /* Save our netmask and update the network interface. */ d247 3 a249 5 sin = (struct sockaddr_in *)&ireq.ifr_addr; sin->sin_len = sizeof(*sin); sin->sin_family = AF_INET; sin->sin_addr = nd->nd_mask; error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)&ireq, procp); a253 3 if (gw_ndm) free(gw_ndm, M_NFSMNT); #endif /* XXX */ d263 2 @ 1.11.4.1 log @Sync w/ -current. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.14 1999/05/07 15:17:26 drochner Exp $ */ d118 1 a118 1 #ifndef NFS_BOOTPARAM_NOGATEWAY d122 1 a122 1 #endif d134 1 a134 1 error = EADDRNOTAVAIL; d141 4 a146 4 if (error) { printf("revarp failed, error=%d\n", error); goto out; } d149 3 a151 2 printf("nfs_boot: client_addr=%s (RARP from %s)\n", inet_ntoa(my_ip), inet_ntoa(arps_ip)); d184 2 a185 1 printf("nfs_boot: server_addr=%s\n", inet_ntoa(sin->sin_addr)); d198 19 a216 1 #ifndef NFS_BOOTPARAM_NOGATEWAY d221 1 a221 1 /* No gateway supplied. No error, but try fallback. */ d223 1 a223 1 goto nogwrepl; d225 1 a226 6 if (sin->sin_addr.s_addr == 0) goto out; /* no gateway */ /* OK, we have a gateway! */ printf("nfs_boot: gateway=%s\n", inet_ntoa(sin->sin_addr)); /* Just save it. Caller adds the route. */ d228 1 a228 2 /* Look for a mask string after the colon. */ d231 1 a231 1 goto out; /* no netmask */ d235 4 a238 2 if (mask == 0) goto out; /* no netmask */ d240 1 a240 1 /* Have a netmask too! Save it; update the I/F. */ d242 5 a246 4 printf("nfs_boot: my_mask=%s\n", inet_ntoa(nd->nd_mask)); (void) nfs_boot_deladdress(ifp, procp, my_ip.s_addr); error = nfs_boot_setaddress(ifp, procp, my_ip.s_addr, mask, INADDR_ANY); d249 1 a249 1 goto out; d251 3 a253 21 goto gwok; nogwrepl: #endif #ifdef NFS_BOOT_GATEWAY /* * Note: we normally ignore the gateway address returned * by the "bootparam/whoami" RPC above, because many old * bootparam servers supply a bogus gateway value. * * These deficiencies in the bootparam RPC interface are * circumvented by using the bootparam/getfile RPC. The * parameter "gateway" is requested, and if its returned, * we use the "server" part of the reply as the gateway, * and use the "pathname" part of the reply as the mask. * (The mask comes to us as a string.) */ if (gw_ip.s_addr) { /* Our caller will add the route. */ nd->nd_gwip = gw_ip; } #endif a262 5 #ifndef NFS_BOOTPARAM_NOGATEWAY gwok: if (gw_ndm) free(gw_ndm, M_NFSMNT); #endif d473 2 @ 1.11.4.2 log @Update from trunk. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.11.4.1 1999/06/21 01:28:55 thorpej Exp $ */ d149 2 a150 2 printf("nfs_boot: client_addr=%s", inet_ntoa(my_ip)); printf(" (RARP from %s)\n", inet_ntoa(arps_ip)); @ 1.10 log @Fix copyright spacing. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.9 1998/08/09 21:19:50 perry Exp $ */ d110 1 a110 2 nfs_bootparam(ifp, nd, procp) struct ifnet *ifp; d114 2 a115 2 struct ifreq ireq; struct in_addr my_ip, gw_ip; a117 2 struct socket *so; struct nfs_dlmount *gw_ndm; d119 1 a124 14 gw_ndm = 0; memset(&ireq, 0, sizeof(ireq)); memcpy(ireq.ifr_name, ifp->if_xname, IFNAMSIZ); /* * Get a socket to use for various things in here. * After this, use "goto out" to cleanup and return. */ error = socreate(AF_INET, &so, SOCK_DGRAM, 0); if (error) { printf("nfs_boot: socreate, error=%d\n", error); return (error); } a126 2 * Get the old interface flags and or IFF_UP into them so * things like media selection flags are not clobbered. d128 1 a128 7 error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)&ireq, procp); if (error) { printf("nfs_boot: GIFFLAGS, error=%d\n", error); goto out; } ireq.ifr_flags |= IFF_UP; error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)&ireq, procp); d131 1 a131 1 goto out; d140 1 a140 1 error = revarpwhoami(&my_ip, ifp); d149 3 a151 2 printf("nfs_boot: client_addr=0x%x\n", (u_int32_t)ntohl(my_ip.s_addr)); d157 2 a158 5 sin = (struct sockaddr_in *)&ireq.ifr_addr; sin->sin_len = sizeof(*sin); sin->sin_family = AF_INET; sin->sin_addr = my_ip; error = ifioctl(so, SIOCSIFADDR, (caddr_t)&ireq, procp); d182 1 a182 1 goto out; d195 1 a195 1 goto out; a196 7 #if 0 error = bp_getfile(sin, "swap", &nd->nd_swap); if (error) { printf("nfs_boot: bootparam get swap: %d\n", error); error = 0; } #endif d251 2 d255 8 a262 4 out: if (gw_ndm) free(gw_ndm, M_NFSMNT); soclose(so); @ 1.9 log @bzero->memset, bcopy->memcpy, bcmp->memcmp @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.8 1998/06/13 04:33:40 tv Exp $ */ d20 2 a21 2 * This product includes software developed by the NetBSD * Foundation, Inc. and its contributors. @ 1.8 log @Fix boogered gcc warning workaround the right way. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.7 1998/03/01 17:37:32 veego Exp $ */ d128 2 a129 2 bzero(&ireq, sizeof(ireq)); bcopy(ifp->if_xname, ireq.ifr_name, IFNAMSIZ); d199 1 a199 1 bzero((caddr_t)sin, sizeof(*sin)); d251 1 a251 1 bzero((caddr_t)gw_ndm, sizeof(*gw_ndm)); d477 1 a477 1 bzero((caddr_t)sin, sizeof(*sin)); d487 1 a487 1 bcopy(pathname, ndm->ndm_host + sn_len + 1, path_len + 1); @ 1.7 log @Add two includes for the 'struct nfs_args' so it compiles again. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.6 1998/01/12 21:27:15 scottr Exp $ */ d165 4 a168 3 if (!error) goto ok; printf("revarp failed, error=%d\n", error); a170 2 if (0) goto ok; /* XXX stupid gcc */ goto out; a171 1 ok: @ 1.6 log @Consolidate NFS_BOOT_* options into opt_nfs_boot.h @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.5 1998/01/09 15:16:55 drochner Exp $ */ d71 2 @ 1.5 log @Conditionalize call to RARP, check interface type. (This file can now be included even if no ARP capable interfaces are defined.) @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.4 1997/12/12 21:09:49 gwr Exp $ */ d42 2 @ 1.4 log @Temporarily disable the bootparam "gateway" support. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.3 1997/12/10 20:22:37 gwr Exp $ */ d57 1 d71 2 d154 9 a162 5 /* * Do RARP for the interface address. */ error = revarpwhoami(&my_ip, ifp); if (error) { a163 1 goto out; d165 5 @ 1.3 log @Change the format of the bootparam "gateway" parameter string to gateway=server:255.255.255.0 because that is the perferred format, and the sys/libsa code already knows how to parse that format. (Copied ip_convert here from the libsa code.) @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.2 1997/09/09 21:36:35 gwr Exp $ */ a90 4 /* helpers... */ static char * number __P((char *s, int *n)); static u_int32_t ip_convertaddr __P((char *)); d114 1 d117 1 d229 1 a229 1 * (The mask comes to us as a string: "%d.%d.%d.%d") d236 1 d254 3 a256 2 mask = ip_convertaddr(p); if (mask == 0) d258 1 d271 1 a488 40 /* helpers... */ static char * number(s, n) char *s; int *n; { for (*n = 0; ((*s) >= '0' && (*s) <= '9'); s++) *n = (*n * 10) + *s - '0'; return s; } static u_int32_t ip_convertaddr(p) char *p; { u_int32_t addr = 0, n; if (p == (char *)0 || *p == '\0') return 0; p = number(p, &n); addr |= (n << 24) & 0xff000000; if (*p == '\0' || *p++ != '.') return 0; p = number(p, &n); addr |= (n << 16) & 0xff0000; if (*p == '\0' || *p++ != '.') return 0; p = number(p, &n); addr |= (n << 8) & 0xff00; if (*p == '\0' || *p++ != '.') return 0; p = number(p, &n); addr |= n & 0xff; if (*p != '\0') return 0; return htonl(addr); } @ 1.2 log @Circumvent the lack of a reliable gateway/netmask value in the Sun RPC bootparam/whoami return by requesting a "pseudo file" named "gateway" and using its contents as the gateway:netmask Example /etc/bootparams line: client gateway=router:0xfffffff0 @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.1 1997/08/29 16:07:46 gwr Exp $ */ d91 4 d119 1 a119 1 u_int32_t mask, x; d231 1 a231 1 * (The mask comes to us as a string: "0x%x") d254 2 a255 23 /* XXX - Inline: sscanf(p, ":0x%x", &mask) */ mask = 0; while (*p) { switch (*p) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': x = (*p - '0'); break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': x = (*p - ('A' - 10)); break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': x = (*p - ('a' - 10)); break; default: mask = x = 0; break; } mask = (mask << 4) + x; p++; } d260 1 a260 1 nd->nd_mask.s_addr = htonl(mask); d487 40 @ 1.2.2.1 log @Pull rev 1.3 and 1.4 up from trunk (gwr) @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.4 1997/12/12 21:09:49 gwr Exp $ */ a113 1 #if 0 /* XXX - not yet */ d115 1 a115 2 u_int32_t mask; #endif /* XXX */ d227 1 a227 1 * (The mask comes to us as a string.) a233 1 #if 0 /* XXX - not yet */ d250 24 a273 4 p++; /* skip ':' */ mask = inet_addr(p); /* libkern */ if (mask == 0) { printf("nfs_boot: gateway netmask missing\n"); a274 1 } d277 1 a277 1 nd->nd_mask.s_addr = mask; a286 1 #endif /* XXX */ @ 1.1 log @Support for RARP,RPC/bootparam moved from nfs_boot.c to here. @ text @d1 1 a1 1 /* $NetBSD$ */ d109 1 d113 3 a115 1 struct in_addr my_ip; d118 1 d168 1 a168 1 sin->sin_addr.s_addr = my_ip.s_addr; d190 1 a190 1 error = bp_whoami(sin, &my_ip, &nd->nd_gwip); d216 1 d218 10 a227 3 * XXX - Use bp_getfile(sin, "gate", &gw_ip) * to get the [router:mask] information, maybe? * Better still, just use BOOTP/DHCP instead. d229 58 d289 2 @ 1.1.2.1 log @file nfs_bootparam.c was added on branch marc-pcmcia on 1997-09-01 21:02:56 +0000 @ text @d1 431 @ 1.1.2.2 log @Update marc-pcmcia branch from trunk. @ text @a0 431 /* $NetBSD: nfs_bootparam.c,v 1.1.2.1 1997/09/01 21:02:56 thorpej Exp $ */ /*- * Copyright (c) 1995, 1997 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by Adam Glass and Gordon W. Ross. * * 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 NetBSD * Foundation, Inc. and its contributors. * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. */ /* * Support for NFS diskless booting, Sun-style (RPC/bootparams) */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* * There are two implementations of NFS diskless boot. * This implementation uses Sun RPC/bootparams, and the * the other uses BOOTP (RFC951 - see nfs_bootdhcp.c). * * The Sun-style boot sequence goes as follows: * (1) Use RARP to get our interface address * (2) Use RPC/bootparam/whoami to get our hostname, * our IP address, and the server's IP address. * (3) Use RPC/bootparam/getfile to get the root path * (4) Use RPC/mountd to get the root file handle * (5) Use RPC/bootparam/getfile to get the swap path * (6) Use RPC/mountd to get the swap file handle */ /* bootparam RPC */ static int bp_whoami __P((struct sockaddr_in *bpsin, struct in_addr *my_ip, struct in_addr *gw_ip)); static int bp_getfile __P((struct sockaddr_in *bpsin, char *key, struct nfs_dlmount *ndm)); /* * Get client name, gateway address, then * get root and swap server:pathname info. * RPCs: bootparam/whoami, bootparam/getfile * * Use the old broadcast address for the WHOAMI * call because we do not yet know our netmask. * The server address returned by the WHOAMI call * is used for all subsequent booptaram RPCs. */ int nfs_bootparam(ifp, nd, procp) struct ifnet *ifp; struct nfs_diskless *nd; struct proc *procp; { struct ifreq ireq; struct sockaddr_in bp_sin; struct sockaddr_in *sin; struct socket *so; struct in_addr my_ip; int error; bzero(&ireq, sizeof(ireq)); bcopy(ifp->if_xname, ireq.ifr_name, IFNAMSIZ); /* * Get a socket to use for various things in here. * After this, use "goto out" to cleanup and return. */ error = socreate(AF_INET, &so, SOCK_DGRAM, 0); if (error) { printf("nfs_boot: socreate, error=%d\n", error); return (error); } /* * Bring up the interface. (just set the "up" flag) * Get the old interface flags and or IFF_UP into them so * things like media selection flags are not clobbered. */ error = ifioctl(so, SIOCGIFFLAGS, (caddr_t)&ireq, procp); if (error) { printf("nfs_boot: GIFFLAGS, error=%d\n", error); goto out; } ireq.ifr_flags |= IFF_UP; error = ifioctl(so, SIOCSIFFLAGS, (caddr_t)&ireq, procp); if (error) { printf("nfs_boot: SIFFLAGS, error=%d\n", error); goto out; } /* * Do RARP for the interface address. */ error = revarpwhoami(&my_ip, ifp); if (error) { printf("revarp failed, error=%d\n", error); goto out; } nd->nd_myip.s_addr = my_ip.s_addr; printf("nfs_boot: client_addr=0x%x\n", (u_int32_t)ntohl(my_ip.s_addr)); /* * Do enough of ifconfig(8) so that the chosen interface * can talk to the servers. (just set the address) */ sin = (struct sockaddr_in *)&ireq.ifr_addr; sin->sin_len = sizeof(*sin); sin->sin_family = AF_INET; sin->sin_addr.s_addr = my_ip.s_addr; error = ifioctl(so, SIOCSIFADDR, (caddr_t)&ireq, procp); if (error) { printf("nfs_boot: set ifaddr, error=%d\n", error); goto out; } /* * Get client name and gateway address. * RPC: bootparam/whoami * Use the old broadcast address for the WHOAMI * call because we do not yet know our netmask. * The server address returned by the WHOAMI call * is used for all subsequent booptaram RPCs. */ sin = &bp_sin; bzero((caddr_t)sin, sizeof(*sin)); sin->sin_len = sizeof(*sin); sin->sin_family = AF_INET; sin->sin_addr.s_addr = INADDR_BROADCAST; /* Do the RPC/bootparam/whoami. */ error = bp_whoami(sin, &my_ip, &nd->nd_gwip); if (error) { printf("nfs_boot: bootparam whoami, error=%d\n", error); goto out; } printf("nfs_boot: server_addr=0x%x\n", (u_int32_t)ntohl(sin->sin_addr.s_addr)); printf("nfs_boot: hostname=%s\n", hostname); /* * Now fetch the server:pathname strings and server IP * for root and swap. Missing swap is not fatal. */ error = bp_getfile(sin, "root", &nd->nd_root); if (error) { printf("nfs_boot: bootparam get root: %d\n", error); goto out; } #if 0 error = bp_getfile(sin, "swap", &nd->nd_swap); if (error) { printf("nfs_boot: bootparam get swap: %d\n", error); error = 0; } #endif /* * XXX - Use bp_getfile(sin, "gate", &gw_ip) * to get the [router:mask] information, maybe? * Better still, just use BOOTP/DHCP instead. */ out: soclose(so); return (error); } /* * RPC: bootparam/whoami * Given client IP address, get: * client name (hostname) * domain name (domainname) * gateway address * * The hostname and domainname are set here for convenience. * * Note - bpsin is initialized to the broadcast address, * and will be replaced with the bootparam server address * after this call is complete. Have to use PMAP_PROC_CALL * to make sure we get responses only from a servers that * know about us (don't want to broadcast a getport call). */ static int bp_whoami(bpsin, my_ip, gw_ip) struct sockaddr_in *bpsin; struct in_addr *my_ip; struct in_addr *gw_ip; { /* RPC structures for PMAPPROC_CALLIT */ struct whoami_call { u_int32_t call_prog; u_int32_t call_vers; u_int32_t call_proc; u_int32_t call_arglen; } *call; struct callit_reply { u_int32_t port; u_int32_t encap_len; /* encapsulated data here */ } *reply; struct mbuf *m, *from; struct sockaddr_in *sin; int error, msg_len; int16_t port; /* * Build request message for PMAPPROC_CALLIT. */ m = m_get(M_WAIT, MT_DATA); call = mtod(m, struct whoami_call *); m->m_len = sizeof(*call); call->call_prog = txdr_unsigned(BOOTPARAM_PROG); call->call_vers = txdr_unsigned(BOOTPARAM_VERS); call->call_proc = txdr_unsigned(BOOTPARAM_WHOAMI); /* * append encapsulated data (client IP address) */ m->m_next = xdr_inaddr_encode(my_ip); call->call_arglen = txdr_unsigned(m->m_next->m_len); /* RPC: portmap/callit */ bpsin->sin_port = htons(PMAPPORT); from = NULL; error = krpc_call(bpsin, PMAPPROG, PMAPVERS, PMAPPROC_CALLIT, &m, &from); if (error) return error; /* * Parse result message. */ if (m->m_len < sizeof(*reply)) { m = m_pullup(m, sizeof(*reply)); if (m == NULL) goto bad; } reply = mtod(m, struct callit_reply *); port = fxdr_unsigned(u_int32_t, reply->port); msg_len = fxdr_unsigned(u_int32_t, reply->encap_len); m_adj(m, sizeof(*reply)); /* * Save bootparam server address */ sin = mtod(from, struct sockaddr_in *); bpsin->sin_port = htons(port); bpsin->sin_addr.s_addr = sin->sin_addr.s_addr; /* client name */ hostnamelen = MAXHOSTNAMELEN-1; m = xdr_string_decode(m, hostname, &hostnamelen); if (m == NULL) goto bad; /* domain name */ domainnamelen = MAXHOSTNAMELEN-1; m = xdr_string_decode(m, domainname, &domainnamelen); if (m == NULL) goto bad; /* gateway address */ m = xdr_inaddr_decode(m, gw_ip); if (m == NULL) goto bad; /* success */ goto out; bad: printf("nfs_boot: bootparam_whoami: bad reply\n"); error = EBADRPC; out: if (from) m_freem(from); if (m) m_freem(m); return(error); } /* * RPC: bootparam/getfile * Given client name and file "key", get: * server name * server IP address * server pathname */ static int bp_getfile(bpsin, key, ndm) struct sockaddr_in *bpsin; char *key; struct nfs_dlmount *ndm; { char pathname[MNAMELEN]; struct in_addr inaddr; struct sockaddr_in *sin; struct mbuf *m; char *serv_name; int error, sn_len, path_len; /* * Build request message. */ /* client name (hostname) */ m = xdr_string_encode(hostname, hostnamelen); if (m == NULL) return (ENOMEM); /* key name (root or swap) */ m->m_next = xdr_string_encode(key, strlen(key)); if (m->m_next == NULL) return (ENOMEM); /* RPC: bootparam/getfile */ error = krpc_call(bpsin, BOOTPARAM_PROG, BOOTPARAM_VERS, BOOTPARAM_GETFILE, &m, NULL); if (error) return error; /* * Parse result message. */ /* server name */ serv_name = &ndm->ndm_host[0]; sn_len = sizeof(ndm->ndm_host) - 1; m = xdr_string_decode(m, serv_name, &sn_len); if (m == NULL) goto bad; /* server IP address (mountd/NFS) */ m = xdr_inaddr_decode(m, &inaddr); if (m == NULL) goto bad; /* server pathname */ path_len = sizeof(pathname) - 1; m = xdr_string_decode(m, pathname, &path_len); if (m == NULL) goto bad; /* * Store the results in the nfs_dlmount. * The strings become "server:pathname" */ sin = (struct sockaddr_in *) &ndm->ndm_saddr; bzero((caddr_t)sin, sizeof(*sin)); sin->sin_len = sizeof(*sin); sin->sin_family = AF_INET; sin->sin_addr = inaddr; if ((sn_len + 1 + path_len + 1) > sizeof(ndm->ndm_host)) { printf("nfs_boot: getfile name too long\n"); error = EIO; goto out; } ndm->ndm_host[sn_len] = ':'; bcopy(pathname, ndm->ndm_host + sn_len + 1, path_len + 1); /* success */ goto out; bad: printf("nfs_boot: bootparam_getfile: bad reply\n"); error = EBADRPC; out: m_freem(m); return(0); } @ 1.1.2.3 log @Update marc-pcmcia branch from trunk. @ text @d1 1 a1 1 /* $NetBSD: nfs_bootparam.c,v 1.1.2.2 1997/09/16 03:51:24 thorpej Exp $ */ a108 1 struct in_addr my_ip, gw_ip; d112 1 a112 3 struct nfs_dlmount *gw_ndm; char *p; u_int32_t mask, x; a114 1 gw_ndm = 0; d164 1 a164 1 sin->sin_addr = my_ip; d186 1 a186 1 error = bp_whoami(sin, &my_ip, &gw_ip); a211 1 #ifdef NFS_BOOT_GATEWAY d213 4 a216 69 * Note: we normally ignore the gateway address returned * by the "bootparam/whoami" RPC above, because many old * bootparam servers supply a bogus gateway value. * * These deficiencies in the bootparam RPC interface are * circumvented by using the bootparam/getfile RPC. The * parameter "gateway" is requested, and if its returned, * we use the "server" part of the reply as the gateway, * and use the "pathname" part of the reply as the mask. * (The mask comes to us as a string: "0x%x") */ if (gw_ip.s_addr) { /* Our caller will add the route. */ nd->nd_gwip = gw_ip; } #endif gw_ndm = malloc(sizeof(*gw_ndm), M_NFSMNT, M_WAITOK); bzero((caddr_t)gw_ndm, sizeof(*gw_ndm)); error = bp_getfile(sin, "gateway", gw_ndm); if (error) { /* Ignore the error. No gateway supplied. */ error = 0; goto out; } printf("nfs_boot: gateway=%s\n", gw_ndm->ndm_host); sin = (struct sockaddr_in *) &gw_ndm->ndm_saddr; nd->nd_gwip = sin->sin_addr; /* Find the pathname part of the "mounted-on" string. */ p = strchr(gw_ndm->ndm_host, ':'); if (p == 0) goto out; /* have pathname */ /* XXX - Inline: sscanf(p, ":0x%x", &mask) */ mask = 0; while (*p) { switch (*p) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': x = (*p - '0'); break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': x = (*p - ('A' - 10)); break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': x = (*p - ('a' - 10)); break; default: mask = x = 0; break; } mask = (mask << 4) + x; p++; } if (mask == 0) goto out; /* Save our netmask and update the network interface. */ nd->nd_mask.s_addr = htonl(mask); sin = (struct sockaddr_in *)&ireq.ifr_addr; sin->sin_len = sizeof(*sin); sin->sin_family = AF_INET; sin->sin_addr = nd->nd_mask; error = ifioctl(so, SIOCSIFNETMASK, (caddr_t)&ireq, procp); if (error) { printf("nfs_boot: set ifmask, error=%d\n", error); error = 0; /* ignore it */ } a218 2 if (gw_ndm) free(gw_ndm, M_NFSMNT); @