diff --git a/pyof/foundation/basic_types.py b/pyof/foundation/basic_types.py
index 297baa2..a3b5461 100644
--- a/pyof/foundation/basic_types.py
+++ b/pyof/foundation/basic_types.py
@@ -130,10 +130,11 @@ class DPID(GenericType):
         self._value = ':'.join(bytes)
 
     def pack(self, value=None):
-        buffer = b''
-        for value in self._value.split(":"):
-            buffer += struct.pack('!B', int(value, 16))
-        return buffer
+        if isinstance(value, type(self)):
+            return value.pack()
+        if value is None:
+            value = self._value
+        return struct.pack('!8B', *[int(v, 16) for v in value.split(':')])
 
 
 class Char(GenericType):
diff --git a/pyof/v0x01/controller2switch/features_reply.py b/pyof/v0x01/controller2switch/features_reply.py
index 8dff843..33f5541 100644
--- a/pyof/v0x01/controller2switch/features_reply.py
+++ b/pyof/v0x01/controller2switch/features_reply.py
@@ -62,7 +62,7 @@ class SwitchFeatures(GenericMessage):
 
         Args:
             xid (int): xid to be used on the message header.
-            datapath_id (int): UBInt64 datapath unique ID.
+            datapath_id (str or :class:`.DPID`): datapath unique ID.
                 The lower 48-bits are for MAC address, while
                 the upper 16-bits are implementer-defined.
             n_buffers (int): UBInt32 max packets buffered at once.

Fix tests
I ran bisect assigning zeros to default DPID value and it lead to d207690facd4844557fb7d53aebbd5d2fb66a414 (added a new basic type: dpid).
diff --git a/tests/v0x01/test_controller2switch/test_features_reply.py b/tests/v0x01/test_controller2switch/test_features_reply.py
index 2728ded..3f56325 100644
--- a/tests/v0x01/test_controller2switch/test_features_reply.py
+++ b/tests/v0x01/test_controller2switch/test_features_reply.py
@@ -1,5 +1,5 @@
 """Echo request message tests."""
-from pyof.foundation.basic_types import HWAddress
+from pyof.foundation.basic_types import HWAddress, DPID
 from pyof.v0x01.common.phy_port import PhyPort, PortConfig, PortState
 from pyof.v0x01.controller2switch.features_reply import FeaturesReply
 from tests.test_struct import TestStruct
@@ -19,8 +19,9 @@ class TestFeaturesReply(TestStruct):
 
 
 def _get_kwargs():
-    return {'xid': 2, 'datapath_id': 1, 'n_buffers': 256, 'n_tables': 254,
-            'capabilities': 0x000000c7, 'actions': 4095, 'ports': _get_ports()}
+    return {'xid': 2, 'datapath_id': DPID('00:00:00:00:00:00:00:01'),
+            'n_buffers': 256, 'n_tables': 254, 'capabilities': 0x000000c7,
+            'actions': 4095, 'ports': _get_ports()}
 
 
 def _get_ports():

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio pylama radon
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
colorama==0.4.6
coverage==7.8.0
exceptiongroup==1.2.2
execnet==2.1.1
iniconfig==2.1.0
mando==0.7.1
mccabe==0.7.0
packaging==24.2
pluggy==1.5.0
pycodestyle==2.13.0
pydocstyle==6.3.0
pyflakes==3.3.2
pylama==8.4.1
pytest==8.3.5
pytest-asyncio==0.26.0
pytest-cov==6.0.0
pytest-mock==3.14.0
pytest-xdist==3.6.1
-e git+https://github.com/kytos/python-openflow.git@013e9c24bd4c234f0bf39210686a58af4c586d7d#egg=python_openflow
radon==6.0.1
six==1.17.0
snowballstemmer==2.2.0
tomli==2.2.1
typing_extensions==4.13.0

name: python-openflow
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - colorama==0.4.6
      - coverage==7.8.0
      - exceptiongroup==1.2.2
      - execnet==2.1.1
      - iniconfig==2.1.0
      - mando==0.7.1
      - mccabe==0.7.0
      - packaging==24.2
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pydocstyle==6.3.0
      - pyflakes==3.3.2
      - pylama==8.4.1
      - pytest==8.3.5
      - pytest-asyncio==0.26.0
      - pytest-cov==6.0.0
      - pytest-mock==3.14.0
      - pytest-xdist==3.6.1
      - radon==6.0.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - tomli==2.2.1
      - typing-extensions==4.13.0
prefix: /opt/conda/envs/python-openflow

tests/v0x01/test_controller2switch/test_features_reply.py::TestFeaturesReply::test_pack tests/v0x01/test_controller2switch/test_features_reply.py::TestFeaturesReply::test_unpack
tests/v0x01/test_controller2switch/test_features_reply.py::TestStruct::test_minimum_size tests/v0x01/test_controller2switch/test_features_reply.py::TestStruct::test_pack tests/v0x01/test_controller2switch/test_features_reply.py::TestStruct::test_unpack
tests/v0x01/test_controller2switch/test_features_reply.py::TestFeaturesReply::test_minimum_size
pyof/foundation/basic_types.py pyof/v0x01/controller2switch/features_reply.py
pyof/foundation/basic_types.py pyof/v0x01/controller2switch/features_reply.py