1
- /* $OpenBSD: channels.c,v 1.362 2017/05/30 08:49:58 markus Exp $ */
1
+ /* $OpenBSD: channels.c,v 1.363 2017/05/30 14:23:52 markus Exp $ */
2
2
/*
3
3
* Author: Tatu Ylonen <[email protected] >
4
4
* Copyright (c) 1995 Tatu Ylonen <[email protected] >, Espoo, Finland
@@ -2394,9 +2394,8 @@ channel_proxy_downstream(Channel *downstream)
2394
2394
* replaces local (proxy) channel ID with downstream channel ID.
2395
2395
*/
2396
2396
int
2397
- channel_proxy_upstream (Channel * c , int type , u_int32_t seq , void * ctxt )
2397
+ channel_proxy_upstream (Channel * c , int type , u_int32_t seq , struct ssh * ssh )
2398
2398
{
2399
- struct ssh * ssh = active_state ;
2400
2399
struct sshbuf * b = NULL ;
2401
2400
Channel * downstream ;
2402
2401
const u_char * cp = NULL ;
@@ -2476,7 +2475,7 @@ channel_proxy_upstream(Channel *c, int type, u_int32_t seq, void *ctxt)
2476
2475
2477
2476
/* ARGSUSED */
2478
2477
int
2479
- channel_input_data (int type , u_int32_t seq , void * ctxt )
2478
+ channel_input_data (int type , u_int32_t seq , struct ssh * ssh )
2480
2479
{
2481
2480
int id ;
2482
2481
const u_char * data ;
@@ -2488,7 +2487,7 @@ channel_input_data(int type, u_int32_t seq, void *ctxt)
2488
2487
c = channel_lookup (id );
2489
2488
if (c == NULL )
2490
2489
packet_disconnect ("Received data for nonexistent channel %d." , id );
2491
- if (channel_proxy_upstream (c , type , seq , ctxt ))
2490
+ if (channel_proxy_upstream (c , type , seq , ssh ))
2492
2491
return 0 ;
2493
2492
2494
2493
/* Ignore any data for non-open channels (might happen on close) */
@@ -2536,7 +2535,7 @@ channel_input_data(int type, u_int32_t seq, void *ctxt)
2536
2535
2537
2536
/* ARGSUSED */
2538
2537
int
2539
- channel_input_extended_data (int type , u_int32_t seq , void * ctxt )
2538
+ channel_input_extended_data (int type , u_int32_t seq , struct ssh * ssh )
2540
2539
{
2541
2540
int id ;
2542
2541
char * data ;
@@ -2549,7 +2548,7 @@ channel_input_extended_data(int type, u_int32_t seq, void *ctxt)
2549
2548
2550
2549
if (c == NULL )
2551
2550
packet_disconnect ("Received extended_data for bad channel %d." , id );
2552
- if (channel_proxy_upstream (c , type , seq , ctxt ))
2551
+ if (channel_proxy_upstream (c , type , seq , ssh ))
2553
2552
return 0 ;
2554
2553
if (c -> type != SSH_CHANNEL_OPEN ) {
2555
2554
logit ("channel %d: ext data for non open" , id );
@@ -2586,7 +2585,7 @@ channel_input_extended_data(int type, u_int32_t seq, void *ctxt)
2586
2585
2587
2586
/* ARGSUSED */
2588
2587
int
2589
- channel_input_ieof (int type , u_int32_t seq , void * ctxt )
2588
+ channel_input_ieof (int type , u_int32_t seq , struct ssh * ssh )
2590
2589
{
2591
2590
int id ;
2592
2591
Channel * c ;
@@ -2596,7 +2595,7 @@ channel_input_ieof(int type, u_int32_t seq, void *ctxt)
2596
2595
c = channel_lookup (id );
2597
2596
if (c == NULL )
2598
2597
packet_disconnect ("Received ieof for nonexistent channel %d." , id );
2599
- if (channel_proxy_upstream (c , type , seq , ctxt ))
2598
+ if (channel_proxy_upstream (c , type , seq , ssh ))
2600
2599
return 0 ;
2601
2600
chan_rcvd_ieof (c );
2602
2601
@@ -2612,14 +2611,14 @@ channel_input_ieof(int type, u_int32_t seq, void *ctxt)
2612
2611
2613
2612
/* ARGSUSED */
2614
2613
int
2615
- channel_input_oclose (int type , u_int32_t seq , void * ctxt )
2614
+ channel_input_oclose (int type , u_int32_t seq , struct ssh * ssh )
2616
2615
{
2617
2616
int id = packet_get_int ();
2618
2617
Channel * c = channel_lookup (id );
2619
2618
2620
2619
if (c == NULL )
2621
2620
packet_disconnect ("Received oclose for nonexistent channel %d." , id );
2622
- if (channel_proxy_upstream (c , type , seq , ctxt ))
2621
+ if (channel_proxy_upstream (c , type , seq , ssh ))
2623
2622
return 0 ;
2624
2623
packet_check_eom ();
2625
2624
chan_rcvd_oclose (c );
@@ -2628,7 +2627,7 @@ channel_input_oclose(int type, u_int32_t seq, void *ctxt)
2628
2627
2629
2628
/* ARGSUSED */
2630
2629
int
2631
- channel_input_open_confirmation (int type , u_int32_t seq , void * ctxt )
2630
+ channel_input_open_confirmation (int type , u_int32_t seq , struct ssh * ssh )
2632
2631
{
2633
2632
int id , remote_id ;
2634
2633
Channel * c ;
@@ -2639,7 +2638,7 @@ channel_input_open_confirmation(int type, u_int32_t seq, void *ctxt)
2639
2638
if (c == NULL )
2640
2639
packet_disconnect ("Received open confirmation for "
2641
2640
"unknown channel %d." , id );
2642
- if (channel_proxy_upstream (c , type , seq , ctxt ))
2641
+ if (channel_proxy_upstream (c , type , seq , ssh ))
2643
2642
return 0 ;
2644
2643
if (c -> type != SSH_CHANNEL_OPENING )
2645
2644
packet_disconnect ("Received open confirmation for "
@@ -2680,7 +2679,7 @@ reason2txt(int reason)
2680
2679
2681
2680
/* ARGSUSED */
2682
2681
int
2683
- channel_input_open_failure (int type , u_int32_t seq , void * ctxt )
2682
+ channel_input_open_failure (int type , u_int32_t seq , struct ssh * ssh )
2684
2683
{
2685
2684
int id , reason ;
2686
2685
char * msg = NULL , * lang = NULL ;
@@ -2692,7 +2691,7 @@ channel_input_open_failure(int type, u_int32_t seq, void *ctxt)
2692
2691
if (c == NULL )
2693
2692
packet_disconnect ("Received open failure for "
2694
2693
"unknown channel %d." , id );
2695
- if (channel_proxy_upstream (c , type , seq , ctxt ))
2694
+ if (channel_proxy_upstream (c , type , seq , ssh ))
2696
2695
return 0 ;
2697
2696
if (c -> type != SSH_CHANNEL_OPENING )
2698
2697
packet_disconnect ("Received open failure for "
@@ -2719,7 +2718,7 @@ channel_input_open_failure(int type, u_int32_t seq, void *ctxt)
2719
2718
2720
2719
/* ARGSUSED */
2721
2720
int
2722
- channel_input_window_adjust (int type , u_int32_t seq , void * ctxt )
2721
+ channel_input_window_adjust (int type , u_int32_t seq , struct ssh * ssh )
2723
2722
{
2724
2723
Channel * c ;
2725
2724
int id ;
@@ -2733,7 +2732,7 @@ channel_input_window_adjust(int type, u_int32_t seq, void *ctxt)
2733
2732
logit ("Received window adjust for non-open channel %d." , id );
2734
2733
return 0 ;
2735
2734
}
2736
- if (channel_proxy_upstream (c , type , seq , ctxt ))
2735
+ if (channel_proxy_upstream (c , type , seq , ssh ))
2737
2736
return 0 ;
2738
2737
adjust = packet_get_int ();
2739
2738
packet_check_eom ();
@@ -2747,7 +2746,7 @@ channel_input_window_adjust(int type, u_int32_t seq, void *ctxt)
2747
2746
2748
2747
/* ARGSUSED */
2749
2748
int
2750
- channel_input_status_confirm (int type , u_int32_t seq , void * ctxt )
2749
+ channel_input_status_confirm (int type , u_int32_t seq , struct ssh * ssh )
2751
2750
{
2752
2751
Channel * c ;
2753
2752
struct channel_confirm * cc ;
@@ -2763,7 +2762,7 @@ channel_input_status_confirm(int type, u_int32_t seq, void *ctxt)
2763
2762
logit ("channel_input_status_confirm: %d: unknown" , id );
2764
2763
return 0 ;
2765
2764
}
2766
- if (channel_proxy_upstream (c , type , seq , ctxt ))
2765
+ if (channel_proxy_upstream (c , type , seq , ssh ))
2767
2766
return 0 ;
2768
2767
packet_check_eom ();
2769
2768
if ((cc = TAILQ_FIRST (& c -> status_confirms )) == NULL )
0 commit comments