~ubuntu-branches/ubuntu/utopic/dropbear/utopic-proposed

« back to all changes in this revision

Viewing changes to cli-tcpfwd.c

  • Committer: Bazaar Package Importer
  • Author(s): Gerrit Pape, Matt Johnston, Gerrit Pape
  • Date: 2008-11-19 20:58:59 UTC
  • mfrom: (1.4.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: james.westby@ubuntu.com-20081119205859-dmeze0y6b16ia93v
Tags: 0.52-1
[ Matt Johnston ]
* New upstream release.
  * dbclient.1: mention optional 'command' argument (closes: #495823).

[ Gerrit Pape ]
* debian/diff/0001-dbclient.1-dbclient-uses-compression-if...diff:
  new; dbclient.1: dbclient uses compression if compiled with zlib
  support (thx Luca Capello, closes: #495825).
* debian/initramfs/*: new; cryptroot remote unlocking on boot feature
  (thx debian@x.ray.net).
* debian/rules: install debian/initramfs/* (thx debian@x.ray.net).
* debian/control: Suggests: udev (for cryptroot support, thx
  debian@x.ray.net).
* debian/dropbear.postinst: conditionally run update-initramfs -u
  (for cryptroot support, thx debian@x.ray.net. closes: #465903).
* debian/diff/0002-dropbearkey.8-mention-y-option-add-example.diff:
  new; mention -y option, add example (thx debian@x.ray.net).

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
        CHECKCLEARTOWRITE();
129
129
        buf_putbyte(ses.writepayload, SSH_MSG_GLOBAL_REQUEST);
130
130
        buf_putstring(ses.writepayload, "tcpip-forward", 13);
131
 
        buf_putbyte(ses.writepayload, 0);
 
131
        buf_putbyte(ses.writepayload, 1); /* want_reply */
132
132
        if (opts.listen_fwd_all) {
133
133
                listenspec = "";
134
134
        } else {
143
143
        TRACE(("leave send_msg_global_request_remotetcp"))
144
144
}
145
145
 
 
146
/* The only global success/failure messages are for remotetcp.
 
147
 * Since there isn't any identifier in these messages, we have to rely on them
 
148
 * being in the same order as we sent the requests. This is the ordering
 
149
 * of the cli_opts.remotefwds list */
 
150
void cli_recv_msg_request_success() {
 
151
 
 
152
        /* Nothing in the packet. We just mark off that we have received the reply,
 
153
         * so that we can report failure for later ones. */
 
154
        struct TCPFwdList * iter = NULL;
 
155
 
 
156
        iter = cli_opts.remotefwds;
 
157
        while (iter != NULL) {
 
158
                if (!iter->have_reply)
 
159
                {
 
160
                        iter->have_reply = 1;
 
161
                        return;
 
162
                }
 
163
                iter = iter->next;
 
164
        }
 
165
}
 
166
 
 
167
void cli_recv_msg_request_failure() {
 
168
        struct TCPFwdList * iter = NULL;
 
169
 
 
170
        iter = cli_opts.remotefwds;
 
171
        while (iter != NULL) {
 
172
                if (!iter->have_reply)
 
173
                {
 
174
                        iter->have_reply = 1;
 
175
                        dropbear_log(LOG_WARNING, "Remote TCP forward request failed (port %d -> %s:%d)", iter->listenport, iter->connectaddr, iter->connectport);
 
176
                        return;
 
177
                }
 
178
                iter = iter->next;
 
179
        }
 
180
}
 
181
 
146
182
void setup_remotetcp() {
147
183
 
148
184
        struct TCPFwdList * iter = NULL;