comparison svr-agentfwd.c @ 1460:58a74cb829b8

Pointer parameter could be declared as pointing to const (callback)
author Francois Perrad <francois.perrad@gadz.org>
date Sat, 19 Aug 2017 22:39:53 +0200
parents 06d52bcb8094
children 79eef94ccea9
comparison
equal deleted inserted replaced
1459:06d52bcb8094 1460:58a74cb829b8
43 43
44 #define AGENTDIRPREFIX "/tmp/dropbear-" 44 #define AGENTDIRPREFIX "/tmp/dropbear-"
45 45
46 static int send_msg_channel_open_agent(int fd); 46 static int send_msg_channel_open_agent(int fd);
47 static int bindagent(int fd, struct ChanSess * chansess); 47 static int bindagent(int fd, struct ChanSess * chansess);
48 static void agentaccept(struct Listener * listener, int sock); 48 static void agentaccept(const struct Listener * listener, int sock);
49 49
50 /* Handles client requests to start agent forwarding, sets up listening socket. 50 /* Handles client requests to start agent forwarding, sets up listening socket.
51 * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ 51 * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */
52 int svr_agentreq(struct ChanSess * chansess) { 52 int svr_agentreq(struct ChanSess * chansess) {
53 int fd = -1; 53 int fd = -1;
98 } 98 }
99 99
100 /* accepts a connection on the forwarded socket and opens a new channel for it 100 /* accepts a connection on the forwarded socket and opens a new channel for it
101 * back to the client */ 101 * back to the client */
102 /* returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ 102 /* returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */
103 static void agentaccept(struct Listener *UNUSED(listener), int sock) { 103 static void agentaccept(const struct Listener *UNUSED(listener), int sock) {
104 104
105 int fd; 105 int fd;
106 106
107 fd = accept(sock, NULL, NULL); 107 fd = accept(sock, NULL, NULL);
108 if (fd < 0) { 108 if (fd < 0) {