Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 1998 19:54:51 -0700 (PDT)
From:      Julian Elischer <julian@whistle.com>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   ports/6961: netatalk needs tweek for 3.0 multicasting [patch]
Message-ID:  <199806160254.TAA08067@current1.whistle.com>

next in thread | raw e-mail | index | archive | help

>Number:         6961
>Category:       ports
>Synopsis:       netatalk needs tweek for 3.0 multicasting [patch]
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 15 20:10:00 PDT 1998
>Last-Modified:
>Originator:     Julian Elischer
>Organization:
Whistle Communications, Inc.
>Release:        FreeBSD 3.0.0-current i386
>Environment:

	FreeBSD 3.0 changes the type of the sockaddr needed to request
	a link-layer multicast address. FreeBSD 3.0 has changed this so
	that it is incompatible with other systems and FreeBSD 2.2.

>Description:

	Netatalk cannot do correct zone manipulations with multicast
	addressing.

>How-To-Repeat:

	start netatlk.. watch atalk log files for:
	atalkd[340]: addmulti: Invalid argument

>Fix:
	
	The following patch needs to be incorporated into
	the netatalk port.


Index: etc/atalkd/main.c
===================================================================
RCS file: /cvs/mod/umich/netatalk/etc/atalkd/main.c,v
retrieving revision 1.1.1.3.2.3
retrieving revision 1.1.1.3.2.4
diff -c -r1.1.1.3.2.3 -r1.1.1.3.2.4
*** main.c	1996/10/11 01:50:34	1.1.1.3.2.3
--- main.c	1998/06/16 02:24:27	1.1.1.3.2.4
***************
*** 17,22 ****
--- 17,25 ----
  #include <sys/wait.h>
  #include <sys/errno.h>
  #include <net/if.h>
+ #if ( __FreeBSD__ >= 3 )
+ #include <net/if_dl.h>
+ #endif
  #include <net/route.h>
  
  #include <signal.h>
***************
*** 1146,1154 ****
--- 1149,1171 ----
  		bootaddr( ciface );
  	    }
  	} else {
+ #if ( __FreeBSD__ >= 3 )
+ 	    struct sockaddr_dl *dlp;
+ 
  	    /* configure multicast for this interface */
  	    bzero( &sa, sizeof( struct sockaddr ));
+ 	    dlp = (struct sockaddr_dl *)&sa;
+ 	    dlp->sdl_len = sizeof(struct sockaddr_dl);
+ 	    dlp->sdl_family = AF_LINK;
+ 	    dlp->sdl_index = 0;
+ 	    dlp->sdl_nlen = 0;
+ 	    dlp->sdl_alen = 6;
+ 	    dlp->sdl_slen = 0;
+ 	    bcopy (ethermulti, LLADDR(dlp), sizeof( ethermulti ));
+ #else
+ 	    bzero( &sa, sizeof( struct sockaddr ));
  	    bcopy( ethermulti, sa.sa_data, sizeof( ethermulti ));
+ #endif
  	    if ( ifconfig( iface->i_name, SIOCADDMULTI, &sa )) {
  		syslog( LOG_ERR, "addmulti: %m" );
  		exit( 1 );
Index: etc/atalkd/nbp.c
===================================================================
RCS file: /cvs/mod/umich/netatalk/etc/atalkd/nbp.c,v
retrieving revision 1.1.1.3.2.1
retrieving revision 1.1.1.3.2.3
diff -c -r1.1.1.3.2.1 -r1.1.1.3.2.3
*** nbp.c	1998/01/10 00:09:18	1.1.1.3.2.1
--- nbp.c	1998/06/16 02:39:03	1.1.1.3.2.3
***************
*** 9,14 ****
--- 9,17 ----
  #include <sys/socket.h>
  #include <sys/ioctl.h>
  #include <net/if.h>
+ #if ( __FreeBSD__ >= 3 )
+ #include <net/if_dl.h>
+ #endif
  #include <netatalk/at.h>
  #include <atalk/ddp.h>
  #include <atalk/nbp.h>
***************
*** 176,184 ****
  	    }
  	    bcopy( zone_mcast( zt->zt_name, zt->zt_len ), zt->zt_bcast,
  		    sizeof( ethermulti ));
  	    bzero( &sa, sizeof( struct sockaddr ));
  	    bcopy( zt->zt_bcast, sa.sa_data, sizeof( ethermulti ));
! 
  	    for ( iface = interfaces; iface; iface = iface->i_next ) {
  		if (( iface->i_flags & IFACE_PHASE2 ) == 0 ) {
  		    continue;
--- 179,203 ----
  	    }
  	    bcopy( zone_mcast( zt->zt_name, zt->zt_len ), zt->zt_bcast,
  		    sizeof( ethermulti ));
+ #if ( __FreeBSD__ >= 3 )
+ 	    {
+ 		struct sockaddr_dl *dlp;
+ 		
+ 		/* configure multicast for this interface */
+ 		bzero( &sa, sizeof( struct sockaddr ));
+ 		dlp = (struct sockaddr_dl *)&sa;
+ 		dlp->sdl_len = sizeof(struct sockaddr_dl);
+ 		dlp->sdl_family = AF_LINK;
+ 		dlp->sdl_index = 0;
+ 		dlp->sdl_nlen = 0;
+ 		dlp->sdl_alen = 6;
+ 		dlp->sdl_slen = 0;
+ 		bcopy (zt->zt_bcast, LLADDR(dlp), sizeof( ethermulti ));
+ 	    }
+ #else
  	    bzero( &sa, sizeof( struct sockaddr ));
  	    bcopy( zt->zt_bcast, sa.sa_data, sizeof( ethermulti ));
! #endif      
  	    for ( iface = interfaces; iface; iface = iface->i_next ) {
  		if (( iface->i_flags & IFACE_PHASE2 ) == 0 ) {
  		    continue;
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806160254.TAA08067>