summaryrefslogtreecommitdiff
path: root/source3/nmbd
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-01-03 06:30:50 +0000
committerAndrew Tridgell <tridge@samba.org>2000-01-03 06:30:50 +0000
commit632b4f806eae15e319b8f62caef5d25634cf720c (patch)
treec80dee43c351194241e6b989d11df5c7050e2ff7 /source3/nmbd
parent8d1d27b43c9b5a8e6252126ccd15054b003b5f28 (diff)
downloadsamba-632b4f806eae15e319b8f62caef5d25634cf720c.tar.gz
samba-632b4f806eae15e319b8f62caef5d25634cf720c.tar.bz2
samba-632b4f806eae15e319b8f62caef5d25634cf720c.zip
added suppport for unexpected udp/138 packets
I also fixed up the lookup_pdc_name() code so that it now works, even with a NT server that insists on replying to udp/138. The method I used to match packets was to use the mailslot string as a datagram ID. The true dgm_id doesn't work as NT doesn't set it correctly. uggh. PS: Jeremy, I had to change your code quite a bit, are you sure this worked with a Samba PDC?? The code looked broken, it got the offsets wrong in the SMB portion of the packet and filled in the IP incorrectly. (This used to be commit 32f66f4ea63038cb4b3785bdf1762abdde076f5d)
Diffstat (limited to 'source3/nmbd')
-rw-r--r--source3/nmbd/nmbd_packets.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/source3/nmbd/nmbd_packets.c b/source3/nmbd/nmbd_packets.c
index 77bdb29816..3bf009f2c2 100644
--- a/source3/nmbd/nmbd_packets.c
+++ b/source3/nmbd/nmbd_packets.c
@@ -1204,7 +1204,6 @@ static BOOL listening(struct packet_struct *p,struct nmb_name *nbname)
/****************************************************************************
Process udp 138 datagrams
****************************************************************************/
-
static void process_dgram(struct packet_struct *p)
{
char *buf;
@@ -1215,20 +1214,22 @@ static void process_dgram(struct packet_struct *p)
/* If we aren't listening to the destination name then ignore the packet */
if (!listening(p,&dgram->dest_name))
{
- DEBUG(5,("process_dgram: ignoring dgram packet sent to name %s from %s\n",
- nmb_namestr(&dgram->dest_name), inet_ntoa(p->ip)));
- return;
+ unexpected_packet(p);
+ DEBUG(5,("process_dgram: ignoring dgram packet sent to name %s from %s\n",
+ nmb_namestr(&dgram->dest_name), inet_ntoa(p->ip)));
+ return;
}
if (dgram->header.msg_type != 0x10 &&
dgram->header.msg_type != 0x11 &&
dgram->header.msg_type != 0x12)
{
- /* Don't process error packets etc yet */
- DEBUG(5,("process_dgram: ignoring dgram packet sent to name %s from IP %s as it is \
- an error packet of type %x\n",
- nmb_namestr(&dgram->dest_name), inet_ntoa(p->ip), dgram->header.msg_type));
- return;
+ unexpected_packet(p);
+ /* Don't process error packets etc yet */
+ DEBUG(5,("process_dgram: ignoring dgram packet sent to name %s from IP %s as it is \
+an error packet of type %x\n",
+ nmb_namestr(&dgram->dest_name), inet_ntoa(p->ip), dgram->header.msg_type));
+ return;
}
buf = &dgram->data[0];
@@ -1275,6 +1276,8 @@ static void process_dgram(struct packet_struct *p)
process_logon_packet(p,buf2,len,NT_LOGON_MAILSLOT);
return;
}
+
+ unexpected_packet(p);
}
/****************************************************************************