Re: [PATCH dns cache v3 1/2] dnsproxy: Implement A and AAAA DNS record caching.

2011-07-21 Thread Marcel Holtmann
Hi Jukka, > >> +static gboolean cache_check_if_valid(struct cache_data *data, > >> + time_t current_time) > >> +{ > >> + if (data == NULL) > >> + return FALSE; > >> + > >> + if (data->inserted + data->timeout< current_time) > >> + return FALSE; > >> +

Re: [PATCH dns cache v3 1/2] dnsproxy: Implement A and AAAA DNS record caching.

2011-07-21 Thread Jukka Rissanen
Hi Marcel, On 07/21/2011 02:11 PM, Marcel Holtmann wrote: Hi Jukka, + hdr = (void *) (buf + offset); + + hdr->id = id; + hdr->qr = 1; + hdr->rcode = 0; + hdr->ancount = htons(answers); + hdr->nscount = 0; + hdr->arcount = 0; I am still worried about

Re: [PATCH dns cache v3 1/2] dnsproxy: Implement A and AAAA DNS record caching.

2011-07-21 Thread Marcel Holtmann
Hi Jukka, > >> +static void send_cached_response(int sk, unsigned char *buf, int len, > >> + const struct sockaddr *to, socklen_t tolen, > >> + int protocol, int id, uint16_t answers) > >> +{ > >> + struct domain_hdr *hdr; > >> + int err, offset

Re: [PATCH dns cache v3 1/2] dnsproxy: Implement A and AAAA DNS record caching.

2011-07-21 Thread Jukka Rissanen
Hi Marcel, On 07/20/2011 03:45 PM, Marcel Holtmann wrote: Hi Jukka, +static void send_cached_response(int sk, unsigned char *buf, int len, + const struct sockaddr *to, socklen_t tolen, + int protocol, int id, uint16_t answers) +{ +

Re: [PATCH dns cache v3 1/2] dnsproxy: Implement A and AAAA DNS record caching.

2011-07-20 Thread Marcel Holtmann
Hi Jukka, > +static void send_cached_response(int sk, unsigned char *buf, int len, > + const struct sockaddr *to, socklen_t tolen, > + int protocol, int id, uint16_t answers) > +{ > + struct domain_hdr *hdr; > + int err, offset = pro

[PATCH dns cache v3 1/2] dnsproxy: Implement A and AAAA DNS record caching.

2011-07-07 Thread Jukka Rissanen
--- src/dnsproxy.c | 708 +++- 1 files changed, 699 insertions(+), 9 deletions(-) diff --git a/src/dnsproxy.c b/src/dnsproxy.c index 9701343..37e6b1e 100644 --- a/src/dnsproxy.c +++ b/src/dnsproxy.c @@ -32,6 +32,7 @@ #include #include #inc