[Nodogsplash] add domain in firewall

孙建希 ycsunjane at 163.com
Tue Jan 20 05:17:28 UTC 2015

I am trying to add an extra function in firewall , the domain whitelist e.g.
    FirewallRule allow to www.baidu.com

I use `gethostbyname` and construct a list:
+       struct addrlist_t {                                                    
+               struct in_addr h_addr;
+               struct addrlist_t *next;                                       
+       } *addrhead = NULL, *cur = NULL;

I am working in x86_64,  `sizeof(struct addrlist_t)` return 8 byte, I think here should be 16 byte.
The strange thing is  the pointer of `&cur->h_addr` and `&cur->next` are same.
Then i check `struct addrlist_t` in other program, it works fine.

Can anybody give me some help.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ml.ninux.org/pipermail/nodogsplash/attachments/20150120/4c135180/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: domain.patch
Type: application/octet-stream
Size: 7918 bytes
Desc: not available
URL: <http://ml.ninux.org/pipermail/nodogsplash/attachments/20150120/4c135180/attachment.obj>

More information about the Nodogsplash mailing list