I'm playing with network stack in NetBSD and as a product I've released nettest – the test LKM to get familiarized with the stack. It's simple, it receives packets from userspace and sends them to the another interface and bpf listeners (tcpdump for instance). Everything is on my homepage.
It also contains examples of list queues use and deferred work. Everything in one short file.