Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/blob.c
diff options
context:
space:
mode:
Diffstat (limited to 'blob.c')
-rw-r--r--blob.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/blob.c b/blob.c
index 3929ad3..edf55d4 100644
--- a/blob.c
+++ b/blob.c
@@ -201,3 +201,18 @@ blob_parse(struct blob_attr *attr, struct blob_attr **data, const struct blob_at
}
return found;
}
+
+bool
+blob_attr_equal(const struct blob_attr *a1, const struct blob_attr *a2)
+{
+ if (!a1 && !a2)
+ return true;
+
+ if (!a1 || !a2)
+ return false;
+
+ if (blob_pad_len(a1) != blob_pad_len(a2))
+ return false;
+
+ return !memcmp(a1, a2, blob_pad_len(a1));
+}