a format error in pf_print_host()

JINMEI Tatuya / 神明達哉 jinmei at isl.rdc.toshiba.co.jp
Tue Nov 20 06:17:45 PST 2007


(This should probably be reported to an OpenBSD forum, but I'm not
subscribing to any of the lists, so I'm posting this to freebsd-net.
I believe pf maintainers watch this list, too...)

I've found a minor error in pf_print_host() which is revealed for some
time of IPv6 addresses.  This routine always (perhaps unintentionally)
assumes abbreviate-able consecutive zero's, so, for example, it
formats "1:2:3:4:5:6:7:8" as ":2:3:4:5:6:7:8".  This can be confirmed
by the sample code attached to this message by
- saving the file as e.g. "foo.c"
- cc -o foo foo.c
- ./foo 1:2:3:4:5:6:7:8

I've also attached a proposed patch to this problem.  The diff was
made against 6-STABLE, but it's probably applicable to other versions.

					JINMEI, Tatuya
					Communication Platform Lab.
					Corporate R&D Center, Toshiba Corp.
					jinmei at isl.rdc.toshiba.co.jp


More information about the freebsd-net mailing list