| 740 | return bytes(s), val |
| 741 | |
| 742 | def addfield(self, pkt, s, val): |
| 743 | # type: (Packet, bytes, Optional[int]) -> bytes |
| 744 | previous_post_build = pkt.post_build |
| 745 | value = self.fld.addfield(pkt, b"", val) |
| 746 | |
| 747 | def _post_build(self, p, pay): |
| 748 | # type: (Packet, bytes, bytes) -> bytes |
| 749 | pay += value |
| 750 | self.post_build = previous_post_build # type: ignore |
| 751 | return previous_post_build(p, pay) |
| 752 | pkt.post_build = MethodType(_post_build, pkt) # type: ignore |
| 753 | return s |
| 754 | |
| 755 | |
| 756 | class FCSField(TrailerField): |