summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-03-02 09:43:19 +0100
committerVolker Lendecke <vl@samba.org>2008-03-08 12:31:21 +0100
commit8da1e033a876ab273bf4949535b31817585a953d (patch)
tree1e3a7841139ec4f2768a3c15463f3bfd47f30305
parent6a2dbea79433465518a47a275f3ed5fbaa887c1e (diff)
downloadsamba-8da1e033a876ab273bf4949535b31817585a953d.tar.gz
samba-8da1e033a876ab273bf4949535b31817585a953d.tar.bz2
samba-8da1e033a876ab273bf4949535b31817585a953d.zip
Pass specific packets to build_nmb and build_dgram
To me it was not clear what parts of struct packet_struct are actually used in build_packet(). This makes it a bit more clear that only the specific parts are used. (This used to be commit eb8b6f2404e49d6a837935c5b411d78fb6ff23ef)
-rw-r--r--source3/libsmb/nmblib.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index 15a9a93ff2..bfe5e7b97b 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -849,9 +849,8 @@ static bool send_udp(int fd,char *buf,int len,struct in_addr ip,int port)
If buf == NULL this is a length calculation.
******************************************************************/
-static int build_dgram(char *buf, size_t len, struct packet_struct *p)
+static int build_dgram(char *buf, size_t len, struct dgram_packet *dgram)
{
- struct dgram_packet *dgram = &p->packet.dgram;
unsigned char *ubuf = (unsigned char *)buf;
int offset=0;
@@ -926,9 +925,8 @@ bool nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2)
If buf == NULL this is a length calculation.
******************************************************************/
-static int build_nmb(char *buf, size_t len, struct packet_struct *p)
+static int build_nmb(char *buf, size_t len, struct nmb_packet *nmb)
{
- struct nmb_packet *nmb = &p->packet.nmb;
unsigned char *ubuf = (unsigned char *)buf;
int offset=0;
@@ -1058,11 +1056,11 @@ int build_packet(char *buf, size_t buflen, struct packet_struct *p)
switch (p->packet_type) {
case NMB_PACKET:
- len = build_nmb(buf,buflen,p);
+ len = build_nmb(buf,buflen,&p->packet.nmb);
break;
case DGRAM_PACKET:
- len = build_dgram(buf,buflen,p);
+ len = build_dgram(buf,buflen,&p->packet.dgram);
break;
}