Zhe Weng
9abc82c792
nshlib/ifconfig: Generate default IPv4 gateway with netmask
Generate default gateway using configured netmask instead of fixed
255.255.255.0, which may be more flexible under certain situations.
e.g. A subnet like 10.0.23.16/28 may not contain the .1 address.
Before:
ifconfig eth0 10.0.23.22 netmask 255.255.255.252 => DRaddr:10.0.23.1
ifconfig eth0 10.0.23.22 netmask 255.255.255.240 => DRaddr:10.0.23.1
ifconfig eth0 10.0.23.22 netmask 255.255.255.0 => DRaddr:10.0.23.1
ifconfig eth0 10.0.23.22 netmask 255.255.0.0 => DRaddr:10.0.23.1
ifconfig eth0 10.0.23.22 => Mask:255.255.255.0 DRaddr:10.0.23.1
After:
ifconfig eth0 10.0.23.22 netmask 255.255.255.252 => DRaddr:10.0.23.21
ifconfig eth0 10.0.23.22 netmask 255.255.255.240 => DRaddr:10.0.23.17
ifconfig eth0 10.0.23.22 netmask 255.255.255.0 => DRaddr:10.0.23.1
ifconfig eth0 10.0.23.22 netmask 255.255.0.0 => DRaddr:10.0.0.1
ifconfig eth0 10.0.23.22 => Mask:255.255.255.0 DRaddr:10.0.23.1
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-12-07 07:16:43 -08:00
..
2023-07-08 13:52:02 +08:00
2023-08-29 02:58:45 +08:00
2022-10-16 14:59:08 +02:00
2023-03-23 22:10:19 +02:00
2023-09-25 21:05:37 +08:00
2023-09-26 00:31:09 +08:00
2023-02-26 19:02:28 +02:00
2023-09-21 10:48:29 +08:00
2023-11-08 00:20:19 +08:00
2023-06-12 13:37:27 +08:00
2023-08-25 17:18:35 +08:00
2023-08-29 03:11:28 +08:00
2023-06-12 13:37:27 +08:00
2023-07-30 22:21:34 -07:00
2023-07-31 07:58:41 -07:00
2023-10-26 00:24:58 +08:00
2023-10-26 00:24:40 +08:00
2023-09-08 18:49:31 +08:00
2023-07-08 16:01:52 +03:00
2023-05-08 21:35:16 +03:00
2023-08-29 23:14:06 +08:00
2022-09-22 14:22:13 +08:00
2023-02-24 17:38:19 +08:00
2023-12-07 07:16:43 -08:00
2023-08-01 08:13:23 -07:00
2022-09-22 14:22:13 +08:00
2023-02-24 17:38:19 +08:00
2023-08-29 02:58:45 +08:00
2022-10-16 19:07:16 +02:00
2022-04-22 11:14:17 +08:00
2023-02-05 08:46:59 +02:00
2023-03-06 18:52:31 +02:00
2023-05-22 11:57:40 +02:00
2023-09-22 09:16:54 +08:00
2023-02-24 17:38:19 +08:00
2022-11-07 15:24:08 +09:00
2023-05-08 21:35:16 +03:00
2023-07-30 22:20:02 -07:00
2023-08-25 17:18:35 +08:00
2023-06-15 03:23:04 +08:00
2023-02-24 17:38:19 +08:00
2023-05-08 21:35:16 +03:00
2023-11-01 09:23:07 +08:00
2022-04-21 12:54:24 +03:00
2022-04-21 12:54:24 +03:00