Re: [Dnsmasq-discuss] Sending a fake reply to client by dnsmasq

2016-06-14 Thread ravin goyal
Actually I have database which i need to link it with which will decide
what users will be getting the fake reply rather than what they have
queried for.

This will be decided upon the domains they are querying for.
i want a user to get fake reply for a particular domain he is trying to
visit.

Thanks
On 14-Jun-2016 6:41 PM,  wrote:

> On 06/14/2016 08:30 AM, ravin goyal wrote:
>
>> Hi Sir
>>
>> I actually need to do it in code rather than in the conf file itself.
>> Can you tell me that i am making changes at right function and in the
>> right file
>> or should i do something else?
>>
>> I hope you get the idea behind what i am trying to do here
>>
>
> can you be more explicit as to why you need/want to do this and why the
> address lines won't work in your use case?
>
> --
>  NOTE: No off-list assistance is given without prior approval.
>*Please keep mailing list traffic on the list* unless
>private contact is specifically requested and granted.
>
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Sending a fake reply to client by dnsmasq

2016-06-14 Thread wkitty42

On 06/14/2016 08:30 AM, ravin goyal wrote:

Hi Sir

I actually need to do it in code rather than in the conf file itself.
Can you tell me that i am making changes at right function and in the right file
or should i do something else?

I hope you get the idea behind what i am trying to do here


can you be more explicit as to why you need/want to do this and why the address 
lines won't work in your use case?


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Sending a fake reply to client by dnsmasq

2016-06-14 Thread ravin goyal
Hi Sir

I actually need to do it in code rather than in the conf file itself.
Can you tell me that i am making changes at right function and in the right
file or should i do something else?

I hope you get the idea behind what i am trying to do here

thanks in advance

Regards
Ravin

On 14 June 2016 at 17:08, Albert ARIBAUD  wrote:

> Hi Ravin,
>
> Le Tue, 14 Jun 2016 16:30:41 +0530
> ravin goyal  a écrit:
>
> > Hi, I am working on dnsmasq-2.75 and i want to send a fake reply to
> > client when it reqest dnsmasq for answers such that dnsmasq rather
> > than sending the packet contaning the reply it sends the fake reply
> >
> > I tried changing daemon->packet memory location to some random valid
> > memory location in reply_query function of forward.c file since char
> > *packet of daemon struct contains the reply that dnsmasq will forward
> > to client right??
> >
> > But afterwards dnsmasq fails to resppond to any query sent by client?
> > First i tried setting the daemon->packet to NULL then sendmsg failed
> > by giving error
> > "Bad address";
> >
> > Is there way that i can proceed with this? OR I am doing something
> > wrong here
>
> Can you not use address= lines in the standard dnsmasq conf line?
>
> > Regards
> > Ravin
>
> Amicalement,
> --
> Albert.
>
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Sending a fake reply to client by dnsmasq

2016-06-14 Thread Albert ARIBAUD
Hi Ravin,

Le Tue, 14 Jun 2016 16:30:41 +0530
ravin goyal  a écrit:

> Hi, I am working on dnsmasq-2.75 and i want to send a fake reply to
> client when it reqest dnsmasq for answers such that dnsmasq rather
> than sending the packet contaning the reply it sends the fake reply
> 
> I tried changing daemon->packet memory location to some random valid
> memory location in reply_query function of forward.c file since char
> *packet of daemon struct contains the reply that dnsmasq will forward
> to client right??
> 
> But afterwards dnsmasq fails to resppond to any query sent by client?
> First i tried setting the daemon->packet to NULL then sendmsg failed
> by giving error
> "Bad address";
> 
> Is there way that i can proceed with this? OR I am doing something
> wrong here

Can you not use address= lines in the standard dnsmasq conf line?

> Regards
> Ravin

Amicalement,
-- 
Albert.

___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


[Dnsmasq-discuss] Sending a fake reply to client by dnsmasq

2016-06-14 Thread ravin goyal
Hi, I am working on dnsmasq-2.75 and i want to send a fake reply to client
when it reqest dnsmasq for answers such that dnsmasq rather than sending
the packet contaning the reply it sends the fake reply

I tried changing daemon->packet memory location to some random valid memory
location in reply_query function of forward.c file since char *packet of
daemon struct contains the reply that dnsmasq will forward to client right??

But afterwards dnsmasq fails to resppond to any query sent by client?
First i tried setting the daemon->packet to NULL then sendmsg failed by
giving error
"Bad address";

Is there way that i can proceed with this? OR I am doing something wrong
here

Regards
Ravin
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss


Re: [Dnsmasq-discuss] Log to database

2016-06-14 Thread Sergey Nechaev
Hello, 

Logging to a pipe is dangerous, because if no one reads from pipe write system 
call will block after internal kernel buffer is full.
If write is not non-blocking and  is not wrapped into 
poll/select/epoll/whatever else (Normally, log calls are blocking), the whole 
dnsmasq process will stuck.

You can rotate log files more often and process log file after rotation. 
 

-- 
With best regards, 
Sergey Nechaev
> 13 июня 2016 г., в 22:42, Joachim Zobel  написал(а):
> 
> Oooops, logging to a pipe is not supported. Got the point ...
> 
> Sincerely,
> Joachim
> 
> ___
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss@lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss



smime.p7s
Description: S/MIME cryptographic signature
___
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss