Index: /tools/gformat.py
===================================================================
--- /tools/gformat.py	(revision 13733)
+++ /tools/gformat.py	(revision 13734)
@@ -529,4 +529,5 @@
     return '\n'.join(map(lambda x: ' ' * count + x, text.split('\n')))
 
+  # Process DHCP blocks
   dhcp_out = defaultdict(list)
   for iface_key in get_interface_keys(datadump):
@@ -546,5 +547,5 @@
 
     if dhcp_type(datadump[iface_key]) != DHCP_SERVER:
-      dhcp_out[iface_key].append(textwrap.dedent("""\
+      dhcp_out[ifname].append(textwrap.dedent("""\
         subnet %(autogen_subnet)s netmask %(autogen_netmask)s {
           ### not autoritive
@@ -562,5 +563,5 @@
       fixed = 5
       for mac in datadump['no_portal']:
-        dhcp_out[iface_key].append(textwrap.dedent("""\
+        dhcp_out[ifname].append(textwrap.dedent("""\
             host fixed-%(ifname)s-%(fixed)s {
               hardware ethernet %(mac)s;
@@ -570,5 +571,5 @@
       fixed += 1
 
-    dhcp_out[iface_key].append(textwrap.dedent("""\
+    dhcp_out[ifname].append(textwrap.dedent("""\
       subnet %(autogen_subnet)s netmask %(autogen_netmask)s {
         range %(autogen_dhcp_start)s %(autogen_dhcp_stop)s;
@@ -578,4 +579,5 @@
       """ % datadump[iface_key]))
 
+  # Output the blocks in groups
   for ifname,value in sorted(dhcp_out.iteritems()):
     if len(value) > 2:
