svn commit: r197237 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet nfsclient

Qing Li qingli at FreeBSD.org
Tue Sep 15 22:25:20 UTC 2009


Author: qingli
Date: Tue Sep 15 22:25:19 2009
New Revision: 197237
URL: http://svn.freebsd.org/changeset/base/197237

Log:
  MFC	r197210, 197212, 197235
  
  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.
  
  r197235 reverts file nfs_vfsops.c
  
  Reviewed by:	kmacy
  Approved by:	re

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/in.c
  stable/8/sys/nfsclient/nfs_vfsops.c

Modified: stable/8/sys/netinet/in.c
==============================================================================
--- stable/8/sys/netinet/in.c	Tue Sep 15 22:23:45 2009	(r197236)
+++ stable/8/sys/netinet/in.c	Tue Sep 15 22:25:19 2009	(r197237)
@@ -536,6 +536,16 @@ in_control(struct socket *so, u_long cmd
 				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
 		}
 		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 */
 		}

Modified: stable/8/sys/nfsclient/nfs_vfsops.c
==============================================================================
--- stable/8/sys/nfsclient/nfs_vfsops.c	Tue Sep 15 22:23:45 2009	(r197236)
+++ stable/8/sys/nfsclient/nfs_vfsops.c	Tue Sep 15 22:25:19 2009	(r197237)
@@ -463,9 +463,11 @@ nfs_mountroot(struct mount *mp)
 			break;
 	}
 #endif
+
 	error = ifioctl(so, SIOCAIFADDR, (caddr_t)&nd->myif, td);
 	if (error)
 		panic("nfs_mountroot: SIOCAIFADDR: %d", error);
+
 	if ((cp = getenv("boot.netif.mtu")) != NULL) {
 		ir.ifr_mtu = strtol(cp, NULL, 10);
 		bcopy(nd->myif.ifra_name, ir.ifr_name, IFNAMSIZ);


More information about the svn-src-stable-8 mailing list