Master merge and fixes

The master branch have been updated from Juniper/master and merged to Semihalf/Freebsd.

This commit contains both: the changes that appeared in that merge and changes required for the code to compile and vrouter to run (after merge rendered it uncompilable,)