netbios registration and release response packets were being junked. a
[samba.git] / source / namepacket.c
index cd133d0a53bac6c3d5a7d3ebd675114dd7610d89..e6677ee10dae9b2f0a22bafa0f9f504b6f15af88 100644 (file)
@@ -394,12 +394,17 @@ static void process_nmb(struct packet_struct *p)
     case NMB_REG:
     case NMB_REG_REFRESH:
     {
-       if (nmb->header.qdcount==0 || nmb->header.arcount==0) break;
        if (nmb->header.response)
+        {
+          if (nmb->header.ancount ==0) break;
          response_netbios_packet(p); /* response to registration dealt 
                                         with here */
+        }
        else
+        {
+          if (nmb->header.qdcount==0 || nmb->header.arcount==0) break;
          reply_name_reg(p);
+        }
        break;
     }
       
@@ -439,17 +444,17 @@ static void process_nmb(struct packet_struct *p)
       
     case NMB_REL:
     {
-      if (nmb->header.qdcount==0 || nmb->header.arcount==0)
-         {
-           DEBUG(2,("netbios release packet rejected\n"));
-           break;
-         }
-       
        if (nmb->header.response)
-         response_netbios_packet(p); /* response to reply dealt with 
-                                        in here */
+        {
+          if (nmb->header.ancount ==0) break;
+         response_netbios_packet(p); /* response to release dealt 
+                                        with here */
+        }
        else
+        {
+          if (nmb->header.qdcount==0 || nmb->header.arcount==0) break;
          reply_name_release(p);
+        }
       break;
     }
   }