Merge "Add the du command to toolbox"
diff --git a/libnl_2/genl/genl.c b/libnl_2/genl/genl.c
index 2442993..05431d6 100644
--- a/libnl_2/genl/genl.c
+++ b/libnl_2/genl/genl.c
@@ -21,6 +21,8 @@
 #include <stdio.h>
 #include <sys/time.h>
 #include <linux/netlink.h>
+#include <netlink/genl/ctrl.h>
+#include <netlink/genl/family.h>
 #include "netlink-types.h"
 
 /* Get head of attribute data. */
@@ -250,7 +252,6 @@
 struct genl_family *genl_ctrl_search_by_name(struct nl_cache *cache, \
 					const char *name)
 {
-	/* TODO: When will we release this memory ? */
 	struct genl_family *gf = (struct genl_family *) \
 		malloc(sizeof(struct genl_family));
 	if (!gf)
@@ -262,7 +263,7 @@
 
 	/* Overriding cache pointer as family id for now */
 	gf->gf_id = (uint16_t) ((uint32_t) cache);
-	strcpy(gf->gf_name, "nl80211");
+	strncpy(gf->gf_name, name, GENL_NAMSIZ);
 
 	return gf;
 fail:
@@ -272,15 +273,29 @@
 
 int genl_ctrl_resolve(struct nl_sock *sk, const char *name)
 {
+	struct nl_cache *cache = NULL;
+	struct genl_family *gf = NULL;
+	int id = -1;
+
 	/* Hack to support wpa_supplicant */
 	if (strcmp(name, "nlctrl") == 0)
 		return NETLINK_GENERIC;
-	else {
-		int errsv = errno;
-		fprintf(stderr, \
-			"Only nlctrl supported by genl_ctrl_resolve!\n");
-		return -errsv;
+
+	if (strcmp(name, "nl80211") != 0) {
+		fprintf(stderr, "%s is not supported\n", name);
+		return id;
 	}
 
-}
+	if (!genl_ctrl_alloc_cache(sk, &cache)) {
+		gf = genl_ctrl_search_by_name(cache, name);
+		if (gf)
+			id = genl_family_get_id(gf);
+	}
 
+	if (gf)
+		genl_family_put(gf);
+	if (cache)
+		nl_cache_free(cache);
+
+	return id;
+}
diff --git a/libnl_2/socket.c b/libnl_2/socket.c
index d906cac..e94eb9e 100644
--- a/libnl_2/socket.c
+++ b/libnl_2/socket.c
@@ -127,3 +127,15 @@
 {
 	return sk->s_fd;
 }
+
+void nl_socket_set_cb(struct nl_sock *sk, struct nl_cb *cb)
+{
+	nl_cb_put(sk->s_cb);
+	sk->s_cb = cb;
+	nl_cb_get(cb);
+}
+
+struct nl_cb *nl_socket_get_cb(struct nl_sock *sk)
+{
+	return nl_cb_get(sk->s_cb);
+}
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 24200d0..492158a 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -32,7 +32,7 @@
     export ANDROID_DATA /data
     export ASEC_MOUNTPOINT /mnt/asec
     export LOOP_MOUNTPOINT /mnt/obb
-    export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar
+    export BOOTCLASSPATH /system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar
 
 # Backward compatibility
     symlink /system/etc /etc