[PATCH] Fix NULL ptr dereference.

Fix compile warnings due to changes in netdevice interface.
[PATCH] Dynamic memory allocation for local buffer

to avoid -Wframe-larger-than=1024 warning (risk of stack overflow)
Fix memset size.