Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jun 1998 19:42:47 -0700
From:      Julian Elischer <julian@whistle.com>
To:        hackers@FreeBSD.ORG, netatalk@umich.edu
Subject:   [patch] fixed fix for netatalk in freebsd 3
Message-ID:  <3585DBA7.FF6D5DF@whistle.com>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

--------------237C228A31DFF4F5ABD322C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

oops 
this one compiles...

--------------237C228A31DFF4F5ABD322C
Content-Type: text/plain; charset=us-ascii; name="d1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="d1"

Index: 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: 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;

--------------237C228A31DFF4F5ABD322C--


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



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