Fixed wrong reading of Port number

The fromDatagram method incorrectly extracted the port number from the
datagram, as a couple of masks were missing