def addfield(self, pkt, s, val):
        val = self.i2m(pkt, val)
        if type(s) is tuple:
            s,bitsdone,v = s
        else:
            bitsdone = 0
            v = 0
        if self.rev:
            val = self.reverse(val)
        v <<= self.size
        v |= val & ((1<<self.size) - 1)
        bitsdone += self.size
        while bitsdone >= 8:
            bitsdone -= 8
            s = s+struct.pack("!B", v >> bitsdone)
            v &= 1-(1<<bitsdone)
        if bitsdone:
            return s,bitsdone,v
        else:
            return s
dataset/ETHPy150Open phaethon/scapy/scapy/fields.py/BitField.addfield/swapped operands of `-`