Changes since v1: * credit Pablo and Jamal * incorporate suggestion from David Ahern * fix compilation in decnet