fix max_gid definition for last packet