diff --git a/scapy/layers/dhcp6.py b/scapy/layers/dhcp6.py
index 847e7a2fbceef904091200f7d531f5f8f4ab98a5..236c2df8108ac546b1d42793430f86239d23949e 100644
--- a/scapy/layers/dhcp6.py
+++ b/scapy/layers/dhcp6.py
@@ -24,7 +24,8 @@ from scapy.error import warning
 from scapy.fields import BitField, ByteEnumField, ByteField, FieldLenField, \
     FlagsField, IntEnumField, IntField, MACField, PacketField, \
     PacketListField, ShortEnumField, ShortField, StrField, StrFixedLenField, \
-    StrLenField, UTCTimeField, X3BytesField, XIntField, XShortEnumField
+    StrLenField, UTCTimeField, X3BytesField, XIntField, XShortEnumField, \
+    PacketLenField
 from scapy.layers.inet import UDP
 from scapy.layers.inet6 import DomainNameListField, IP6Field, IP6ListField, IPv6
 from scapy.packet import Packet, bind_bottom_up
@@ -444,20 +445,6 @@ class DHCP6OptElapsedTime(_DHCP6OptGuessPayload):# RFC sect 22.9
                     _ElapsedTimeField("elapsedtime", 0) ]
 
 
-#### DHCPv6 Relay Message Option ####################################
-
-# Relayed message is seen as a payload.
-class DHCP6OptRelayMsg(_DHCP6OptGuessPayload):# RFC sect 22.10
-    name = "DHCP6 Relay Message Option"
-    fields_desc = [ ShortEnumField("optcode", 9, dhcp6opts), 
-                    ShortField("optlen", None ) ]
-    def post_build(self, p, pay):
-        if self.optlen is None:
-            l = len(pay) 
-            p = p[:2]+struct.pack("!H", l)
-        return p + pay
-
-
 #### DHCPv6 Authentication Option ###################################
 
 #    The following fields are set in an Authentication option for the
@@ -912,6 +899,17 @@ class DHCP6(_DHCP6OptGuessPayload):
     def hashret(self):
         return struct.pack("!I", self.trid)[1:4]
 
+#### DHCPv6 Relay Message Option ####################################
+
+# Relayed message is seen as a payload.
+class DHCP6OptRelayMsg(_DHCP6OptGuessPayload):  # RFC sect 22.10
+    name = "DHCP6 Relay Message Option"
+    fields_desc = [ ShortEnumField("optcode", 9, dhcp6opts), 
+                    FieldLenField("optlen", None, fmt="!H",
+                        length_of="message"),
+                    PacketLenField("message", DHCP6(), DHCP6,
+                        length_from=lambda p: p.optlen) ]
+
 #####################################################################
 # Solicit Message : sect 17.1.1 RFC3315
 # - sent by client
diff --git a/test/regression.uts b/test/regression.uts
index e1e10a16ecdebc98871ee559fafe8a5112c92ab2..05787621cb8d85e470f0b27b169bb983ce0447e4 100644
--- a/test/regression.uts
+++ b/test/regression.uts
@@ -4377,7 +4377,7 @@ a.msgtype == 12 and a.hopcount == 0 and a.linkaddr == "::" and a.peeraddr == "::
 
 = DHCP6_RelayForward - Dissection with options
 a = DHCP6_RelayForward(b'\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\t\x00\x04\x00\x01\x00\x00')
-a.msgtype == 12 and DHCP6OptRelayMsg in a and DHCP6OptClientId in a
+a.msgtype == 12 and DHCP6OptRelayMsg in a and isinstance(a.message, DHCP6)
 
 
 ############
@@ -4385,12 +4385,16 @@ a.msgtype == 12 and DHCP6OptRelayMsg in a and DHCP6OptClientId in a
 + Test DHCP6 Messages - DHCP6OptRelayMsg
 
 = DHCP6OptRelayMsg - Basic Instantiation
-str(DHCP6OptRelayMsg(optcode=37)) == b'\x00%\x00\x00'
+str(DHCP6OptRelayMsg(optcode=37)) == b'\x00%\x00\x04\x00\x00\x00\x00'
 
 = DHCP6OptRelayMsg - Basic Dissection
 a=DHCP6OptRelayMsg(b'\x00\r\x00\x00')
 assert a.optcode == 13
 
+= DHCP6OptRelayMsg - Embedded DHCP6 packet
+p = DHCP6OptRelayMsg(b'\x00\t\x00\x04\x00\x00\x00\x00')
+isinstance(p.message, DHCP6)
+
 ############
 ############
 + Test DHCP6 Messages - DHCP6_RelayReply