On 14-10-28 05:55 AM, Martin Pieuchot wrote:
There's nothing that prevent you to configure the same IPv4 address on
different interfaces in the same routing domain. But does it make
sense?
Index: netinet/in.c
===================================================================
RCS file: /home/ncvs/src/sys/netinet/in.c,v
retrieving revision 1.106
diff -u -p -r1.106 in.c
--- netinet/in.c 7 Oct 2014 08:47:28 -0000 1.106
+++ netinet/in.c 28 Oct 2014 10:23:07 -0000
@@ -616,6 +616,10 @@ in_ifinit(struct ifnet *ifp, struct in_i
splsoftassert(IPL_SOFTNET);
+ /* Make sure this address does not exist in the given rdomain. */
+ if (ifa_ifwithaddr(sintosa(sin), ifp->if_rdomain))
+ return (EEXIST);
+
if (newaddr)
TAILQ_INSERT_TAIL(&in_ifaddr, ia, ia_list);
It might be needful when reconfiguring networks; if I swap two
interfaces' IP addresses in /etc/hostname.* and re-run /etc/netstart
instead of rebooting, I suspect this might break - I believe there would
be a very brief overlap where two interfaces had the same IP address.
Come to think of it, I'm not even sure whether this even works or not
as-is; any opinions on what would be the canonical approach to swapping
IPs between interfaces on a live system? Just do it by hand? Write
your own script? Use netstart? Or just reboot?
--
-Adam Thompson
athom...@athompso.net