This is a quick tutorial on how to compile the hostap driver with the aircrack-ng injection patch. Everything is done from scratch on a vanilla feisty fawn.
We are going to be doing some kernel compilation, so make sure that at least these two packages are installed on your system: "dpkg-dev" and "linux-kernel-devel" (they are normally not included in the basic distro).
Create a temp directory where we can download the kernel sources and the injection patch:
Create a sub directory to hold the compilation output. Copy your current kernel config onto it:
cp /boot/config-2.6.20-16-generic OutputDir/
ln -s OutputDir/config-2.6.20-16-generic OutputDir/.config
Now get the kernel:
apt-get source linux-image-2.6.20-16-generic
Get the injection patch:
wget -nc http://rsappe.googlepages.com/hostap-kernel-injection-2.6.20-16.patch
or just click here. This is the SAME patch as in http://patches.aircrack-ng.org/hostap-kernel-2.6.18.patch, it's just tailored for 2.6.20-16
Patch the kernel:
patch -p1 < hostap-kernel-injection-2.6.20-16.patch
And compile just the hostap module:
make O=../OutputDir outputmakefile
make O=../OutputDir archprepare
make O=../OutputDir modules SUBDIRS=scripts
make O=../OutputDir modules SUBDIRS=drivers/net/wireless/hostap
The new module should now be ready. We just need to replace the old one (you may want to save a copy somewhere safe):
sudo cp -dpR *.ko /lib/modules/2.6.20-16-generic/kernel/drivers/net/wireless/hostap/
And that's it! Hostap should now support injection and you can start playing with aircrack-ng.