diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
index f7a9377..7da02c9 100644
--- a/include/linux/genetlink.h
+++ b/include/linux/genetlink.h
@@ -39,6 +39,9 @@ enum {
 	CTRL_CMD_NEWOPS,
 	CTRL_CMD_DELOPS,
 	CTRL_CMD_GETOPS,
+	CTRL_CMD_NEWMCAST_GRP,
+	CTRL_CMD_DELMCAST_GRP,
+	CTRL_CMD_GETMCAST_GRP, /* unused */
 	__CTRL_CMD_MAX,
 };
 
@@ -52,6 +55,7 @@ enum {
 	CTRL_ATTR_HDRSIZE,
 	CTRL_ATTR_MAXATTR,
 	CTRL_ATTR_OPS,
+	CTRL_ATTR_MCAST_GROUPS,
 	__CTRL_ATTR_MAX,
 };
 
@@ -66,4 +70,13 @@ enum {
 
 #define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
 
+enum {
+	CTRL_ATTR_MCAST_GRP_UNSPEC,
+	CTRL_ATTR_MCAST_GRP_NAME,
+	CTRL_ATTR_MCAST_GRP_ID,
+	__CTRL_ATTR_MCAST_GRP_MAX,
+};
+
+#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
+
 #endif	/* __LINUX_GENERIC_NETLINK_H */
diff --git a/include/netlink-local.h b/include/netlink-local.h
index 3c50ea0..05b4093 100644
--- a/include/netlink-local.h
+++ b/include/netlink-local.h
@@ -337,7 +337,6 @@ static inline int nl_cb_call(struct nl_cb *cb, int type, struct nl_msg *msg)
 }
 
 #define ARRAY_SIZE(X) (sizeof(X) / sizeof((X)[0]))
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
 
 #define __init __attribute__ ((constructor))
 #define __exit __attribute__ ((destructor))
diff --git a/lib/Makefile b/lib/Makefile
index 0bf8af7..c6e73c5 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -1,76 +1,29 @@
-#
-# lib/Makefile
-#
-# 	This library is free software; you can redistribute it and/or
-#	modify it under the terms of the GNU Lesser General Public
-#	License as published by the Free Software Foundation version 2.1
-#	of the License.
-#
-# Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
-#
-
-ifeq ($(shell [ ! -r ../Makefile.opts ] && echo 1),)
-    include ../Makefile.opts
-endif
-
-# Core
-CIN      := $(wildcard *.c)
-# NETLINK_ROUTE
-CIN      += $(wildcard route/*.c)
-# Schedulers
-CIN      += $(wildcard route/sch/*.c)
-# Classifiers
-CIN      += $(wildcard route/cls/*.c)
-# Link Info Modules
-CIN      += $(wildcard route/link/*.c)
-# NETLINK_GENERIC
-CIN      += $(wildcard genl/*.c)
-# fib lookup
-CIN      += $(wildcard fib_lookup/*.c)
-# Netfilter
-CIN      += $(wildcard netfilter/*.c)
-
-DEPS     := $(CIN:%.c=%.d)
-OBJ      := $(CIN:%.c=%.o)
-CFLAGS   += -fPIC
-OUT_SLIB := $(PACKAGE_NAME).so.$(PACKAGE_VERSION)
-LN_SLIB  := $(PACKAGE_NAME).so
-LN1_SLIB := $(LN_SLIB).1
-
-export
-
-.PHONY: all clean install librtn.a $(OUT_SLIB)
-
-
-all:
-	@echo "  MAKE $(OUT_SLIB)"; \
-	$(MAKE) $(OUT_SLIB)
-
-$(OUT_SLIB): ../Makefile.opts $(OBJ)
-	@echo "  LD $(OUT_SLIB)"; \
-	$(CC) -shared -Wl,-soname,libnl.so.1 -o $(OUT_SLIB) $(OBJ) $(LIBNL_LIB) -lc
-	@echo "  LN $(OUT_SLIB) $(LN1_SLIB)"; \
-	rm -f $(LN1_SLIB) ; $(LN) -s $(OUT_SLIB) $(LN1_SLIB)
-	@echo "  LN $(LN1_SLIB) $(LN_SLIB)"; \
-	rm -f $(LN_SLIB) ; $(LN) -s $(LN1_SLIB) $(LN_SLIB)
-
-clean:
-	@echo "  CLEAN lib"; \
-	$(RM) -f $(OBJ) $(OUT_SLIB) $(LN_SLIB) $(LN1_SLIB); \
-	$(RM) -f $(DEPS) $(OUT_SLIB) $(LN_SLIB) $(LN1_SLIB)
-
-distclean:
-	@echo "  DISTCLEAN lib"; \
-	$(RM) -f $(DEPS)
-
-install:
-	mkdir -p $(DESTDIR)$(libdir)/
-	install -m 0644 $(OUT_SLIB) $(DESTDIR)$(libdir)
-	rm -f $(DESTDIR)$(libdir)/$(LN1_SLIB)
-	$(LN) -s $(OUT_SLIB) $(DESTDIR)$(libdir)/$(LN1_SLIB)
-	rm -f $(DESTDIR)$(libdir)/$(LN_SLIB)
-	$(LN) -s $(LN1_SLIB) $(DESTDIR)$(libdir)/$(LN_SLIB)
-
-$(DEPS): ../Makefile.opts
-
-include ../Makefile.rules
+ANDROID=/home/bob/ext/mydroid/
+ANDROID_OBJ=$(ANDROID)/out/target/product/dream/obj/
+ANDROID_LIB=$(ANDROID_OBJ)/lib
+TOOLCHAIN=$(ANDROID)/prebuilt/linux-x86/toolchain/arm-eabi-4.3.1
+BIONIC=$(ANDROID)/bionic
+
+CC=$(TOOLCHAIN)/bin/arm-eabi-gcc
+WFLAGS=-Wall
+CFLAGS = -mabi=aapcs-linux -DWPA_IGNORE_CONFIG_ERRORS -D__linux__
+INCLUDES=-I../include \
+ -I$(BIONIC)/libc/include \
+ -I$(BIONIC)/libc/arch-arm/include \
+ -I$(BIONIC)/libc/kernel/common \
+ -I$(BIONIC)/libc/kernel/arch-arm \
+ -I$(BIONIC)/libm/include \
+ -I$(ANDROID)/external/openssl/include
+
+LIBNAME=libnl.so
+
+all: $(LIBNAME)
+
+%.o: %.c
+	$(CC) $(WFLAGS) -c -o $@ $(INCLUDES) $(CFLAGS) $<
+
+LIBNL_OBJ=addr.o attr.o cache.o cache_mngr.o cache_mngt.o data.o doc.o family.o handlers.o msg.o nl.o object.o socket.o utils.o
+GENL_OBJ=genl/genl.o genl/ctrl.o genl/genl.o genl/mngt.o genl/family.o
+
+$(LIBNAME): $(LIBNL_OBJ) $(GENL_OBJ)
+	$(CC) -nostdlib -shared -o $@ $^
