Do the partial merge of WL#5602 correctly:
Sergei Golubchik authored
  Remove unused code (that should not have been merged)
  Add protocol extension (that should have been merged)
  Fix bugs (see pack.c)
bec1d903