Move init of the WPACKET into write_state_machine()