summaryrefslogtreecommitdiff
path: root/packages/net-tools/files/net-tools-1.60-bcast.patch
diff options
context:
space:
mode:
authorDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
committerDenys Dmytriyenko <denis@denix.org>2009-03-17 14:32:59 -0400
commit709c4d66e0b107ca606941b988bad717c0b45d9b (patch)
tree37ee08b1eb308f3b2b6426d5793545c38396b838 /packages/net-tools/files/net-tools-1.60-bcast.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
rename packages/ to recipes/ per earlier agreement
See links below for more details: http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326 http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816 Signed-off-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Mike Westerhof <mwester@dls.net> Acked-by: Philip Balister <philip@balister.org> Acked-by: Khem Raj <raj.khem@gmail.com> Acked-by: Marcin Juszkiewicz <hrw@openembedded.org> Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'packages/net-tools/files/net-tools-1.60-bcast.patch')
-rw-r--r--packages/net-tools/files/net-tools-1.60-bcast.patch99
1 files changed, 0 insertions, 99 deletions
diff --git a/packages/net-tools/files/net-tools-1.60-bcast.patch b/packages/net-tools/files/net-tools-1.60-bcast.patch
deleted file mode 100644
index 9489e26352..0000000000
--- a/packages/net-tools/files/net-tools-1.60-bcast.patch
+++ /dev/null
@@ -1,99 +0,0 @@
---- net-tools-1.60/ifconfig.c.broadcast 2004-11-03 12:05:30.000000000 +0100
-+++ net-tools-1.60/ifconfig.c 2004-11-04 15:39:32.817077232 +0100
-@@ -36,6 +36,7 @@
- #include <sys/ioctl.h>
- #include <netinet/in.h>
- #include <net/if.h>
-+#include <netinet/ip.h>
- #include <net/if_arp.h>
- #include <stdio.h>
- #include <errno.h>
-@@ -138,6 +139,7 @@
- perror("SIOCSIFFLAGS");
- return -1;
- }
-+
- return (0);
- }
-
-@@ -212,17 +214,41 @@
- exit(0);
- }
-
--static int set_netmask(int skfd, struct ifreq *ifr, struct sockaddr *sa)
-+static int set_netmask(int skfd, struct ifreq *ifr, struct sockaddr *sa, int new_bcast)
- {
- int err = 0;
--
-- memcpy((char *) &ifr->ifr_netmask, (char *) sa,
-- sizeof(struct sockaddr));
-+ struct sockaddr_in * ip_addr, * netmask, *bcast;
-+ struct ifreq ifraddr;
-+ struct ifreq ifrbcast;
-+
-+ memcpy((char *) &ifr->ifr_netmask, (char *) sa,
-+ sizeof(struct sockaddr));
- if (ioctl(skfd, SIOCSIFNETMASK, ifr) < 0) {
- fprintf(stderr, "SIOCSIFNETMASK: %s\n",
- strerror(errno));
- err = 1;
- }
-+
-+ if (new_bcast) {
-+ memcpy(&ifraddr,ifr,sizeof(struct ifreq));
-+ memcpy(&ifrbcast,ifr,sizeof(struct ifreq));
-+
-+ if (ioctl(skfd, SIOCGIFADDR, &ifraddr) < 0) {
-+ fprintf(stderr, "SIOCGIFADDR: %s\n", strerror(errno));
-+ err = 1;
-+ }
-+
-+ ip_addr = (struct sockaddr_in *)&ifraddr.ifr_addr;
-+ netmask = (struct sockaddr_in *)&ifr->ifr_netmask;
-+ bcast = (struct sockaddr_in *)&ifrbcast.ifr_broadaddr;
-+ /* calculate new broadcast adress */
-+ bcast->sin_addr.s_addr = ip_addr->sin_addr.s_addr | ~netmask->sin_addr.s_addr;
-+ /* set new broadcast adress */
-+ if (ioctl(skfd, SIOCSIFBRDADDR, &ifrbcast) < 0) {
-+ fprintf(stderr, "SIOCSIFBROADCAST: %s\n", strerror(errno));
-+ err = 1;
-+ }
-+ }
- return 0;
- }
-
-@@ -234,7 +260,7 @@
- struct aftype *ap;
- struct hwtype *hw;
- struct ifreq ifr;
-- int goterr = 0, didnetmask = 0, donetmask = 0;
-+ int goterr = 0, didnetmask = 0, donetmask = 0, dobcast = 1;
- char **spp;
- int fd;
- #if HAVE_AFINET6
-@@ -506,6 +532,7 @@
- strerror(errno));
- goterr = 1;
- }
-+ dobcast = 0;
- spp++;
- }
- goterr |= set_flag(ifr.ifr_name, IFF_BROADCAST);
-@@ -542,7 +569,7 @@
- continue;
- }
- didnetmask++;
-- goterr = set_netmask(ap->fd, &ifr, &sa);
-+ goterr = set_netmask(ap->fd, &ifr, &sa, dobcast);
- spp++;
- continue;
- }
-@@ -964,7 +991,7 @@
- /* set CIDR netmask */
- if (donetmask) {
- donetmask = 0;
-- goterr = set_netmask(skfd, &ifr, &sa_netmask);
-+ goterr = set_netmask(skfd, &ifr, &sa_netmask, dobcast);
- didnetmask++;
- }
-