summaryrefslogtreecommitdiff
path: root/sys/netinet/in.c
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2013-06-23 16:30:47 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2013-06-23 16:30:47 +0000
commit7903ed0d65ed7ce63b40104f0c6a2855cb9ca5a2 (patch)
treebc223116d85d729f3937e55875537334694a778f /sys/netinet/in.c
parentf6e6c82d513f1ace1f553dfdb31c9e88975209a0 (diff)
Revert r1.78 for now, it breaks ipv4 on carp. As found the hard way by
Jeff Ross and later by myself, both on remote systems..
Diffstat (limited to 'sys/netinet/in.c')
-rw-r--r--sys/netinet/in.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index 663b5a78cea..02babe701ce 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.c,v 1.80 2013/06/20 12:03:40 mpi Exp $ */
+/* $OpenBSD: in.c,v 1.81 2013/06/23 16:30:46 sthen Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
@@ -242,6 +242,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp)
if (ia == NULL) {
ia = malloc(sizeof *ia, M_IFADDR, M_WAITOK | M_ZERO);
s = splsoftnet();
+ TAILQ_INSERT_TAIL(&in_ifaddr, ia, ia_list);
ia->ia_addr.sin_family = AF_INET;
ia->ia_addr.sin_len = sizeof(ia->ia_addr);
ia->ia_ifa.ifa_addr = sintosa(&ia->ia_addr);
@@ -413,10 +414,9 @@ cleanup:
*/
s = splsoftnet();
in_ifscrub(ifp, ia);
- if (!error) {
+ if (!error)
ifa_del(ifp, &ia->ia_ifa);
- TAILQ_REMOVE(&in_ifaddr, ia, ia_list);
- }
+ TAILQ_REMOVE(&in_ifaddr, ia, ia_list);
if (ia->ia_allhosts != NULL) {
in_delmulti(ia->ia_allhosts);
ia->ia_allhosts = NULL;
@@ -646,10 +646,8 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin,
struct sockaddr_in oldaddr;
int s = splnet(), flags = RTF_UP, error;
- if (!newaddr) {
+ if (!newaddr)
ifa_del(ifp, &ia->ia_ifa);
- TAILQ_REMOVE(&in_ifaddr, ia, ia_list);
- }
oldaddr = ia->ia_addr;
ia->ia_addr = *sin;
@@ -702,8 +700,8 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin,
flags |= RTF_HOST;
} else if (ifp->if_flags & IFF_POINTOPOINT) {
if (ia->ia_dstaddr.sin_family != AF_INET) {
- error = 0;
- goto done;
+ ifa_add(ifp, &ia->ia_ifa);
+ return (0);
}
flags |= RTF_HOST;
}
@@ -720,11 +718,8 @@ in_ifinit(struct ifnet *ifp, struct in_ifaddr *ia, struct sockaddr_in *sin,
ia->ia_allhosts = in_addmulti(&addr, ifp);
}
-done:
- if (!error) {
- TAILQ_INSERT_TAIL(&in_ifaddr, ia, ia_list);
+ if (!error)
ifa_add(ifp, &ia->ia_ifa);
- }
return (error);
}