The logic here looks much more complex than it seems like it needs to be. `routes` is always a two-element Hash.

Can this block be replaced with this?
```ruby
first_route_item = [shost, 0, sport, 0, 0].pack("A*CA*cc")
route_data =  [first_route_item.length, first_route_item].pack("NA*")
route_data << [host, 0, port, 0, 0].pack("A*CA*cc")
```