diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-11-12 06:54:35 +0000 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2016-12-14 09:20:10 -0500 |
commit | b8d98187b93115f7604ae649675211b97a359d76 (patch) | |
tree | eb306e034da6439894a710e9632c8f2cb6f67f56 | |
parent | eb6f1afd14f1d2150446e66785b2843caba534de (diff) | |
download | meta-openembedded-b8d98187b93115f7604ae649675211b97a359d76.tar.gz |
dibbler: Add recipe
dibbler is a light weight DHCPv6 implementation
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
3 files changed, 205 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/dibbler/dibbler/dibbler_fix_getSize_crash.patch b/meta-networking/recipes-connectivity/dibbler/dibbler/dibbler_fix_getSize_crash.patch new file mode 100644 index 0000000000..adb249fdec --- /dev/null +++ b/meta-networking/recipes-connectivity/dibbler/dibbler/dibbler_fix_getSize_crash.patch | |||
@@ -0,0 +1,72 @@ | |||
1 | diff --git a/ClntMessages/ClntMsg.cpp b/ClntMessages/ClntMsg.cpp | ||
2 | index eeaadd0..0cf5dce 100644 | ||
3 | --- a/ClntMessages/ClntMsg.cpp | ||
4 | +++ b/ClntMessages/ClntMsg.cpp | ||
5 | @@ -346,7 +346,9 @@ unsigned long TClntMsg::getTimeout() | ||
6 | |||
7 | void TClntMsg::send() | ||
8 | { | ||
9 | - char* pkt = new char[getSize()]; | ||
10 | + size_t size = getSize(); | ||
11 | + char* pkt = new char[size]; | ||
12 | + memset(pkt, 0, size); | ||
13 | |||
14 | srand((uint32_t)time(NULL)); | ||
15 | if (!RC) | ||
16 | @@ -364,7 +366,7 @@ void TClntMsg::send() | ||
17 | |||
18 | RC++; | ||
19 | |||
20 | - this->storeSelf(pkt); | ||
21 | + storeSelf(pkt); | ||
22 | |||
23 | SPtr<TIfaceIface> ptrIface = ClntIfaceMgr().getIfaceByID(Iface); | ||
24 | if (!ptrIface) { | ||
25 | diff --git a/ClntMessages/ClntMsgRequest.cpp b/ClntMessages/ClntMsgRequest.cpp | ||
26 | index 4a7b5da..f3e40fd 100644 | ||
27 | --- a/ClntMessages/ClntMsgRequest.cpp | ||
28 | +++ b/ClntMessages/ClntMsgRequest.cpp | ||
29 | @@ -143,7 +143,10 @@ TClntMsgRequest::TClntMsgRequest(List(TAddrIA) IAs, | ||
30 | IsDone=false; | ||
31 | SPtr<TOpt> ptr; | ||
32 | ptr = new TOptDUID(OPTION_CLIENTID, ClntCfgMgr().getDUID(), this ); | ||
33 | - Options.push_back( ptr ); | ||
34 | + | ||
35 | + if ( ptr ) { | ||
36 | + Options.push_back( ptr ); | ||
37 | + } | ||
38 | |||
39 | if (!srvDUID) { | ||
40 | Log(Error) << "Unable to send REQUEST: ServerId not specified.\n" << LogEnd; | ||
41 | @@ -154,7 +157,9 @@ TClntMsgRequest::TClntMsgRequest(List(TAddrIA) IAs, | ||
42 | ptr = (Ptr*) new TOptDUID(OPTION_SERVERID, srvDUID,this); | ||
43 | // all IAs provided by checkSolicit | ||
44 | SPtr<TAddrIA> ClntAddrIA; | ||
45 | - Options.push_back( ptr ); | ||
46 | + if ( ptr ) { | ||
47 | + Options.push_back( ptr ); | ||
48 | + } | ||
49 | |||
50 | IAs.first(); | ||
51 | while (ClntAddrIA = IAs.get()) | ||
52 | diff --git a/Messages/Msg.cpp b/Messages/Msg.cpp | ||
53 | index baa6c86..6eef6c7 100644 | ||
54 | --- a/Messages/Msg.cpp | ||
55 | +++ b/Messages/Msg.cpp | ||
56 | @@ -66,10 +66,15 @@ int TMsg::getSize() | ||
57 | { | ||
58 | int pktsize=0; | ||
59 | TOptList::iterator opt; | ||
60 | + int optionCount = 0; | ||
61 | for (opt = Options.begin(); opt!=Options.end(); ++opt) | ||
62 | { | ||
63 | - pktsize += (*opt)->getSize(); | ||
64 | + Log(Info) << "### CPE Debug - Option with index " << optionCount++ << LogEnd ; | ||
65 | + Log(Info) << "### CPE Debug - Option with type " << (*opt)->getOptType() << LogEnd ; | ||
66 | + pktsize += (*opt)->getSize(); | ||
67 | } | ||
68 | + Log(Info) << "### CPE Debug - Packet size of option (Add 4) " << pktsize << LogEnd ; | ||
69 | + | ||
70 | return pktsize + 4; | ||
71 | } | ||
72 | |||
diff --git a/meta-networking/recipes-connectivity/dibbler/dibbler/types.patch b/meta-networking/recipes-connectivity/dibbler/dibbler/types.patch new file mode 100644 index 0000000000..28f18ef423 --- /dev/null +++ b/meta-networking/recipes-connectivity/dibbler/dibbler/types.patch | |||
@@ -0,0 +1,96 @@ | |||
1 | Apply fixes to build on musl | ||
2 | |||
3 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
4 | |||
5 | |||
6 | Index: dibbler-1.0.1/IfaceMgr/IfaceMgr.cpp | ||
7 | =================================================================== | ||
8 | --- dibbler-1.0.1.orig/IfaceMgr/IfaceMgr.cpp | ||
9 | +++ dibbler-1.0.1/IfaceMgr/IfaceMgr.cpp | ||
10 | @@ -16,6 +16,7 @@ | ||
11 | #include <string> | ||
12 | #include <stdlib.h> | ||
13 | #include <errno.h> | ||
14 | +#include <sys/select.h> | ||
15 | #include "Portable.h" | ||
16 | #include "IfaceMgr.h" | ||
17 | #include "Iface.h" | ||
18 | Index: dibbler-1.0.1/IfaceMgr/SocketIPv6.h | ||
19 | =================================================================== | ||
20 | --- dibbler-1.0.1.orig/IfaceMgr/SocketIPv6.h | ||
21 | +++ dibbler-1.0.1/IfaceMgr/SocketIPv6.h | ||
22 | @@ -18,6 +18,7 @@ class TIfaceSocket; | ||
23 | |||
24 | #include <iostream> | ||
25 | #include <string> | ||
26 | +#include <sys/select.h> | ||
27 | |||
28 | #include "Portable.h" | ||
29 | #include "DHCPConst.h" | ||
30 | Index: dibbler-1.0.1/Port-linux/ethtool-local.h | ||
31 | =================================================================== | ||
32 | --- dibbler-1.0.1.orig/Port-linux/ethtool-local.h | ||
33 | +++ dibbler-1.0.1/Port-linux/ethtool-local.h | ||
34 | @@ -22,9 +22,9 @@ | ||
35 | */ | ||
36 | |||
37 | typedef unsigned long long u64; | ||
38 | -typedef __uint32_t u32; | ||
39 | -typedef __uint16_t u16; | ||
40 | -typedef __uint8_t u8; | ||
41 | +typedef uint32_t u32; | ||
42 | +typedef uint16_t u16; | ||
43 | +typedef uint8_t u8; | ||
44 | |||
45 | #include "ethtool-kernel.h" | ||
46 | |||
47 | Index: dibbler-1.0.1/Port-linux/interface.c | ||
48 | =================================================================== | ||
49 | --- dibbler-1.0.1.orig/Port-linux/interface.c | ||
50 | +++ dibbler-1.0.1/Port-linux/interface.c | ||
51 | @@ -26,6 +26,7 @@ | ||
52 | #include <sys/socket.h> | ||
53 | #include <sys/ioctl.h> | ||
54 | #include <linux/if.h> | ||
55 | +#include <linux/sockios.h> | ||
56 | #include <syslog.h> | ||
57 | #include <string.h> | ||
58 | #include <errno.h> | ||
59 | @@ -35,13 +36,10 @@ | ||
60 | #include <stdlib.h> | ||
61 | #include <assert.h> | ||
62 | |||
63 | -#include <net/if.h> | ||
64 | |||
65 | #include "ethtool-local.h" | ||
66 | #include "interface.h" | ||
67 | #include <stdarg.h> | ||
68 | -#include <linux/sockios.h> | ||
69 | -#include <linux/if_ether.h> | ||
70 | |||
71 | void daemon_log(int loglevel, const char *fmt,...) | ||
72 | { | ||
73 | Index: dibbler-1.0.1/Port-linux/lowlevel-linux-link-state.c | ||
74 | =================================================================== | ||
75 | --- dibbler-1.0.1.orig/Port-linux/lowlevel-linux-link-state.c | ||
76 | +++ dibbler-1.0.1/Port-linux/lowlevel-linux-link-state.c | ||
77 | @@ -18,7 +18,6 @@ | ||
78 | #include <stdlib.h> | ||
79 | #include <string.h> | ||
80 | #include <unistd.h> | ||
81 | -#include <bits/sigthread.h> | ||
82 | #include "Portable.h" | ||
83 | #include "interface.h" | ||
84 | |||
85 | Index: dibbler-1.0.1/Port-linux/utils.h | ||
86 | =================================================================== | ||
87 | --- dibbler-1.0.1.orig/Port-linux/utils.h | ||
88 | +++ dibbler-1.0.1/Port-linux/utils.h | ||
89 | @@ -4,6 +4,7 @@ | ||
90 | #include <asm/types.h> | ||
91 | //#include <resolv.h> | ||
92 | #include <linux/types.h> | ||
93 | +#include <sys/types.h> | ||
94 | |||
95 | #include "libnetlink.h" | ||
96 | #include "ll_map.h" | ||
diff --git a/meta-networking/recipes-connectivity/dibbler/dibbler_1.0.1.bb b/meta-networking/recipes-connectivity/dibbler/dibbler_1.0.1.bb new file mode 100644 index 0000000000..a2d46dbe0b --- /dev/null +++ b/meta-networking/recipes-connectivity/dibbler/dibbler_1.0.1.bb | |||
@@ -0,0 +1,37 @@ | |||
1 | SUMMARY = "Dibbler DHCPv6 client" | ||
2 | DESCRIPTION = "Dibbler is a portable DHCPv6 implementation. It supports stateful as well as stateless autoconfiguration for IPv6." | ||
3 | HOMEPAGE = "http://klub.com.pl/dhcpv6" | ||
4 | |||
5 | LICENSE = "GPLv2" | ||
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=7236695bb6d4461c105d685a8b61c4e3" | ||
7 | |||
8 | SRC_URI = "http://klub.com.pl/dhcpv6/${BPN}/${P}.tar.gz \ | ||
9 | file://dibbler_fix_getSize_crash.patch \ | ||
10 | file://types.patch \ | ||
11 | " | ||
12 | SRC_URI[md5sum] = "93357bea3ec35b0c1d11242055361409" | ||
13 | SRC_URI[sha256sum] = "27869877e060c039cbc24a5f6a9dd69006bf67de0ffdf29a645a80aef6e476a1" | ||
14 | |||
15 | PACKAGECONFIG ??= "debug bind-reuse resolvconf dns-update" | ||
16 | |||
17 | PACKAGECONFIG[debug] = "--enable-debug,,," | ||
18 | PACKAGECONFIG[efence] = "--enable-efence,,," | ||
19 | PACKAGECONFIG[bind-reuse] = "--enable-bind-reuse,,," | ||
20 | PACKAGECONFIG[dst-addr-filter] = "--enable-dst-addr-check,,," | ||
21 | PACKAGECONFIG[resolvconf] = "--enable-resolvconf,,," | ||
22 | PACKAGECONFIG[dns-update] = "--enable-dns-update,,," | ||
23 | PACKAGECONFIG[auth] = "--enable-auth,,," | ||
24 | PACKAGECONFIG[gtest] = "--enable-gtest-static,,," | ||
25 | |||
26 | inherit autotools | ||
27 | |||
28 | DEPENDS += "flex-native" | ||
29 | |||
30 | CFLAGS += "-D_GNU_SOURCE" | ||
31 | |||
32 | PACKAGES =+ "${PN}-requestor ${PN}-client ${PN}-relay ${PN}-server" | ||
33 | |||
34 | FILES_${PN}-client = "${sbindir}/${PN}-client" | ||
35 | FILES_${PN}-relay = "${sbindir}/${PN}-relay" | ||
36 | FILES_${PN}-requestor = "${sbindir}/${PN}-requestor" | ||
37 | FILES_${PN}-server = "${sbindir}/${PN}-server" | ||