summaryrefslogtreecommitdiff
blob: a7335f6d427fb818fc904f8551df719ff5d3c41e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Fixes changing the default subnet route after removing an ip address.

See: http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=40133
and http://mail-index.netbsd.org/tech-net/2008/12/03/msg000896.html

Thanks to Roy Marples.
--- sys/netinet/in.c.orig
+++ sys/netinet/in.c
@@ -858,6 +858,12 @@
 	error = rtinit(&target->ia_ifa, (int)RTM_ADD, flags);
 	if (!error)
 		target->ia_flags |= IFA_ROUTE;
+	else if (error == EEXIST) {
+		/*
+		 * the fact that the route already exists is not an error.
+		 */
+		error = 0;
+	}
 	return (error);
 }