Re: Wireless silently disconnects?



On Fri, 2006-03-03 at 13:56 +0100, aj2r ya com wrote:

> This patch work fine for me and "all changes are needed"

Alright, thanks.

Dan, what do you think?  It seems the real issue is that ndiswrapper
doesn't want to be out of IW_MODE_AUTO, not that the set_mode()
operation itself is costly.

> +	if (!strcmp (nm_device_get_driver (NM_DEVICE (self)),
> "ndiswrapper")) {
> +		driver= g_malloc(sizeof(char)*(strlen("ndiswrapper")+1));
> +		driver= strcpy(driver, "ndiswrapper");
> +		}
> +	else if (!strcmp (nm_device_get_driver (NM_DEVICE (self)),
> "ath_pci")) {
> +		driver= g_malloc(sizeof(char)*(strlen("madwifi")+1));
> +		driver= strcpy(driver, "madwifi");
> +		}
> +	else {
> +		driver= g_malloc(sizeof(char)*(strlen("wext")+1));
> +		driver= strcpy(driver, "wext");
> +		}
> +

aj2r, just as an FYI, you don't need dynamic allocations here.

	const char *driver = "madwifi";

is sufficient.  As it stands, this code allocates both a static
character array and a dynamic one.  Just a tip ;-)

	Robert Love





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]