diff --git a/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-Make-the-cmd-available.patch b/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-Make-the-cmd-available.patch
index 12216ce46a..ba03134414 100644
--- a/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-Make-the-cmd-available.patch
+++ b/meta-python/recipes-devtools/python/python3-m2crypto/0001-setup.py-Make-the-cmd-available.patch
@@ -22,14 +22,12 @@ Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
  setup.py | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
 
-diff --git a/setup.py b/setup.py
-index 792d7365b6ed..5b8a5d791793 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -208,8 +208,10 @@ class _M2CryptoBuildExt(build_ext.build_ext):
+@@ -234,8 +234,10 @@
          if sys.platform != "win32":
              # generate src/SWIG/x509_v_flag.h to overcome weaknesses of swig
-             # https://todo.sr.ht/~mcepl/m2crypto/298
+             # https://codefloe.com/mcepl/m2crypto/issues/298
 -            with open("src/SWIG/x509_v_flag.h", "w", encoding="utf-8") as x509_v_h:
 -                cmd = [shutil.which(os.environ.get("CC", "gcc"))]
 +            with open(
@@ -39,6 +37,3 @@ index 792d7365b6ed..5b8a5d791793 100644
                  cflags = os.environ.get("CFLAGS")
                  if cflags is not None:
                      cmd += cflags.split()
--- 
-2.34.1
-
diff --git a/meta-python/recipes-devtools/python/python3-m2crypto_0.49.0.bb b/meta-python/recipes-devtools/python/python3-m2crypto_0.51.0.bb
similarity index 95%
rename from meta-python/recipes-devtools/python/python3-m2crypto_0.49.0.bb
rename to meta-python/recipes-devtools/python/python3-m2crypto_0.51.0.bb
index 454893884d..edf38afd2a 100644
--- a/meta-python/recipes-devtools/python/python3-m2crypto_0.49.0.bb
+++ b/meta-python/recipes-devtools/python/python3-m2crypto_0.51.0.bb
@@ -4,7 +4,7 @@ HOMEPAGE = "https://gitlab.com/m2crypto/m2crypto"
 LICENSE = "BSD-2-Clause"
 LIC_FILES_CHKSUM = "file://LICENSES/BSD-2-Clause.txt;md5=8099b0e569f862ece05740aef06c82a2"
 
-SRC_URI[sha256sum] = "604b9cdd7c1bb9e73e54a189643d56d08bf841691775122962430ee2ca3506fe"
+SRC_URI[sha256sum] = "5428f6601086a8f5e41aa70248b3b983443e7badf263551c5104ba2ec0c9d955"
 
 SRC_URI += "file://0001-setup.py-Make-the-cmd-available.patch"
 SRC_URI += "file://0002-_m2crypto.i-add-py2-py3-C-API-compat-macros.patch"
