|
Lines 287-292
ssh_create_socket(int privileged, struct addrinfo *ai)
Link Here
|
| 287 |
fcntl(sock, F_SETFD, FD_CLOEXEC); |
287 |
fcntl(sock, F_SETFD, FD_CLOEXEC); |
| 288 |
|
288 |
|
| 289 |
if (options.rdomain != NULL) { |
289 |
if (options.rdomain != NULL) { |
|
|
290 |
#if defined(SO_RTABLE) |
| 290 |
int rtable; |
291 |
int rtable; |
| 291 |
const char *errstr; |
292 |
const char *errstr; |
| 292 |
|
293 |
|
|
Lines 306-311
ssh_create_socket(int privileged, struct addrinfo *ai)
Link Here
|
| 306 |
return -1; |
307 |
return -1; |
| 307 |
} |
308 |
} |
| 308 |
debug("Bound to routing domain: %d", rtable); |
309 |
debug("Bound to routing domain: %d", rtable); |
|
|
310 |
#elif defined(SO_BINDTODEVICE) |
| 311 |
if (setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, |
| 312 |
options.rdomain, strlen(options.rdomain)) == -1) { |
| 313 |
error("Failed to bind to device %s on fd %d: %s", |
| 314 |
options.rdomain, sock, strerror(errno)); |
| 315 |
close(sock); |
| 316 |
return -1; |
| 317 |
} |
| 318 |
debug("Bound to device: %s", options.rdomain); |
| 319 |
#else |
| 320 |
error("No SO_RTABLE nor SO_BINDTODEVICE, cannot use: %s", |
| 321 |
options.rdomain); |
| 322 |
close(sock); |
| 323 |
return -1; |
| 324 |
#endif |
| 309 |
} |
325 |
} |
| 310 |
|
326 |
|
| 311 |
|
327 |
|
| 312 |
- |
|
|