From 632b4f806eae15e319b8f62caef5d25634cf720c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 3 Jan 2000 06:30:50 +0000 Subject: 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) --- source3/include/proto.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 2c2bcd71c1..92a57c0950 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -626,7 +626,9 @@ BOOL nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2); int build_packet(char *buf, struct packet_struct *p); BOOL send_packet(struct packet_struct *p); struct packet_struct *receive_packet(int fd,enum packet_type type,int t); -struct packet_struct *receive_reply_packet(int fd, int t, int trn_id); +struct packet_struct *receive_nmb_packet(int fd, int t, int trn_id); +struct packet_struct *receive_dgram_packet(int fd, int t, char *mailslot_name); +BOOL match_mailslot_name(struct packet_struct *p, char *mailslot_name); void sort_query_replies(char *data, int n, struct in_addr ip); /*The following definitions come from libsmb/nterr.c */ @@ -682,7 +684,7 @@ char *smb_errstr(char *inbuf); void unexpected_packet(struct packet_struct *p); void clear_unexpected(time_t t); -struct packet_struct *receive_unexpected_137(int trn_id); +struct packet_struct *receive_unexpected(enum packet_type packet_type, int id, char *mailslot_name); /*The following definitions come from locking/locking.c */ -- cgit