All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: [meta-networking][PATCH 21/49] dibbler: Add recipe
Date: Wed, 23 Nov 2016 01:21:41 -0800	[thread overview]
Message-ID: <20161123092209.23699-21-raj.khem@gmail.com> (raw)
In-Reply-To: <20161123092209.23699-1-raj.khem@gmail.com>

dibbler is a light weight DHCPv6 implementation

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../dibbler/dibbler_fix_getSize_crash.patch        | 72 ++++++++++++++++
 .../dibbler/dibbler/types.patch                    | 96 ++++++++++++++++++++++
 .../recipes-connectivity/dibbler/dibbler_1.0.1.bb  | 37 +++++++++
 3 files changed, 205 insertions(+)
 create mode 100644 meta-networking/recipes-connectivity/dibbler/dibbler/dibbler_fix_getSize_crash.patch
 create mode 100644 meta-networking/recipes-connectivity/dibbler/dibbler/types.patch
 create mode 100644 meta-networking/recipes-connectivity/dibbler/dibbler_1.0.1.bb

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 0000000..adb249f
--- /dev/null
+++ b/meta-networking/recipes-connectivity/dibbler/dibbler/dibbler_fix_getSize_crash.patch
@@ -0,0 +1,72 @@
+diff --git a/ClntMessages/ClntMsg.cpp b/ClntMessages/ClntMsg.cpp
+index eeaadd0..0cf5dce 100644
+--- a/ClntMessages/ClntMsg.cpp
++++ b/ClntMessages/ClntMsg.cpp
+@@ -346,7 +346,9 @@ unsigned long TClntMsg::getTimeout()
+ 
+ void TClntMsg::send()
+ {
+-    char* pkt = new char[getSize()];
++    size_t size = getSize();
++    char* pkt = new char[size];
++    memset(pkt, 0, size);
+ 
+     srand((uint32_t)time(NULL));
+     if (!RC)
+@@ -364,7 +366,7 @@ void TClntMsg::send()
+ 
+     RC++;
+ 
+-    this->storeSelf(pkt);
++    storeSelf(pkt);
+ 
+     SPtr<TIfaceIface> ptrIface = ClntIfaceMgr().getIfaceByID(Iface);
+     if (!ptrIface) {
+diff --git a/ClntMessages/ClntMsgRequest.cpp b/ClntMessages/ClntMsgRequest.cpp
+index 4a7b5da..f3e40fd 100644
+--- a/ClntMessages/ClntMsgRequest.cpp
++++ b/ClntMessages/ClntMsgRequest.cpp
+@@ -143,7 +143,10 @@ TClntMsgRequest::TClntMsgRequest(List(TAddrIA) IAs,
+     IsDone=false;
+     SPtr<TOpt> ptr;
+     ptr = new TOptDUID(OPTION_CLIENTID, ClntCfgMgr().getDUID(), this );
+-    Options.push_back( ptr );
++
++    if ( ptr ) { 
++        Options.push_back( ptr );
++    }
+ 
+     if (!srvDUID) {
+ 	Log(Error) << "Unable to send REQUEST: ServerId not specified.\n" << LogEnd;
+@@ -154,7 +157,9 @@ TClntMsgRequest::TClntMsgRequest(List(TAddrIA) IAs,
+     ptr = (Ptr*) new TOptDUID(OPTION_SERVERID, srvDUID,this);
+     // all IAs provided by checkSolicit
+     SPtr<TAddrIA> ClntAddrIA;
+-    Options.push_back( ptr );
++    if ( ptr ) {
++        Options.push_back( ptr );
++    }
+ 	
+     IAs.first();
+     while (ClntAddrIA = IAs.get()) 
+diff --git a/Messages/Msg.cpp b/Messages/Msg.cpp
+index baa6c86..6eef6c7 100644
+--- a/Messages/Msg.cpp
++++ b/Messages/Msg.cpp
+@@ -66,10 +66,15 @@ int TMsg::getSize()
+ {
+     int pktsize=0;
+     TOptList::iterator opt;
++    int optionCount = 0;  
+     for (opt = Options.begin(); opt!=Options.end(); ++opt)
+     {
+-	pktsize += (*opt)->getSize();
++        Log(Info) << "### CPE Debug - Option with index  " << optionCount++ << LogEnd ;
++        Log(Info) << "### CPE Debug - Option with type " << (*opt)->getOptType() << LogEnd ;
++        pktsize += (*opt)->getSize();
+     }
++    Log(Info) << "### CPE Debug - Packet size of option (Add 4) " << pktsize << LogEnd ;
++
+     return pktsize + 4;
+ }
+ 
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 0000000..28f18ef
--- /dev/null
+++ b/meta-networking/recipes-connectivity/dibbler/dibbler/types.patch
@@ -0,0 +1,96 @@
+Apply fixes to build on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+
+Index: dibbler-1.0.1/IfaceMgr/IfaceMgr.cpp
+===================================================================
+--- dibbler-1.0.1.orig/IfaceMgr/IfaceMgr.cpp
++++ dibbler-1.0.1/IfaceMgr/IfaceMgr.cpp
+@@ -16,6 +16,7 @@
+ #include <string>
+ #include <stdlib.h>
+ #include <errno.h>
++#include <sys/select.h>
+ #include "Portable.h"
+ #include "IfaceMgr.h"
+ #include "Iface.h"
+Index: dibbler-1.0.1/IfaceMgr/SocketIPv6.h
+===================================================================
+--- dibbler-1.0.1.orig/IfaceMgr/SocketIPv6.h
++++ dibbler-1.0.1/IfaceMgr/SocketIPv6.h
+@@ -18,6 +18,7 @@ class TIfaceSocket;
+ 
+ #include <iostream>
+ #include <string>
++#include <sys/select.h>
+ 
+ #include "Portable.h"
+ #include "DHCPConst.h"
+Index: dibbler-1.0.1/Port-linux/ethtool-local.h
+===================================================================
+--- dibbler-1.0.1.orig/Port-linux/ethtool-local.h
++++ dibbler-1.0.1/Port-linux/ethtool-local.h
+@@ -22,9 +22,9 @@
+  */
+ 
+ typedef unsigned long long u64;
+-typedef __uint32_t u32;        
+-typedef __uint16_t u16;        
+-typedef __uint8_t u8;          
++typedef uint32_t u32;
++typedef uint16_t u16;
++typedef uint8_t u8;
+ 
+ #include "ethtool-kernel.h"
+ 
+Index: dibbler-1.0.1/Port-linux/interface.c
+===================================================================
+--- dibbler-1.0.1.orig/Port-linux/interface.c
++++ dibbler-1.0.1/Port-linux/interface.c
+@@ -26,6 +26,7 @@
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <linux/if.h>
++#include <linux/sockios.h>
+ #include <syslog.h>
+ #include <string.h>
+ #include <errno.h>
+@@ -35,13 +36,10 @@
+ #include <stdlib.h>
+ #include <assert.h>
+ 
+-#include <net/if.h>
+ 
+ #include "ethtool-local.h"
+ #include "interface.h"
+ #include <stdarg.h>
+-#include <linux/sockios.h>
+-#include <linux/if_ether.h>
+ 
+ void daemon_log(int loglevel, const char *fmt,...)
+ {
+Index: dibbler-1.0.1/Port-linux/lowlevel-linux-link-state.c
+===================================================================
+--- dibbler-1.0.1.orig/Port-linux/lowlevel-linux-link-state.c
++++ dibbler-1.0.1/Port-linux/lowlevel-linux-link-state.c
+@@ -18,7 +18,6 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+-#include <bits/sigthread.h>
+ #include "Portable.h"
+ #include "interface.h"
+ 
+Index: dibbler-1.0.1/Port-linux/utils.h
+===================================================================
+--- dibbler-1.0.1.orig/Port-linux/utils.h
++++ dibbler-1.0.1/Port-linux/utils.h
+@@ -4,6 +4,7 @@
+ #include <asm/types.h>
+ //#include <resolv.h>
+ #include <linux/types.h>
++#include <sys/types.h>
+ 
+ #include "libnetlink.h"
+ #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 0000000..a2d46db
--- /dev/null
+++ b/meta-networking/recipes-connectivity/dibbler/dibbler_1.0.1.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Dibbler DHCPv6 client"
+DESCRIPTION = "Dibbler is a portable DHCPv6 implementation. It supports stateful as well as stateless autoconfiguration for IPv6."
+HOMEPAGE = "http://klub.com.pl/dhcpv6"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7236695bb6d4461c105d685a8b61c4e3"
+
+SRC_URI = "http://klub.com.pl/dhcpv6/${BPN}/${P}.tar.gz \
+        file://dibbler_fix_getSize_crash.patch \
+        file://types.patch \
+"
+SRC_URI[md5sum] = "93357bea3ec35b0c1d11242055361409"
+SRC_URI[sha256sum] = "27869877e060c039cbc24a5f6a9dd69006bf67de0ffdf29a645a80aef6e476a1"
+
+PACKAGECONFIG ??= "debug bind-reuse resolvconf dns-update"
+
+PACKAGECONFIG[debug] = "--enable-debug,,,"
+PACKAGECONFIG[efence] = "--enable-efence,,,"
+PACKAGECONFIG[bind-reuse] = "--enable-bind-reuse,,,"
+PACKAGECONFIG[dst-addr-filter] = "--enable-dst-addr-check,,,"
+PACKAGECONFIG[resolvconf] = "--enable-resolvconf,,,"
+PACKAGECONFIG[dns-update] = "--enable-dns-update,,,"
+PACKAGECONFIG[auth] = "--enable-auth,,,"
+PACKAGECONFIG[gtest] = "--enable-gtest-static,,,"
+
+inherit autotools
+
+DEPENDS += "flex-native"
+
+CFLAGS += "-D_GNU_SOURCE"
+
+PACKAGES =+ "${PN}-requestor ${PN}-client ${PN}-relay ${PN}-server"
+
+FILES_${PN}-client = "${sbindir}/${PN}-client"
+FILES_${PN}-relay = "${sbindir}/${PN}-relay"
+FILES_${PN}-requestor = "${sbindir}/${PN}-requestor"
+FILES_${PN}-server = "${sbindir}/${PN}-server"
-- 
2.10.2



  parent reply	other threads:[~2016-11-23  9:22 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23  9:21 [meta-oe][PATCH 01/49] libqmi: Fix build with clang Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 02/49] meta_oe_security_flags: Disable PIE for s3c64xx-gpio/s3c24xx-gpio/cpufrequtils Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 03/49] boinc: Add recipe for boinc-client Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 04/49] libplist: Remove rpaths surgically Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 05/49] meta_oe_security_flags.inc: Add libcec, libmodplug, libcdio Khem Raj
2016-11-23  9:21 ` [meta-multimedia][PATCH 06/49] dcadec, libsquish: Add new recipes Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 07/49] libcec: Update to 3.1.0+ Khem Raj
2016-11-23  9:21 ` [meta-multimedia][PATCH 08/49] kodi: Add krypton/17.x Jarvis/16.x recipes Khem Raj
2016-11-26  0:15   ` Martin Jansa
2016-11-26  7:42     ` Koen Kooi
2016-11-28 17:48       ` Khem Raj
2016-11-29  0:57     ` Khem Raj
2016-12-15  9:53       ` Martin Jansa
2016-11-23  9:21 ` [meta-oe][PATCH 09/49] fwts: Update to 16.09 release Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 10/49] libvdpau: Add recipe Khem Raj
2016-12-17 23:53   ` Martin Jansa
2016-12-19 21:10     ` Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 11/49] krb5: Add -fPIC to compile flags Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 12/49] Disable PIE for libvdpau Khem Raj
2016-11-23  9:21 ` [meta-multimedia][PATCH 13/49] kodi: Fix build with pic on x86_64 Khem Raj
2016-11-23  9:21 ` [meta-multimedia][PATCH 14/49] kodi-17: Add packageconfig for lcms support Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 15/49] samba: Fix build with musl Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 16/49] lockdev: Pretend GNU libc on musl Khem Raj
2016-11-23  9:21 ` [meta-multimedia][PATCH 17/49] kodi-17: Fix build with musl Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH V2 18/49] breakpad: Upgrade to latest Khem Raj
2016-11-26  0:12   ` Martin Jansa
2016-11-26  6:09     ` Khem Raj
2016-11-23  9:21 ` [meta-filesystems][PATCH 19/49] xfsprogs: Upgrade 3.2.3 -> 4.8.0 Khem Raj
2016-11-25  0:31   ` Martin Jansa
2016-11-25 10:41     ` Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 20/49] arno-iptables-firewall: Add recipe Khem Raj
2016-11-23  9:21 ` Khem Raj [this message]
2016-11-23  9:21 ` [meta-networking][PATCH 22/49] ez-ipupdate: " Khem Raj
2016-11-23  9:21 ` [meta-multimedia][PATCH 23/49] miniupnpd: " Khem Raj
2016-11-26  0:16   ` Martin Jansa
2016-11-26  6:00     ` Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 24/49] inetutils: Disable rsh, rcp, rlogin on musl Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 25/49] ssmtp: Add recipe Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 26/49] ne10: Update to latest Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 27/49] libgit2: Update to 0.24.3 Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 28/49] openldap: Fix Build error due to missing -fPIC Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 29/49] dante: Add recipe for 1.4.1 Khem Raj
2016-11-26  0:16   ` Martin Jansa
2016-11-26  6:03     ` Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 30/49] networkmanager-openvpn: Update 1.0.8->1.2.6 Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 31/49] openobex,obexftp: Update recipes Khem Raj
2016-11-26  0:17   ` Martin Jansa
2016-11-26  4:57     ` Khem Raj
2016-11-26  6:02       ` Khem Raj
2016-11-26  9:08         ` Martin Jansa
2016-11-28 19:38           ` Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 32/49] md5deep: Fix build with clang Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 33/49] dialog: Update 1.3-20160424 -> 1.3-20160828 Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 34/49] ipsec-tools: Fix build with clang Khem Raj
2016-11-23  9:21 ` [meta-networking][PATCH 35/49] crda: " Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 36/49] obex-data-server: Fix build with new openobex version Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 37/49] flashrom: Remove redundant const qualifier Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 38/49] fribidi: Fix build with security flags turned on Khem Raj
2016-11-23  9:21 ` [meta-oe][PATCH 39/49] libmicrohttpd: Upgrade to 0.9.52 Khem Raj
2016-11-23  9:22 ` [meta-oe][PATCH 40/49] jsoncpp: Add new recipe Khem Raj
2016-11-28 10:46   ` Piotr Lewicki
2016-11-28 21:10     ` Khem Raj
2016-11-23  9:22 ` [meta-oe][PATCH 41/49] jsonrpc: Add recipe Khem Raj
2016-11-23  9:22 ` [meta-oe][PATCH 42/49] libmad: Fix build with clang Khem Raj
2016-11-23  9:22 ` [meta-oe][PATCH 43/49] modemmanager: " Khem Raj
2016-11-23  9:22 ` [meta-oe][PATCH 44/49] libcec: Add missing dep on ncurses Khem Raj
2016-11-23  9:22 ` [meta-multimedia][PATCH 45/49] kodi-17: Update to latest Khem Raj
2016-11-23  9:22 ` [meta-multimedia][PATCH 46/49] tvheadend: Update to 4.0.9 Khem Raj
2016-11-26  0:18   ` Martin Jansa
2016-11-26  4:56     ` Khem Raj
2016-11-23  9:22 ` [meta-networking][PATCH 47/49] memcached: Update to 1.4.33 Khem Raj
2016-11-23  9:22 ` [meta-multimedia][PATCH 48/49] vlc: Add packageconfig for vdpau Khem Raj
2016-11-23  9:22 ` [meta-oe][PATCH 49/49] mpv: Add libvdpau to DEPENDS Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161123092209.23699-21-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.