prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  L2TP post_build is broken
  ### Brief description
  
  l2tp.py post_build is supposed to update the length. However, it only does this if current length is None, and the length field is initialized to 0, not None, resulting in the length never being updated. 
  
  ### Scapy version
  
  2.4.5
  
  ### Python version
  
  3.8
  
  ### Operating system
  
  Ubuntu 20.04
  
  ### Additional environment information
  
  _No response_
  
  ### How to reproduce
  
  print( (L2TP(header=['control', 'length'], version=2) / 'blahblah').build() )
  
  
  ### Actual result
  
  b'\xc0\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00blahblah'
  
  ### Expected result
  
  b'\xc0\x02\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00blahblah'
  
  ### Related resources
  
  _No response_
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `scapy/layers/l2tp.py`
  Content:
  ```
  1 # This file is part of Scapy
  2 # See http://www.secdev.org/projects/scapy for more information
  3 # Copyright (C) Philippe Biondi <phil@secdev.org>
  4 # This program is published under a GPLv2 license
  5 
  6 """
  7 L2TP (Layer 2 Tunneling Protocol) for VPNs.
  8 
  9 [RFC 2661]
  10 """
  11 
  12 import struct
  13 
  14 from scapy.packet import Packet, bind_layers, bind_bottom_up
  15 from scapy.fields import BitEnumField, ConditionalField, FlagsField, \
  16     PadField, ShortField
  17 from scapy.layers.inet import UDP
  18 from scapy.layers.ppp import PPP
  19 
  20 
  21 class L2TP(Packet):
  22     name = "L2TP"
  23     fields_desc = [
  24         FlagsField("hdr", 0, 12, ['res00', 'res01', 'res02', 'res03', 'priority', 'offset',  # noqa: E501
  25                                   'res06', 'sequence', 'res08', 'res09', 'length', 'control']),  # noqa: E501
  26         BitEnumField("version", 2, 4, {2: 'L2TPv2'}),
  27 
  28         ConditionalField(ShortField("len", 0),
  29                          lambda pkt: pkt.hdr & 'control+length'),
  30         ShortField("tunnel_id", 0),
  31         ShortField("session_id", 0),
  32         ConditionalField(ShortField("ns", 0),
  33                          lambda pkt: pkt.hdr & 'sequence+control'),
  34         ConditionalField(ShortField("nr", 0),
  35                          lambda pkt: pkt.hdr & 'sequence+control'),
  36         ConditionalField(
  37             PadField(ShortField("offset", 0), 4, b"\x00"),
  38             lambda pkt: not (pkt.hdr & 'control') and pkt.hdr & 'offset'
  39         )
  40     ]
  41 
  42     def post_build(self, pkt, pay):
  43         if self.len is None and self.hdr & 'control+length':
  44             tmp_len = len(pkt) + len(pay)
  45             pkt = pkt[:2] + struct.pack("!H", tmp_len) + pkt[4:]
  46         return pkt + pay
  47 
  48 
  49 bind_bottom_up(UDP, L2TP, dport=1701)
  50 bind_bottom_up(UDP, L2TP, sport=1701)
  51 bind_layers(UDP, L2TP, dport=1701, sport=1701)
  52 bind_layers(L2TP, PPP,)
  53
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/scapy/layers/l2tp.py b/scapy/layers/l2tp.py
  --- a/scapy/layers/l2tp.py
  +++ b/scapy/layers/l2tp.py
  @@ -25,7 +25,7 @@
                                     'res06', 'sequence', 'res08', 'res09', 'length', 'control']),  # noqa: E501
           BitEnumField("version", 2, 4, {2: 'L2TPv2'}),
   
  -        ConditionalField(ShortField("len", 0),
  +        ConditionalField(ShortField("len", None),
                            lambda pkt: pkt.hdr & 'control+length'),
           ShortField("tunnel_id", 0),
           ShortField("session_id", 0),
  
verification_info: {"golden_diff": "diff --git a/scapy/layers/l2tp.py b/scapy/layers/l2tp.py\n--- a/scapy/layers/l2tp.py\n+++ b/scapy/layers/l2tp.py\n@@ -25,7 +25,7 @@\n                                   'res06', 'sequence', 'res08', 'res09', 'length', 'control']),  # noqa: E501\n         BitEnumField(\"version\", 2, 4, {2: 'L2TPv2'}),\n \n-        ConditionalField(ShortField(\"len\", 0),\n+        ConditionalField(ShortField(\"len\", None),\n                          lambda pkt: pkt.hdr & 'control+length'),\n         ShortField(\"tunnel_id\", 0),\n         ShortField(\"session_id\", 0),\n", "issue": "L2TP post_build is broken\n### Brief description\n\nl2tp.py post_build is supposed to update the length. However, it only does this if current length is None, and the length field is initialized to 0, not None, resulting in the length never being updated. \n\n### Scapy version\n\n2.4.5\n\n### Python version\n\n3.8\n\n### Operating system\n\nUbuntu 20.04\n\n### Additional environment information\n\n_No response_\n\n### How to reproduce\n\nprint( (L2TP(header=['control', 'length'], version=2) / 'blahblah').build() )\r\n\n\n### Actual result\n\nb'\\xc0\\x02\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00blahblah'\n\n### Expected result\n\nb'\\xc0\\x02\\x00\\x14\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00blahblah'\n\n### Related resources\n\n_No response_\n", "before_files": [{"content": "# This file is part of Scapy\n# See http://www.secdev.org/projects/scapy for more information\n# Copyright (C) Philippe Biondi <phil@secdev.org>\n# This program is published under a GPLv2 license\n\n\"\"\"\nL2TP (Layer 2 Tunneling Protocol) for VPNs.\n\n[RFC 2661]\n\"\"\"\n\nimport struct\n\nfrom scapy.packet import Packet, bind_layers, bind_bottom_up\nfrom scapy.fields import BitEnumField, ConditionalField, FlagsField, \\\n    PadField, ShortField\nfrom scapy.layers.inet import UDP\nfrom scapy.layers.ppp import PPP\n\n\nclass L2TP(Packet):\n    name = \"L2TP\"\n    fields_desc = [\n        FlagsField(\"hdr\", 0, 12, ['res00', 'res01', 'res02', 'res03', 'priority', 'offset',  # noqa: E501\n                                  'res06', 'sequence', 'res08', 'res09', 'length', 'control']),  # noqa: E501\n        BitEnumField(\"version\", 2, 4, {2: 'L2TPv2'}),\n\n        ConditionalField(ShortField(\"len\", 0),\n                         lambda pkt: pkt.hdr & 'control+length'),\n        ShortField(\"tunnel_id\", 0),\n        ShortField(\"session_id\", 0),\n        ConditionalField(ShortField(\"ns\", 0),\n                         lambda pkt: pkt.hdr & 'sequence+control'),\n        ConditionalField(ShortField(\"nr\", 0),\n                         lambda pkt: pkt.hdr & 'sequence+control'),\n        ConditionalField(\n            PadField(ShortField(\"offset\", 0), 4, b\"\\x00\"),\n            lambda pkt: not (pkt.hdr & 'control') and pkt.hdr & 'offset'\n        )\n    ]\n\n    def post_build(self, pkt, pay):\n        if self.len is None and self.hdr & 'control+length':\n            tmp_len = len(pkt) + len(pay)\n            pkt = pkt[:2] + struct.pack(\"!H\", tmp_len) + pkt[4:]\n        return pkt + pay\n\n\nbind_bottom_up(UDP, L2TP, dport=1701)\nbind_bottom_up(UDP, L2TP, sport=1701)\nbind_layers(UDP, L2TP, dport=1701, sport=1701)\nbind_layers(L2TP, PPP,)\n", "path": "scapy/layers/l2tp.py"}], "after_files": [{"content": "# This file is part of Scapy\n# See http://www.secdev.org/projects/scapy for more information\n# Copyright (C) Philippe Biondi <phil@secdev.org>\n# This program is published under a GPLv2 license\n\n\"\"\"\nL2TP (Layer 2 Tunneling Protocol) for VPNs.\n\n[RFC 2661]\n\"\"\"\n\nimport struct\n\nfrom scapy.packet import Packet, bind_layers, bind_bottom_up\nfrom scapy.fields import BitEnumField, ConditionalField, FlagsField, \\\n    PadField, ShortField\nfrom scapy.layers.inet import UDP\nfrom scapy.layers.ppp import PPP\n\n\nclass L2TP(Packet):\n    name = \"L2TP\"\n    fields_desc = [\n        FlagsField(\"hdr\", 0, 12, ['res00', 'res01', 'res02', 'res03', 'priority', 'offset',  # noqa: E501\n                                  'res06', 'sequence', 'res08', 'res09', 'length', 'control']),  # noqa: E501\n        BitEnumField(\"version\", 2, 4, {2: 'L2TPv2'}),\n\n        ConditionalField(ShortField(\"len\", None),\n                         lambda pkt: pkt.hdr & 'control+length'),\n        ShortField(\"tunnel_id\", 0),\n        ShortField(\"session_id\", 0),\n        ConditionalField(ShortField(\"ns\", 0),\n                         lambda pkt: pkt.hdr & 'sequence+control'),\n        ConditionalField(ShortField(\"nr\", 0),\n                         lambda pkt: pkt.hdr & 'sequence+control'),\n        ConditionalField(\n            PadField(ShortField(\"offset\", 0), 4, b\"\\x00\"),\n            lambda pkt: not (pkt.hdr & 'control') and pkt.hdr & 'offset'\n        )\n    ]\n\n    def post_build(self, pkt, pay):\n        if self.len is None and self.hdr & 'control+length':\n            tmp_len = len(pkt) + len(pay)\n            pkt = pkt[:2] + struct.pack(\"!H\", tmp_len) + pkt[4:]\n        return pkt + pay\n\n\nbind_bottom_up(UDP, L2TP, dport=1701)\nbind_bottom_up(UDP, L2TP, sport=1701)\nbind_layers(UDP, L2TP, dport=1701, sport=1701)\nbind_layers(L2TP, PPP,)\n", "path": "scapy/layers/l2tp.py"}]}