Greetings,

First of all, thanks for the great project! It's is incredibly versatile
and flexible. Please find the attached patch for your consideration. In
our use of dnsmasq, it is important to know on which interface of
several a lease was issued. The patch adds the interface name to the
leases file. 

Signed off by: db...@powercloudsystems.com

Cheers,
David

diff --git a/src/lease.c b/src/lease.c
index 7982476..9d08d70 100644
--- a/src/lease.c
+++ b/src/lease.c
@@ -221,6 +221,7 @@ void lease_update_file(time_t now)
       
       for (lease = leases; lease; lease = lease->next)
 	{
+	  char devname[IF_NAMESIZE+1];
 
 #ifdef HAVE_DHCP6
 	  if (lease->flags & (LEASE_TA | LEASE_NA))
@@ -251,10 +252,12 @@ void lease_update_file(time_t now)
 	    {
 	      for (i = 0; i < lease->clid_len - 1; i++)
 		ourprintf(&err, "%.2x:", lease->clid[i]);
-	      ourprintf(&err, "%.2x\n", lease->clid[i]);
+	      ourprintf(&err, "%.2x", lease->clid[i]);
 	    }
 	  else
-	    ourprintf(&err, "*\n");	  
+            ourprintf(&err, "*");         
+
+	  ourprintf(&err, " %s\n", if_indextoname(lease->last_interface, devname));
 	}
       
 #ifdef HAVE_DHCP6  
_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

Reply via email to