def METHOD_NAME(self, p):
    # type: (bytes) -> bytes
    udp = self.underlayer
    if udp is None or not isinstance(udp, UDP):
        warning("Expecting UDP underlayer to compute checksum. Got %s.",
                udp and udp.name)
        return self.pack_icrc(0)
    ip = udp.underlayer
    if isinstance(ip, IP):
        # pseudo-LRH / IP / UDP / BTH / payload
        pshdr = Raw(b'\xff' * 8) / ip.copy()
        pshdr.chksum = 0xffff
        pshdr.ttl = 0xff
        pshdr.tos = 0xff
        pshdr[UDP].chksum = 0xffff
        pshdr[BTH].fecn = 1
        pshdr[BTH].becn = 1
        pshdr[BTH].resv6 = 0xff
        bth = pshdr[BTH].self_build()
        payload = raw(pshdr[BTH].payload)
        # add ICRC placeholder just to get the right IP.totlen and
        # UDP.length
        icrc_placeholder = b'\xff\xff\xff\xff'
        pshdr[UDP].payload = Raw(bth + payload + icrc_placeholder)
        icrc = crc32(raw(pshdr)[:-4]) & 0xffffffff
        return self.pack_icrc(icrc)
    else:
        # TODO support IPv6
        warning("The underlayer protocol %s is not supported.",
                ip and ip.name)
        return self.pack_icrc(0)