1 --- net-tools-1.60/ifconfig.c.netmask 2001-04-13 20:25:18.000000000 +0200
2 +++ net-tools-1.60/ifconfig.c 2004-11-02 15:31:56.454594456 +0100
4 * 20001008 - Bernd Eckenfels, Patch from RH for setting mtu
5 * (default AF was wrong)
6 * 20010404 - Arnaldo Carvalho de Melo, use setlocale
7 + * 20040831 - Florin Malita <fmalita@glenayre.com> delayed CIDR netmask
10 #define DFLT_AF "inet"
13 int main(int argc, char **argv)
16 + struct sockaddr sa, sa_netmask;
17 struct sockaddr_in sin;
22 - int goterr = 0, didnetmask = 0;
23 + int goterr = 0, didnetmask = 0, donetmask = 0;
28 /* FIXME: sa is too small for INET6 addresses, inet6 should use that too,
29 broadcast is unexpected */
31 - switch (ap->getmask(host, &sa, NULL)) {
32 + switch (ap->getmask(host, &sa_netmask, NULL)) {
40 - goterr = set_netmask(skfd, &ifr, &sa);
43 + /* delay setting the CIDR netmask till after setting the addr */
52 + /* set CIDR netmask */
55 + goterr = set_netmask(skfd, &ifr, &sa_netmask);
60 * Don't do the set_flag() if the address is an alias with a - at the
61 * end, since it's deleted already! - Roman