1 diff -ur busybox-1.1.0/networking/telnetd.c busybox-1.1.0-owrt/networking/telnetd.c
2 --- busybox-1.1.0/networking/telnetd.c 2006-01-11 06:43:51.000000000 +0100
3 +++ busybox-1.1.0-owrt/networking/telnetd.c 2006-01-14 17:41:20.000000000 +0100
5 #include <arpa/telnet.h>
7 #include <sys/syslog.h>
13 struct in_addr bind_addr = { .s_addr = 0x0 };
14 #endif /* CONFIG_FEATURE_TELNETD_INETD */
16 + char *interface_name = NULL;
17 + struct ifreq interface;
18 static const char options[] =
19 #ifdef CONFIG_FEATURE_TELNETD_INETD
22 #else /* CONFIG_EATURE_TELNETD_INETD */
25 #endif /* CONFIG_FEATURE_TELNETD_INETD */
33 + interface_name = strdup(optarg);
39 sa.sin_addr = bind_addr;
42 + /* Set it to listen on the specified interface */
43 + if (interface_name) {
44 + strncpy(interface.ifr_ifrn.ifrn_name, interface_name, IFNAMSIZ);
45 + (void)setsockopt(master_fd, SOL_SOCKET,
46 + SO_BINDTODEVICE, &interface, sizeof(interface));
49 if (bind(master_fd, (struct sockaddr *) &sa, sizeof(sa)) < 0) {
50 bb_perror_msg_and_die("bind");