diff --git a/dev-tools/openvpn-cppcheck-netlink.cfg b/dev-tools/openvpn-cppcheck-netlink.cfg
new file mode 100644
index 0000000..b63adf0
--- /dev/null
+++ b/dev-tools/openvpn-cppcheck-netlink.cfg
@@ -0,0 +1,7 @@
+<?xml version ="1.0"?>
+<def>
+  <!-- minimal defines to supress the errors on non-Linux platforms that do not have the netlink headers -->
+  <define name="NLA_PUT(msg, attrtype, attrlen, data)" value="if (nla_cppcheck_dummy(msg, attrtype, attrlen, data) < 0) goto nla_put_failure;" />
+  <define name="NLA_PUT_U32(msg, attrtype, value)" value="NLA_PUT(msg, uint32_t, attrtype, value)" />
+  <define name="NLA_PUT_STRING(msg, attrtype, value)" value="NLA_PUT(msg, attrtype, (int) strlen(value) + 1, value)" />
+</def>
diff --git a/dev-tools/run-cppcheck.sh b/dev-tools/run-cppcheck.sh
index d1c22c5..debcd46 100755
--- a/dev-tools/run-cppcheck.sh
+++ b/dev-tools/run-cppcheck.sh
@@ -20,9 +20,11 @@
 if [ $(uname) = "Darwin" ] || [ $(uname) = "FreeBSD" ]; then
     SCRIPT_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
     num_procs=$(sysctl -n hw.ncpu)
+    EXTRA_LIBRARY="--library=${SCRIPT_DIR}/openvpn-cppcheck-netlink.cfg"
 else
     SCRIPT_DIR=$(dirname $(readlink -e "${BASH_SOURCE[0]}"))
     num_procs=$(nproc)
+    EXTRA_LIBRARY=""
 fi
 : ${SOURCE_DIR:=$SCRIPT_DIR/..}
 : ${BUILD_DIR:=$PWD}
@@ -35,6 +37,7 @@
  -I${BUILD_DIR} -I${BUILD_DIR}/include/ \
  --enable=all ${disable_arg} \
  --library=${SCRIPT_DIR}/openvpn-cppcheck-library.cfg \
+ ${EXTRA_LIBRARY} \
  --library=openssl.cfg \
  --suppress-xml=${SCRIPT_DIR}/cppcheck-suppressions.xml --inline-suppr \
  --cppcheck-build-dir=${CPPCHECK_DIR} \
