[Dibbler-devel] Patch for resolv.conf update

MINODIER David RD-RESA-LAN david.minodier at orange-ftgroup.com
Tue Mar 27 10:42:11 CEST 2007

a little patch regarding the update of resolv.conf.
If resolv.conf is not empty before dibbler-client is ran (multiple NICs
for example) :

term1:/etc/dibbler# cat /etc/resolv.conf search xxxx.yyyy.fr nameserver

there are some \n and space problems when dibbler-client has been
returned DNS servers and domains:
term1:/etc/dibbler# cat /etc/resolv.conf search xxxx.yyyy.fr
ligne2.example.comnameserver nameserver 2000::1

And when dibbler-client is stopped, the resolv.conf is bugged:

term1:/etc/dibbler# cat /etc/resolv.conf search xxxx.yyyy.frnameserver

Here's the patch, that should be applied to
It only concerns the Linux-port i'm afraid. I haven't tested the other
platforms at all.
(.ORI is the original dibbler)


2007-03-23 11:22:25.000000000 +0100

2007-03-23 17:39:49.000000000 +0100
@@ -93,7 +93,7 @@ int domain_add(const char* ifname, int i
        if ( (!found) && (strstr(buf, "search")) ) {
            if (strlen(buf))
-           fprintf(f2, "%s %s", buf, domain);
+           fprintf(f2, "%s %s\n", buf, domain);
            found = 1;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_dns_update_resolv.conf.diff
Type: application/octet-stream
Size: 508 bytes
Desc: patch_dns_update_resolv.conf.diff
Url : http://klub.com.pl/pipermail/dibbler-devel/attachments/20070327/e307ac4b/attachment.obj 

More information about the Dibbler-devel mailing list