diff options
| author | Otavio Salvador <otavio@ossystems.com.br> | 2012-02-08 16:32:06 +0000 |
|---|---|---|
| committer | Koen Kooi <koen@dominion.thruhere.net> | 2012-02-20 22:22:02 +0100 |
| commit | 1e593c82a3d1ea98ccc5ba468967a66b6a3c443f (patch) | |
| tree | 010ed9c6e8f2126e34f28275cce8ad1b0b0af2d1 /meta-oe/recipes-extended/net-snmp | |
| parent | 675da0c58afe0926f9e614acb49b9e6c5d30d413 (diff) | |
| download | meta-openembedded-1e593c82a3d1ea98ccc5ba468967a66b6a3c443f.tar.gz | |
net-snmp: use netlink support
To properly compile with netlink we added a patch that ports the
netlink use to libnl-3 API.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'meta-oe/recipes-extended/net-snmp')
| -rw-r--r-- | meta-oe/recipes-extended/net-snmp/files/libnl-3-support.patch | 69 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/net-snmp/net-snmp.inc | 4 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/net-snmp/net-snmp_5.7.1.bb | 3 |
3 files changed, 73 insertions, 3 deletions
diff --git a/meta-oe/recipes-extended/net-snmp/files/libnl-3-support.patch b/meta-oe/recipes-extended/net-snmp/files/libnl-3-support.patch new file mode 100644 index 0000000000..72699b8dd6 --- /dev/null +++ b/meta-oe/recipes-extended/net-snmp/files/libnl-3-support.patch | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | Add support to libnl-3 | ||
| 2 | |||
| 3 | Upstream-Status: Pending | ||
| 4 | |||
| 5 | --- net-snmp-5.6.1/agent/mibgroup/mibII/tcpTable.c.org 2011-03-27 22:39:13.428728506 +0200 | ||
| 6 | +++ net-snmp-5.6.1/agent/mibgroup/mibII/tcpTable.c 2011-03-27 22:39:47.606956561 +0200 | ||
| 7 | @@ -555,8 +555,9 @@ | ||
| 8 | static int | ||
| 9 | tcpTable_load_netlink(void) | ||
| 10 | { | ||
| 11 | + int err; | ||
| 12 | /* TODO: perhaps use permanent nl handle? */ | ||
| 13 | - struct nl_handle *nl = nl_handle_alloc(); | ||
| 14 | + struct nl_sock *nl = nl_socket_alloc(); | ||
| 15 | |||
| 16 | if (nl == NULL) { | ||
| 17 | DEBUGMSGTL(("mibII/tcpTable", "Failed to allocate netlink handle\n")); | ||
| 18 | @@ -564,10 +565,10 @@ | ||
| 19 | return -1; | ||
| 20 | } | ||
| 21 | |||
| 22 | - if (nl_connect(nl, NETLINK_INET_DIAG) < 0) { | ||
| 23 | - DEBUGMSGTL(("mibII/tcpTable", "Failed to connect to netlink: %s\n", nl_geterror())); | ||
| 24 | - snmp_log(LOG_ERR, "snmpd: Couldn't connect to netlink: %s\n", nl_geterror()); | ||
| 25 | - nl_handle_destroy(nl); | ||
| 26 | + if ((err = nl_connect(nl, NETLINK_INET_DIAG)) < 0) { | ||
| 27 | + DEBUGMSGTL(("mibII/tcpTable", "Failed to connect to netlink: %s\n", nl_geterror(err))); | ||
| 28 | + snmp_log(LOG_ERR, "snmpd: Couldn't connect to netlink: %s\n", nl_geterror(err)); | ||
| 29 | + nl_socket_free(nl); | ||
| 30 | return -1; | ||
| 31 | } | ||
| 32 | |||
| 33 | @@ -579,10 +580,10 @@ | ||
| 34 | struct nl_msg *nm = nlmsg_alloc_simple(TCPDIAG_GETSOCK, NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST); | ||
| 35 | nlmsg_append(nm, &req, sizeof(struct inet_diag_req), 0); | ||
| 36 | |||
| 37 | - if (nl_send_auto_complete(nl, nm) < 0) { | ||
| 38 | - DEBUGMSGTL(("mibII/tcpTable", "nl_send_autocomplete(): %s\n", nl_geterror())); | ||
| 39 | - snmp_log(LOG_ERR, "snmpd: nl_send_autocomplete(): %s\n", nl_geterror()); | ||
| 40 | - nl_handle_destroy(nl); | ||
| 41 | + if ((err = nl_send_auto_complete(nl, nm)) < 0) { | ||
| 42 | + DEBUGMSGTL(("mibII/tcpTable", "nl_send_autocomplete(): %s\n", nl_geterror(err))); | ||
| 43 | + snmp_log(LOG_ERR, "snmpd: nl_send_autocomplete(): %s\n", nl_geterror(err)); | ||
| 44 | + nl_socket_free(nl); | ||
| 45 | return -1; | ||
| 46 | } | ||
| 47 | nlmsg_free(nm); | ||
| 48 | @@ -593,9 +594,9 @@ | ||
| 49 | |||
| 50 | while (running) { | ||
| 51 | if ((len = nl_recv(nl, &peer, &buf, NULL)) <= 0) { | ||
| 52 | - DEBUGMSGTL(("mibII/tcpTable", "nl_recv(): %s\n", nl_geterror())); | ||
| 53 | - snmp_log(LOG_ERR, "snmpd: nl_recv(): %s\n", nl_geterror()); | ||
| 54 | - nl_handle_destroy(nl); | ||
| 55 | + DEBUGMSGTL(("mibII/tcpTable", "nl_recv(): %s\n", nl_geterror(len))); | ||
| 56 | + snmp_log(LOG_ERR, "snmpd: nl_recv(): %s\n", nl_geterror(len)); | ||
| 57 | + nl_socket_free(nl); | ||
| 58 | return -1; | ||
| 59 | } | ||
| 60 | |||
| 61 | @@ -644,7 +645,7 @@ | ||
| 62 | free(buf); | ||
| 63 | } | ||
| 64 | |||
| 65 | - nl_handle_destroy(nl); | ||
| 66 | + nl_socket_free(nl); | ||
| 67 | |||
| 68 | if (tcp_head) { | ||
| 69 | DEBUGMSGTL(("mibII/tcpTable", "Loaded TCP Table using netlink\n")); | ||
diff --git a/meta-oe/recipes-extended/net-snmp/net-snmp.inc b/meta-oe/recipes-extended/net-snmp/net-snmp.inc index 159c374bb2..c202751b52 100644 --- a/meta-oe/recipes-extended/net-snmp/net-snmp.inc +++ b/meta-oe/recipes-extended/net-snmp/net-snmp.inc | |||
| @@ -2,12 +2,12 @@ DESCRIPTION = "Various tools relating to the Simple Network Management Protocol" | |||
| 2 | HOMEPAGE = "http://www.net-snmp.org/" | 2 | HOMEPAGE = "http://www.net-snmp.org/" |
| 3 | LICENSE = "BSD" | 3 | LICENSE = "BSD" |
| 4 | 4 | ||
| 5 | DEPENDS = "openssl" | 5 | DEPENDS = "openssl libnl" |
| 6 | RDEPENDS_${PN}-server += "net-snmp-mibs" | 6 | RDEPENDS_${PN}-server += "net-snmp-mibs" |
| 7 | RDEPENDS_${PN}-client += "net-snmp-mibs" | 7 | RDEPENDS_${PN}-client += "net-snmp-mibs" |
| 8 | RDEPENDS_${PN}-dev = "net-snmp-client (= ${EXTENDPV}) net-snmp-server (= ${EXTENDPV})" | 8 | RDEPENDS_${PN}-dev = "net-snmp-client (= ${EXTENDPV}) net-snmp-server (= ${EXTENDPV})" |
| 9 | RRECOMMENDS_${PN}-dbg = "net-snmp-client (= ${EXTENDPV}) net-snmp-server (= ${EXTENDPV})" | 9 | RRECOMMENDS_${PN}-dbg = "net-snmp-client (= ${EXTENDPV}) net-snmp-server (= ${EXTENDPV})" |
| 10 | INC_PR = "r0" | 10 | INC_PR = "r1" |
| 11 | 11 | ||
| 12 | inherit autotools update-rc.d siteinfo | 12 | inherit autotools update-rc.d siteinfo |
| 13 | 13 | ||
diff --git a/meta-oe/recipes-extended/net-snmp/net-snmp_5.7.1.bb b/meta-oe/recipes-extended/net-snmp/net-snmp_5.7.1.bb index 55dd9a6666..9cbc5a81c2 100644 --- a/meta-oe/recipes-extended/net-snmp/net-snmp_5.7.1.bb +++ b/meta-oe/recipes-extended/net-snmp/net-snmp_5.7.1.bb | |||
| @@ -1,9 +1,10 @@ | |||
| 1 | require net-snmp.inc | 1 | require net-snmp.inc |
| 2 | PR = "${INC_PR}.1" | 2 | PR = "${INC_PR}.2" |
| 3 | LIC_FILES_CHKSUM = "file://README;beginline=3;endline=8;md5=7f7f00ba639ac8e8deb5a622ea24634e" | 3 | LIC_FILES_CHKSUM = "file://README;beginline=3;endline=8;md5=7f7f00ba639ac8e8deb5a622ea24634e" |
| 4 | 4 | ||
| 5 | SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \ | 5 | SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \ |
| 6 | file://sync-with-5.7-branch.patch \ | 6 | file://sync-with-5.7-branch.patch \ |
| 7 | file://libnl-3-support.patch \ | ||
| 7 | file://init \ | 8 | file://init \ |
| 8 | file://snmpd.conf \ | 9 | file://snmpd.conf \ |
| 9 | file://snmptrapd.conf" | 10 | file://snmptrapd.conf" |
