in cleanup move ip6/ip variable declarations into scope of usage