Do not build the session request if it si not used anyway
authorVolker Lendecke <vl@samba.org>
Sun, 30 Nov 2008 11:30:00 +0000 (12:30 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 30 Nov 2008 11:31:04 +0000 (12:31 +0100)
source3/libsmb/cliconnect.c

index b0fdc9920b1eccc816a719b8e5124102df40b1a4..8b7ac7d718496812c878fc6ddc4226dc14f936c6 100644 (file)
@@ -1397,6 +1397,10 @@ bool cli_session_request(struct cli_state *cli,
        char *p;
        int len = 4;
 
+       /* 445 doesn't have session request */
+       if (cli->port == 445)
+               return True;
+
        memcpy(&(cli->calling), calling, sizeof(*calling));
        memcpy(&(cli->called ), called , sizeof(*called ));
 
@@ -1410,10 +1414,6 @@ bool cli_session_request(struct cli_state *cli,
        name_mangle(cli->calling.name, p, cli->calling.name_type);
        len += name_len(p);
 
-       /* 445 doesn't have session request */
-       if (cli->port == 445)
-               return True;
-
        /* send a session request (RFC 1002) */
        /* setup the packet length
          * Remove four bytes from the length count, since the length