libnl: Update bug fix patch and Add install append
PATCH 1/1 libnl: Update bug fix patch and Add install append
- Bug fix patch for handling non-standard net mask ( netmask not % 8)
- Add symbolic links for netlink & libraries
--- .../libnl/files/fix_for_masking_addr.patch | 40 ++++++++++++++++++++ .../libnl/libnl_3.2.21.bbappend | 16 ++++++++ 2 files changed, 56 insertions(+) create mode 100755 meta-arago-distro/recipes-connectivity/libnl/files/fix_for_masking_addr.patch create mode 100755 meta-arago-distro/recipes-connectivity/libnl/libnl_3.2.21.bbappend
meta-arago-distro/recipes-connectivity/libnl/files/fix_for_masking_addr.patch new file +40 -0
@@ -0,0 +1,40 @@ +From a8e7c2270ef4dea85bb2f4f83951e240cc636417 Mon Sep 17 00:00:00 2001 +From: Jingting Zhou <a0221004@ares-ubuntu> +Date: Fri, 11 Jan 2013 16:03:30 -0500 +Subject: [PATCH] fix for addr masking + +--- + lib/addr.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + mode change 100644 => 100755 lib/addr.c + +diff --git a/lib/addr.c b/lib/addr.c +old mode 100644 +new mode 100755 +index 3acd9e4..1d1c6c7 +--- a/lib/addr.c ++++ b/lib/addr.c +@@ -526,11 +526,16 @@ int nl_addr_cmp_prefix(struct nl_addr *a, struct nl_addr *b) + + d = memcmp(a->a_addr, b->a_addr, bytes); + if (d == 0) { +- int mask = (1UL << (len % 8)) - 1UL; ++ if ((len % 8) != 0) ++ { ++ ++ int mask = (0xFFFFFFFF << (8 - (len % 8))); ++ ++ d = (a->a_addr[bytes] & mask) - ++ (b->a_addr[bytes] & mask); ++ } ++ } + +- d = (a->a_addr[bytes] & mask) - +- (b->a_addr[bytes] & mask); +- } + } + + return d; +-- +1.7.9.5 +
meta-arago-distro/recipes-connectivity/libnl/libnl_3.2.21.bbappend new file +16 -0
@@ -0,0 +1,16 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += "\ + file://fix_for_masking_addr.patch \ +" + +do_install_append() { + cd ${D}${includedir} + ln -sf libnl3/netlink netlink + cd ${D}${libdir} + ln -sf libnl-3.so.200 libnl.so + ln -sf libnl-3.so.200 libnl.so.3 + ln -sf libnl-genl-3.so.200 libnl-genl.so + ln -sf libnl-genl-3.so.200 libnl-genl.so.3 +} +
Signature · 1 line
1.7.9.5
Quoted 2 lines · Sam Nelson
- Bug fix patch for handling non-standard net mask ( netmask not % 8)
Ok, so I can understand the patch need.
Quoted 1 line
- Add symbolic links for netlink & libraries
But why do you need those symlinks?
Quoted 7 lines
Signed-off-by Sam Nelson <[email protected]>--- .../libnl/files/fix_for_masking_addr.patch | 40 ++++++++++++++++++++ .../libnl/libnl_3.2.21.bbappend | 16 ++++++++ 2 files changed, 56 insertions(+) create mode 100755 meta-arago-distro/recipes-connectivity/libnl/files/fix_for_masking_addr.patch create mode 100755 meta-arago-distro/recipes-connectivity/libnl/libnl_3.2.21.bbappend
Permissions are all wrong. Those files should not be executable - that's the result of editing files in Windows...
Quoted 9 lines
meta-arago-distro/recipes-connectivity/libnl/files/fix_for_masking_addr.patch new file +3
-0@@ -0,0 +1,40 @@ +From a8e7c2270ef4dea85bb2f4f83951e240cc636417 Mon Sep 17 00:00:00 2001 +From: Jingting Zhou <a0221004@ares-ubuntu> +Date: Fri, 11 Jan 2013 16:03:30 -0500
meta-arago-distro/recipes-connectivity/libnl/files/fix_for_masking_addr.patch line 13
Quoted 10 lines
meta-arago-distro/recipes-connectivity/libnl/files/fix_for_masking_addr.patch new file +10
-0+Subject: [PATCH] fix for addr masking + +--- + lib/addr.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + mode change 100644 => 100755 lib/addr.c + +diff --git a/lib/addr.c b/lib/addr.c +old mode 100644 +new mode 100755
And even the source file gets the permissions changed.
Quoted 7 lines
meta-arago-distro/recipes-connectivity/libnl/files/fix_for_masking_addr.patch new file +7
-0+index 3acd9e4..1d1c6c7 +--- a/lib/addr.c ++++ b/lib/addr.c +@@ -526,11 +526,16 @@ int nl_addr_cmp_prefix(struct nl_addr *a, struct nl_addr *b) + + d = memcmp(a->a_addr, b->a_addr, bytes); + if (d == 0) {
meta-arago-distro/recipes-connectivity/libnl/files/fix_for_masking_addr.patch line 30
Quoted 10 lines
meta-arago-distro/recipes-connectivity/libnl/files/fix_for_masking_addr.patch new file +10
-0+- int mask = (1UL << (len % 8)) - 1UL; ++ if ((len % 8) != 0) ++ { ++ ++ int mask = (0xFFFFFFFF << (8 - (len % 8))); ++ ++ d = (a->a_addr[bytes] & mask) - ++ (b->a_addr[bytes] & mask); ++ } ++ }
Looks like indentation is all over the place. Use the original indentation of the source file you are patching. In this case the original used tabs and the added lines use spaces...
meta-arago-distro/recipes-connectivity/libnl/libnl_3.2.21.bbappend
Quoted 15 lines
meta-arago-distro/recipes-connectivity/libnl/files/fix_for_masking_addr.patch new file +10
-0+ +- d = (a->a_addr[bytes] & mask) - +- (b->a_addr[bytes] & mask); +- } + } + + return d; +-- +1.7.9.5 +meta-arago-distro/recipes-connectivity/libnl/libnl_3.2.21.bbappend new file +0
-0
In oe-core, libnl lives in recipes-support, not recipes-connectivity. It's recommended to use the same location for bbappends.
Quoted 5 lines
meta-arago-distro/recipes-connectivity/libnl/libnl_3.2.21.bbappend new file +4
-0@@ -0,0 +1,16 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += "\ + file://fix_for_masking_addr.patch \
meta-arago-distro/recipes-connectivity/libnl/libnl_3.2.21.bbappend line 14
Quoted 10 lines
meta-arago-distro/recipes-connectivity/libnl/libnl_3.2.21.bbappend new file +10
-0+" + +do_install_append() { + cd ${D}${includedir} + ln -sf libnl3/netlink netlink + cd ${D}${libdir} + ln -sf libnl-3.so.200 libnl.so + ln -sf libnl-3.so.200 libnl.so.3 + ln -sf libnl-genl-3.so.200 libnl-genl.so + ln -sf libnl-genl-3.so.200 libnl-genl.so.3
What is the reason for these links?
Quoted 9 lines
meta-arago-distro/recipes-connectivity/libnl/libnl_3.2.21.bbappend new file +2
-0+} +Signature · 6 lines
1.7.9.5 _______________________________________________ meta-arago mailing list [email protected] http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago