[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[altq 7] Re: pvc subinterfaces and mrouted




>> The patch didn't work.  This is the output I receive when
>> starting mrouted:

I believe the following patch fixes the problem.
FreeBSD-3.x doesn't need SIOCADDMULTI/SIOCDELMULTI so that I didn't
noticed in the previous patch.

Errata for altq-1.2 is attached.

Thank you for the report!

--Kenjiro

------------------------------------------------------------------------

This file contains post-release ERRATA for altq-1.2.

Currently 1 problem is listed.

1. mrouted fails for an ATM subinterface  (1999/5/22)
	
    Problem description:
	A multicast-capable interface should accept SIOCSIFFLAGS,
	SIOCADDMULTI and SIOCDELMULTI ioctls.
	(mrouted uses these ioctls.)

    Solution:
	Appy the following patch to sys-altq/dev/en/midway.c.
	There are 2 versions; one for 3.1/3.2 and the other for 2.2.8.
	(the 2 versions were slightly out-of-sync so that the patch also
	tries to sync the difference.)

------------------------------------------------------------------------
patch for FreeBSD-3.1 or 3.2:

--- midway.c-	Fri May 21 23:58:11 1999
+++ midway.c	Sat May 22 20:02:26 1999
@@ -1241,6 +1241,9 @@
 		break;
 #endif
 	case SIOCSIFADDR: 
+#if defined(INET6) && defined(SIOCSIFADDR_IN6)
+	case SIOCSIFADDR_IN6: 
+#endif
 		ifp->if_flags |= IFF_UP;
 #if defined(INET) || defined(INET6)
 		if (ifa->ifa_addr->sa_family == AF_INET
@@ -1261,7 +1264,18 @@
 		break;
 
 	case SIOCSIFFLAGS: 
+#ifdef ATM_PVCEXT
+	  	/* point-2-point pvc is allowed to change if_flags */
+		if (((ifp->if_flags & IFF_UP)
+		     && !(ifp->if_flags & IFF_RUNNING))
+		    || (!(ifp->if_flags & IFF_UP)
+			&& (ifp->if_flags & IFF_RUNNING))) {
+			en_reset(sc);
+			en_init(sc);
+		}
+#else
 		error = EINVAL;
+#endif
 		break;
 
 #if defined(SIOCSIFMTU)		/* ??? copied from if_de */
@@ -1286,6 +1300,27 @@
 #endif /* SIOCSIFMTU */
 
 #ifdef ATM_PVCEXT
+	case SIOCADDMULTI:
+	case SIOCDELMULTI:
+		if (ifp == &sc->enif || ifr == 0) {
+			error = EAFNOSUPPORT;	/* XXX */
+			break;
+		}
+		switch (ifr->ifr_addr.sa_family) {
+#ifdef INET
+		case AF_INET:
+			break;
+#endif
+#ifdef INET6
+		case AF_INET6:
+			break;
+#endif
+		default:
+			error = EAFNOSUPPORT;
+			break;
+		}
+		break;
+
 	case SIOCGPVCSIF:
 		if (ifp != &sc->enif) {
 		  sprintf(ifr->ifr_name, "%s%d",
@@ -1502,12 +1537,14 @@
       if (m == NULL) 
 	break;		/* >>> exit 'while(1)' here <<< */
       m_freem(m);
+      IF_DROP(&sc->enif.if_snd);
     }
     while (1) {
       IF_DEQUEUE(&sc->rxslot[slot].q, m);
       if (m == NULL) 
 	break;		/* >>> exit 'while(1)' here <<< */
       m_freem(m);
+      IF_DROP(&sc->enif.if_snd);
     }
     sc->rxslot[slot].oth_flags &= ~ENOTHER_SWSL;
     if (sc->rxslot[slot].oth_flags & ENOTHER_DRAIN) {
@@ -1786,6 +1823,7 @@
 	    if (en_mfix(sc, &lastm, prev) == 0) {	/* failed? */
 	      m_freem(m);
 	      m = NULL;
+	      sc->enif.if_oerrors++;
               break;
             }
 	    if (first)
@@ -1819,6 +1857,7 @@
 	printf("%s: output vpi=%d, vci=%d out of card range, dropping...\n", 
 		sc->sc_dev.dv_xname, atm_vpi, atm_vci);
 	m_freem(m);
+	sc->enif.if_oerrors++;
 	continue;
       }
 
@@ -1927,6 +1966,7 @@
 #endif
 	EN_COUNT(sc->txmbovr);
 	m_freem(m);
+	IF_DROP(&ifp->if_snd);
 #ifdef EN_DEBUG
 	printf("%s: tx%d: buffer space shortage\n", sc->sc_dev.dv_xname,
 		txchan);
@@ -2385,6 +2425,7 @@
   if (launch.t != tmp)
     panic("en dequeue drop");
   m_freem(launch.t);
+  IF_DROP(&sc->enif.if_snd);
   sc->txslot[chan].mbsize -= launch.mlen;
   goto again;
 }

------------------------------------------------------------------------
patch for FreeBSD-2.2.8:

--- midway.c-	Sat May 22 03:07:43 1999
+++ midway.c	Sat May 22 20:02:53 1999
@@ -1235,7 +1235,7 @@
 		break;
 #endif
 	case SIOCSIFADDR: 
-#ifdef INET6
+#if defined(INET6) && defined(SIOCSIFADDR_IN6)
 	case SIOCSIFADDR_IN6: 
 #endif
 		ifp->if_flags |= IFF_UP;
@@ -1258,6 +1258,8 @@
 		break;
 
 	case SIOCSIFFLAGS:
+#ifdef ATM_PVCEXT
+	  	/* point-2-point pvc is allowed to change if_flags */
 		if (((ifp->if_flags & IFF_UP)
 		     && !(ifp->if_flags & IFF_RUNNING))
 		    || (!(ifp->if_flags & IFF_UP)
@@ -1265,6 +1267,9 @@
 			en_reset(sc);
 			en_init(sc);
 		}
+#else
+		error = EINVAL;
+#endif
 		break;
 
 #if defined(SIOCSIFMTU)		/* ??? copied from if_de */
@@ -1289,6 +1294,27 @@
 #endif /* SIOCSIFMTU */
 
 #ifdef ATM_PVCEXT
+	case SIOCADDMULTI:
+	case SIOCDELMULTI:
+		if (ifp == &sc->enif || ifr == 0) {
+			error = EAFNOSUPPORT;	/* XXX */
+			break;
+		}
+		switch (ifr->ifr_addr.sa_family) {
+#ifdef INET
+		case AF_INET:
+			break;
+#endif
+#ifdef INET6
+		case AF_INET6:
+			break;
+#endif
+		default:
+			error = EAFNOSUPPORT;
+			break;
+		}
+		break;
+
 	case SIOCGPVCSIF:
 		if (ifp != &sc->enif) {
 		  sprintf(ifr->ifr_name, "%s%d",

------------------------------------------------------------------------