Skip to content

Commit 4288ea3

Browse files
committed
Flush routes _before_ adding the IP
1 parent 8f0e05e commit 4288ea3

5 files changed

Lines changed: 18 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.9.0 (2018-02-22)
4+
5+
* [bugfix] IPv6 routes should be removed before configuring the IP, not after
6+
37
## 1.8.0 (2017-11-21)
48

59
* Display 'Failed' if the IP or NTP configuration fails

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2015-2016 Alexander Williams, Unscramble <license@unscramble.jp>
3+
Copyright (c) 2015-2018 Alexander Williams, Unscramble <license@unscramble.jp>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

module.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[de MODULE_INFO
22
("name" "tinycore-network")
3-
("version" "1.8.0")
3+
("version" "1.9.0")
44
("summary" "TinyCore static/dhcp networking")
55
("source" "https://a1w.ca")
66
("author" "Alexander Williams")
77
("license" "MIT")
8-
("copyright" "(c) 2015-2017 Alexander Williams, Unscramble <license@unscramble.jp>") ]
8+
("copyright" "(c) 2015-2018 Alexander Williams, Unscramble <license@unscramble.jp>") ]

network.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# TinyCore static/dhcp networking
44
#
55
# MIT License
6-
# Copyright (c) 2015-2017 Alexander Williams, Unscramble <license@unscramble.jp>
6+
# Copyright (c) 2015-2018 Alexander Williams, Unscramble <license@unscramble.jp>
77
#
8-
# VERSION: 1.8.0
8+
# VERSION: 1.9.0
99

1010
. /etc/init.d/tc-functions
1111
set -a

udhcpc.script

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ case "$1" in
2020
;;
2121

2222
renew|bound)
23+
# flush routes first
24+
if [ -n "$router" ] ; then
25+
echo "deleting routers"
26+
while route del default gw 0.0.0.0 dev $interface ; do
27+
:
28+
done
29+
[ -n "$subnet_ipv6" ] && $IP_COMMAND -6 route flush dev $interface
30+
fi
31+
2332
echo "adding ip $ip"
2433
if [ -n "$subnet_ipv6" ]; then
2534
$IP_COMMAND -6 addr add ${ip}${subnet_ipv6} dev $interface
@@ -30,13 +39,6 @@ case "$1" in
3039
/sbin/ifconfig $interface | grep -q "inet addr"
3140

3241
if [ -n "$router" ] ; then
33-
echo "deleting routers"
34-
while route del default gw 0.0.0.0 dev $interface ; do
35-
:
36-
done
37-
38-
[ -n "$subnet_ipv6" ] && $IP_COMMAND -6 route flush dev $interface
39-
4042
metric=0
4143
for i in $router ; do
4244
echo "adding routers $i"

0 commit comments

Comments
 (0)