On Mon, May 18, 2020 at 10:16:27AM -0600, Theo de Raadt wrote: > I suspect there are other inconsistancies in all these versions. > > ./sys/arch/arm/arm/in_cksum_arm.S > ./sys/arch/i386/i386/in_cksum.s > ./sys/arch/sparc64/sparc64/in_cksum.S > ./sys/arch/sh/sh/in_cksum.S
These are assembly and for the kernel, uses mbufs. > ./sys/arch/alpha/alpha/in_cksum.c Has quite a bit of magic. > ./sys/arch/hppa/hppa/in_cksum.c Uses assembly in macros. > ./sys/arch/m88k/m88k/in_cksum.c Similar to hppa, but less obscure > ./sys/arch/powerpc/powerpc/in_cksum.c Plenty of powerpc assembly. > ./sys/netinet/in_cksum.c The default for the kernel. > ./usr.sbin/dvmrpd/in_cksum.c > ./usr.sbin/ospfd/in_cksum.c Finally some userland tools, so no mbufs. These are the same files, apart from dvmrpd.h/ospfd.h include. > ./usr.sbin/eigrpd/in_cksum.c This one uses unsigned char instead of u_char, but is otherwise the same as dvmrpd/ospfd. > ./usr.sbin/tcpdump/in_cksum.c Similar but has different requirements. > ./sys/lib/libsa/in_cksum.c Bootloader, no mbufs. Code best taken from one of the userland tools. ospfd is still the best bet.
