backport shaper.inc commit from master to RELENG_2_1