aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/net-tools/files/net-tools-1.60-netmask.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 /recipes/net-tools/files/net-tools-1.60-netmask.patch
parentfa6cd5a3b993f16c27de4ff82b42684516d433ba (diff)
downloadopenembedded-709c4d66e0b107ca606941b988bad717c0b45d9b.tar.gz
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 'recipes/net-tools/files/net-tools-1.60-netmask.patch')
-rw-r--r--recipes/net-tools/files/net-tools-1.60-netmask.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/recipes/net-tools/files/net-tools-1.60-netmask.patch b/recipes/net-tools/files/net-tools-1.60-netmask.patch
new file mode 100644
index 0000000000..532898acaf
--- /dev/null
+++ b/recipes/net-tools/files/net-tools-1.60-netmask.patch
@@ -0,0 +1,61 @@
+--- net-tools-1.60/ifconfig.c.netmask 2001-04-13 20:25:18.000000000 +0200
++++ net-tools-1.60/ifconfig.c 2004-11-02 15:31:56.454594456 +0100
+@@ -23,6 +23,7 @@
+ * 20001008 - Bernd Eckenfels, Patch from RH for setting mtu
+ * (default AF was wrong)
+ * 20010404 - Arnaldo Carvalho de Melo, use setlocale
++ * 20040831 - Florin Malita <fmalita@glenayre.com> delayed CIDR netmask
+ */
+
+ #define DFLT_AF "inet"
+@@ -227,13 +228,13 @@
+
+ int main(int argc, char **argv)
+ {
+- struct sockaddr sa;
++ struct sockaddr sa, sa_netmask;
+ struct sockaddr_in sin;
+ char host[128];
+ struct aftype *ap;
+ struct hwtype *hw;
+ struct ifreq ifr;
+- int goterr = 0, didnetmask = 0;
++ int goterr = 0, didnetmask = 0, donetmask = 0;
+ char **spp;
+ int fd;
+ #if HAVE_AFINET6
+@@ -903,16 +904,16 @@
+ /* FIXME: sa is too small for INET6 addresses, inet6 should use that too,
+ broadcast is unexpected */
+ if (ap->getmask) {
+- switch (ap->getmask(host, &sa, NULL)) {
++ switch (ap->getmask(host, &sa_netmask, NULL)) {
+ case -1:
+ usage();
+ break;
+ case 1:
+ if (didnetmask)
+ usage();
+-
+- goterr = set_netmask(skfd, &ifr, &sa);
+- didnetmask++;
++
++ /* delay setting the CIDR netmask till after setting the addr */
++ donetmask = 1;
+ break;
+ }
+ }
+@@ -960,6 +961,13 @@
+ }
+ }
+
++ /* set CIDR netmask */
++ if (donetmask) {
++ donetmask = 0;
++ goterr = set_netmask(skfd, &ifr, &sa_netmask);
++ didnetmask++;
++ }
++
+ /*
+ * Don't do the set_flag() if the address is an alias with a - at the
+ * end, since it's deleted already! - Roman