Subject: network range broadcast storms (fix)

From: [email-masked]
Date: Fri, 06 May 1994 15:33:17 -0400

Here's a patch for broadcast storms caused by multiple netatalk
machines in a single net-range.  Please find a patch attached.  This
fix will be included (among other things) in netatalk-1.3.2, which I'll
try to get out in a week or so.

:wes

--- cut ---
*** sys/netatalk/ddp_input.c-	Fri May  6 14:27:04 1994
--- sys/netatalk/ddp_input.c	Fri May  6 14:25:39 1994
***************
*** 39,44 ****
--- 39,45 ----
  #include "ddp.h"
  #include "ddp_var.h"
  
+ int		ddp_forward = 1;
  int		ddp_deaf = 0;
  extern int	ddp_cksum;
  extern u_short	at_cksum();
***************
*** 238,245 ****
  			to.sat_addr.s_node == 0 ) {
  		    break;
  		}
! 		if ( to.sat_addr.s_net != AA_SAT( aa )->sat_addr.s_net &&
! 			to.sat_addr.s_net != 0 &&
  			( to.sat_addr.s_net < 0xff00 ||
  			to.sat_addr.s_net > 0xfffe )) {
  		    continue;
--- 239,246 ----
  			to.sat_addr.s_node == 0 ) {
  		    break;
  		}
! 		if (( to.sat_addr.s_net < aa->aa_firstnet ||
! 			to.sat_addr.s_net > aa->aa_lastnet ) &&
  			( to.sat_addr.s_net < 0xff00 ||
  			to.sat_addr.s_net > 0xfffe )) {
  		    continue;
***************
*** 280,285 ****
--- 281,290 ----
       */
      if ( aa == NULL || ( to.sat_addr.s_node == ATADDR_BCAST &&
  	    aa->aa_ifp != ifp && ( ifp->if_flags & IFF_LOOPBACK ) == 0 )) {
+ 	if ( ddp_forward == 0 ) {
+ 	    m_freem( m );
+ 	    return;
+ 	}
  	if ( forwro.ro_rt && ( satosat( &forwro.ro_dst )->sat_addr.s_net !=
  		to.sat_addr.s_net ||
  		satosat( &forwro.ro_dst )->sat_addr.s_node !=
--- cut ---