1 diff -ruN busybox-1.2.0-old/networking/telnetd.c busybox-1.2.0-new/networking/telnetd.c
2 --- busybox-1.2.0-old/networking/telnetd.c 2006-07-01 00:42:02.000000000 +0200
3 +++ busybox-1.2.0-new/networking/telnetd.c 2006-07-31 10:52:30.000000000 +0200
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 bb_xbind(master_fd, (struct sockaddr *) &sa, sizeof(sa));
50 bb_xlisten(master_fd, 1);