Paradox using FreeSwan and hostap_cs

John Fulmer jfulmer at hrblock.com
Tue Apr 1 12:25:18 EST 2003


I've had a hostap_cs based access point for some time now, and instead
of worrying about WEP, I've been using a FreeSwan based IPSEC vpn for
all my wireless traffic. 

In general it works well, but I have had a horrible time sometimes with
my startup/shutdown scripts when the PCMCIA card is ejected.

I recently purchased a Zaurus and Linksys card, and wanted it to play
nice with my Hostap access point...vpn and all. I installed OpenZaurus
2.3, and to my surprise, it also uses the Hostap driver in managed mode.

I installed FreeSwan and got it working, no problems there. What I did
find, however, is that when I pull the wireless card, cardmgr never
calls the shutdown scripts I have set up to bring down the network and
Freeswan drivers.

I believe I've tracked it down to the hostap_cs driver. In syslog, I get
the following:

klogd: hostap_cs: CS_EVENT_CARD_REMOVAL
klogd: sa1100_pcmcia_init(0)
klogd: prism2_release
klogd: hostap_cs: release postponed, 'wlan0' still open


And the the pcmcia drivers grind to a halt, until I manually stop the
Freeswan driver (ipsec0 device). At that point, cardmgr is called and
everything shuts down.

What I believe is happening is that the ipsec0 device keeps wlan0 open
and this section of hostap_cs.c puts the driver into standby mode until
wlan0 is released:


<SNIP!>
        if (link->open) {
                printk("%s: release postponed, '%s' still open\n",
                      dev_info, link->dev->dev_name);
                link->state |= DEV_STALE_CONFIG;
                return;
        }
<SNIP!>

So I have a paradox. I need cardmgr to shut down Freeswan (ipsec0) to
free up wlan0 so the driver can be unloaded, but that can't happen until
wlan0 is released by Freeswan.

Is this expected behavior? Any ideas on how to work around this?

Thanks,

jf

-- 
John Fulmer <jfulmer at hrblock.com>



More information about the HostAP mailing list