comparison cli-tcpfwd.c @ 1123:d7b752525b91

buf_getstring and buf_putstring now use non-unsigned char*
author Matt Johnston <matt@ucc.asn.au>
date Thu, 04 Jun 2015 23:08:50 +0800
parents c45d65392c1a
children 2907c658fa76
comparison
equal deleted inserted replaced
1121:bb3a03feb31f 1123:d7b752525b91
134 134
135 TRACE(("enter send_msg_global_request_remotetcp")) 135 TRACE(("enter send_msg_global_request_remotetcp"))
136 136
137 CHECKCLEARTOWRITE(); 137 CHECKCLEARTOWRITE();
138 buf_putbyte(ses.writepayload, SSH_MSG_GLOBAL_REQUEST); 138 buf_putbyte(ses.writepayload, SSH_MSG_GLOBAL_REQUEST);
139 buf_putstring(ses.writepayload, (const unsigned char *)"tcpip-forward", 13); 139 buf_putstring(ses.writepayload, "tcpip-forward", 13);
140 buf_putbyte(ses.writepayload, 1); /* want_reply */ 140 buf_putbyte(ses.writepayload, 1); /* want_reply */
141 buf_putstring(ses.writepayload, (const unsigned char *)addr, strlen(addr)); 141 buf_putstring(ses.writepayload, addr, strlen(addr));
142 buf_putint(ses.writepayload, port); 142 buf_putint(ses.writepayload, port);
143 143
144 encrypt_packet(); 144 encrypt_packet();
145 145
146 TRACE(("leave send_msg_global_request_remotetcp")) 146 TRACE(("leave send_msg_global_request_remotetcp"))
216 m_list_elem * iter = NULL; 216 m_list_elem * iter = NULL;
217 struct TCPFwdEntry *fwd; 217 struct TCPFwdEntry *fwd;
218 char portstring[NI_MAXSERV]; 218 char portstring[NI_MAXSERV];
219 int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED; 219 int err = SSH_OPEN_ADMINISTRATIVELY_PROHIBITED;
220 220
221 origaddr = (char *)buf_getstring(ses.payload, NULL); 221 origaddr = buf_getstring(ses.payload, NULL);
222 origport = buf_getint(ses.payload); 222 origport = buf_getint(ses.payload);
223 223
224 /* Find which port corresponds. First try and match address as well as port, 224 /* Find which port corresponds. First try and match address as well as port,
225 in case they want to forward different ports separately ... */ 225 in case they want to forward different ports separately ... */
226 for (iter = cli_opts.remotefwds->first; iter; iter = iter->next) { 226 for (iter = cli_opts.remotefwds->first; iter; iter = iter->next) {