Bug 7166

Summary: hostapd: segfault when using RT5370
Product: buildroot Reporter: Jonathan <jmavermeulen>
Component: OtherAssignee: unassigned
Status: VERIFIED FIXED    
Severity: normal CC: buildroot, jmavermeulen
Priority: P5    
Version: 2014.05   
Target Milestone: ---   
Hardware: Macintosh   
OS: Linux   
Host: Target:
Build:

Description Jonathan 2014-06-04 03:00:21 UTC
hostapd crashes with segfault when using RT5370. This is because the driver reports Beacon RX prior to hostapd having completed the AP mode setup. This bug is reported and fixed here: http://hostap.epitest.fi/cgit/hostap/commit/?id=334ec001bbd31c5bc83d6593e58dfbbf6b8785a2

I changed the source and version in the hostapd package to the mentioned commit on the git repository and everything works again. I don't think however that this is the right way of fixing this. Should I make a patch and file this or something? At least until hostapd is updated?
Comment 1 Peter Korsgaard 2014-06-04 06:45:57 UTC
I don't know much about hostapd, but from the looks of it that patch seems trivial to backport to the 2.1 release, so we could add it as a patch in buildroot until the next hostapd release.

Care to send a patch doing that?
Comment 2 Jonathan 2014-06-04 09:11:33 UTC
(In reply to comment #1)
> I don't know much about hostapd, but from the looks of it that patch seems
> trivial to backport to the 2.1 release, so we could add it as a patch in
> buildroot until the next hostapd release.
> 
> Care to send a patch doing that?

How can I make a patch based on the git diff? I'm really new to working with buildroot and compiling kernel/rootfs in general.
Comment 3 Peter Korsgaard 2014-06-04 21:10:15 UTC
In this particular case it is simple as the commit applies to the 2.1 release without problems, so something like:

git clone git://w1.fi/hostap.git && cd hostapd
git format-patch -s 334ec001bbd^..334ec001bbd
0001-Fix-Beacon-RX-before-AP-setup-completion.patch
cp 0001-*patch /path/to/buildroot/package/hostapd/hostapd-0001-Fix-Beacon-RX-before-AP-setup-completion.patch

I've committed this to git:

http://git.buildroot.net/buildroot/commit/?id=f3a12bc334d4673df

Could you please verify that it solves your issue?
Comment 4 Jonathan 2014-06-05 20:00:03 UTC
Works perfectly!!

Thanks this fixes the issue at least until the next release!
Comment 5 Peter Korsgaard 2014-06-05 20:15:54 UTC
Great to hear. Notice that we have now moved to the recently released 2.2 version in git:

http://git.buildroot.net/buildroot/commit/?id=b912fff5500653856697cf8d339e