Check if the current settings conform to the LISP specifications and
        fix them where possible.

def sanitize(self):
        '''
        Check if the current settings conform to the LISP specifications and
        fix them where possible.
        '''
        # We override the MapRegisterMessage sa
        super(InfoMessage, self).sanitize()

        # R: R bit indicates this is a reply to an Info-Request (Info-
        # Reply).  R bit is set to 0 in an Info-Request.  When R bit is set
        # to 0, the AFI field (following the EID-prefix field) must be set
        # to 0.  When R bit is set to 1, the packet contents follow the
        # format for an Info-Reply as described below.
        if not isinstance(self.is_reply, bool):
            raise ValueError('Is-reply flag must be a boolean')

        # Nonce: An 8-byte random value created by the sender of the Info-
        # Request.  This nonce will be returned in the Info-Reply.  The
        # nonce SHOULD be generated by a properly seeded pseudo-random (or
        # strong random) source.
        if len(bytes(self.nonce)) != 8:
            raise ValueError('Invalid nonce')

        # Key ID:  A configured ID to find the configured Message
        # Authentication Code (MAC) algorithm and key value used for the
        # authentication function.  See Section 14.4 for codepoint
        # assignments.
        if self.key_id not in (KEY_ID_NONE, KEY_ID_HMAC_SHA_1_96,
                               KEY_ID_HMAC_SHA_256_128):
            raise ValueError('Invalid Key ID')

        # Authentication Data:  The message digest used from the output of the
        # Message Authentication Code (MAC) algorithm.  The entire Map-
        # Register payload is authenticated with this field preset to 0.
        # After the MAC is computed, it is placed in this field.
        # Implementations of this specification MUST include support for
        # HMAC-SHA-1-96 [RFC2404] and support for HMAC-SHA-256-128 [RFC6234]
        # is RECOMMENDED.
        if not isinstance(self.authentication_data, bytes):
            raise ValueError('Invalid authentication data')

        # TTL: The time in minutes the recipient of the Info-Reply will
        # store the RTR Information.
        if not isinstance(self.ttl, numbers.Integral) \
        or self.ttl < 0 or self.ttl > 0xffffffff:
            raise ValueError('Invalid TTL')

        # EID-prefix:  4 octets if an IPv4 address-family, 16 octets if an IPv6
        # address-family.
        if not isinstance(self.eid_prefix, (IPv4Network, IPv6Network)):
            raise ValueError('EID prefix must be IPv4 or IPv6')

        # When a Map-Server receives an Info-Request message, it responds with
        # an Info-Reply message.  The Info-Reply message source port is 4342,
        # and destination port is taken from the source port of the triggering
        # Info-Request.  Map-Server fills the NAT LCAF (LCAF Type = 7) fields
        # according to their description.  The Map-Server uses AFI=0 for the
        # Private ETR RLOC Address field in the NAT LCAF.
        if self.is_reply:
            if not isinstance(self.reply, LCAFNATTraversalAddress):
                raise ValueError("An InfoMessage which is an Info-Reply must contain an LCAFNATTraversalAddress")
        else:
            if self.reply is not None:
                raise ValueError("An InfoMessage which is an Info-Request can not contain a reply")