[isf-wifidog] Gateway development

acv acv at miniguru.ca
Lun 14 Nov 22:47:26 EST 2011


On Mon, Nov 14, 2011 at 08:35:01PM -0600, David Young wrote:
> 
> I'm curious whether that evaluates www.google.com once to a set of IP
> addresses, or whether it re-evaluates when the TTL of the original
> evaluation changes?  I ask because I would not expect www.google.com to
> constantly evaluate to a single set of IP addresses, or for the same IP
> addresses to stay continuously in service.

	It's resolved when the command is loaded. So yeah, not garanteed
to work as avertised, but I think it's wrong of wifidog to for IPs.

> I think that you can write that more simply as the following:
> 
>                  for (i = 0; mask[i] != '\0'; i++)
>                         if (!isdigit((unsigned char)mask[i]) && mask[i] != '.'
>                                         && mask[i] != '/')
>                                 all_nums = 0; /*< No longer only digits */
>                 if (!all_nums) {
>                         debug(LOG_ERR, "Invalid mask %s", mask);
>                         return -3; /*< Fail */
>                 }

	Probably true. I don't find the *pointer notation much harder to
read however.

> Or more simply still:
> 
>                 if (strspn(mask, "./0123456789") != strlen(mask)) {
>                         debug(LOG_ERR, "Invalid mask %s", mask);
>                         return -3; /*< Fail */
>                 }

	That might be better if I revisit that code again, I might go that way.
Didn't know that function.

	At the moment I got the following two goals:

1. Try to remove / minimize the various race conditions on mutexes (the old code
has quite a few dodgy "let's unlock the mutex for this network operation" section)

2. Refactor all the code so that I can implement the features from Protocol V1.5,
this is especially significant in the counter updating code where it was a giant
loop on the client linked-list, dropping and re-acquiring the mutex a few times
per iterations.

Alex

> Dave
> 
> -- 
> David Young
> dyoung at pobox.com    Urbana, IL    (217) 721-9981
> _______________________________________________
> WiFiDog mailing list
> WiFiDog at listes.ilesansfil.org
> http://listes.ilesansfil.org/cgi-bin/mailman/listinfo/wifidog
-------------- section suivante --------------
Une pièce jointe autre que texte a été nettoyée...
Nom: non disponible
Type: application/pgp-signature
Taille: 195 octets
Desc: non disponible
URL: <http://listes.ilesansfil.org/pipermail/wifidog/attachments/20111114/bee12212/attachment.pgp>


Plus d'informations sur la liste de diffusion WiFiDog