summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqingli <qingli@FreeBSD.org>2009-09-15 01:01:03 +0000
committerqingli <qingli@FreeBSD.org>2009-09-15 01:01:03 +0000
commitd073699112113e063b9f1f192a9fa00b3945c8a4 (patch)
tree3e2fdedb94aa2164e3571cc98d7695a19a289cd5
parentf2066f0140b87790e588ec3ea9e07817b7f04bd2 (diff)
downloadFreeBSD-src-d073699112113e063b9f1f192a9fa00b3945c8a4.zip
FreeBSD-src-d073699112113e063b9f1f192a9fa00b3945c8a4.tar.gz
The bootp code installs an interface address and the nfs client
module tries to install the same address again. This extra code is removed, which was discovered by the removal of a call to in_ifscrub() in r196714. This call to in_ifscrub is put back here because the SIOCAIFADDR command can be used to change the prefix length of an existing alias. Reviewed by: kmacy
-rw-r--r--sys/netinet/in.c11
-rw-r--r--sys/nfsclient/nfs_vfsops.c4
2 files changed, 15 insertions, 0 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index c11b3e7..4a52884 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -536,6 +536,16 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
hostIsNew = 0;
}
if (ifra->ifra_mask.sin_len) {
+ /*
+ * QL: XXX
+ * Need to scrub the prefix here in case
+ * the issued command is SIOCAIFADDR with
+ * the same address, but with a different
+ * prefix length. And if the prefix length
+ * is the same as before, then the call is
+ * un-necessarily executed here.
+ */
+ in_ifscrub(ifp, ia);
ia->ia_sockmask = ifra->ifra_mask;
ia->ia_sockmask.sin_family = AF_INET;
ia->ia_subnetmask =
@@ -544,6 +554,7 @@ in_control(struct socket *so, u_long cmd, caddr_t data, struct ifnet *ifp,
}
if ((ifp->if_flags & IFF_POINTOPOINT) &&
(ifra->ifra_dstaddr.sin_family == AF_INET)) {
+ in_ifscrub(ifp, ia);
ia->ia_dstaddr = ifra->ifra_dstaddr;
maskIsNew = 1; /* We lie; but the effect's the same */
}
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index e43f196..06316a8 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -463,9 +463,13 @@ nfs_mountroot(struct mount *mp)
break;
}
#endif
+
+#if 0 /* QL: XXX */
error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td);
if (error)
panic("nfs_mountroot: SIOCAIFADDR: %d", error);
+#endif
+
if ((cp = getenv("boot.netif.mtu")) != NULL) {
ir.ifr_mtu = strtol(cp, NULL, 10);
bcopy(nd->myif.ifra_name, ir.ifr_name, IFNAMSIZ);
OpenPOWER on IntegriCloud