Subject: [netatalk-admins] e: Netatalk

From: Patrick Gardella <[email-masked]>
Date: Mon, 11 Aug 1997 11:54:04 -0400 (EDT)

Some more information on the problem I was working on from last week.

Steven sent me this patch, which didn't work, but he suggests there might be
a more appropriate patch.

I'm using an Allied Telesyn AT-2450T PCI card on FreeBSD 2.2.1 and Netatalk 
1.4b2.  I get the error:

AppleTalk not up! Child exited with 1.
Aug 11 11:56:56 gateway atalkd[289]: addmulti: Invalid argument
Aug 11 11:56:56 gateway atalkd[289]: addmulti: Invalid argument

Any help would be appreciated.

Patrick

-----FW: <[email-masked]>-----

Date: Fri, 8 Aug 1997 15:52:27 +0100 (BST)
From: Stephen Roome <[email-masked]>
To: Patrick Gardella <[email-masked]>
Subject: Re: Netatalk

On Thu, 7 Aug 1997, Patrick Gardella wrote:
> Steve,
> 
> Did you ever get an answer to your question?  I've got an lnc1 that does
> the same thing. Exact same error...

(does the lnc actually support multicast properly ? I don't know and have
no information either way whatsoever I'm just asking if you know for sure
before you go any further, well, I started out with an Intel Etherexpress 
which doesn't do multicast properly at all and that didn't help things =) 

Anyway, I've got netatalk working fine now under -current, (well it's smp,
so I have no choice). Julian Elischer ([email-masked]) sent me a patch
which I've included on the end of this message. I beleive this is for
current only though, although it's probably worth giving it a go =) (can't
be any worse than not working at all.) 

It works now.. although the information about how atalkd can't be
restarted is incorrect. to restart atalkd if you clear out all appletalk
addresses (route flush/ifconfig delete altalk etc.) it seems to restart
perfectly, just takes ages. Also I delete atalkd.conf when I restart as
well, takes a minute to start completely, worth the wait though.

        Steve.

(might be worth asking about if there is a more appropriate patch. This
fixes the fact that netatalk thinks multicasting is done differently than
it is under -current, I think.? )

-netatalk patch for current-

diff -c netatalk-dist/etc/atalkd/main.c
netatalk-dist.new/etc/atalkd/main.c
*** netatalk-dist/etc/atalkd/main.c     Mon Oct 21 15:45:03 1996
--- netatalk-dist.new/etc/atalkd/main.c Mon Jul  7 10:51:22 1997
***************
*** 18,23 ****
--- 18,24 ----
  #include <sys/errno.h>
  #include <net/if.h>
  #include <net/route.h>
+ #include <net/if_dl.h>
  
  #include <signal.h>
  #include <syslog.h>
***************
*** 1149,1162 ****
                bootaddr( ciface );
            }
        } else {
            /* configure multicast for this interface */
!           bzero( &sa, sizeof( struct sockaddr ));
!           bcopy( ethermulti, sa.sa_data, sizeof( ethermulti ));
!           if ( ifconfig( iface->i_name, SIOCADDMULTI, &sa )) {
                syslog( LOG_ERR, "addmulti: %m" );
                exit( 1 );
            }
- 
            zip_getnetinfo( iface );
        }
      }
--- 1150,1170 ----
                bootaddr( ciface );
            }
        } else {
+           struct sockaddr_dl *sdl = (struct sockaddr_dl *)&sa;
            /* configure multicast for this interface */
!           bzero( sdl, sizeof( struct sockaddr ));
!           sdl->sdl_family = AF_LINK;
!           sdl->sdl_nlen = 0 /* strlen(iface->i_name)*/;
!           /*strncpy(sdl->sdl_data, iface->i_name, sdl->sdl_nlen);*/
!           bcopy( ethermulti, LLADDR(sdl), sizeof( ethermulti ));
!           sdl->sdl_alen = sizeof( ethermulti );
!           sdl->sdl_len = sizeof(*sdl);
!                       /* (sdl->sdl_data + sdl->sdl_alen + sdl->sdl_nlen) 
!                               - (char *)sdl; */
!           if ( ifconfig( iface->i_name, SIOCADDMULTI, sdl )) {
                syslog( LOG_ERR, "addmulti: %m" );
                exit( 1 );
            }
            zip_getnetinfo( iface );
        }
      }
diff -c netatalk-dist/etc/atalkd/nbp.c netatalk-dist.new/etc/atalkd/nbp.c
*** netatalk-dist/etc/atalkd/nbp.c      Sat Oct  5 08:17:53 1996
--- netatalk-dist.new/etc/atalkd/nbp.c  Mon Jul  7 11:07:01 1997
***************
*** 7,13 ****
--- 7,15 ----
  #include <sys/types.h>
  #include <sys/socket.h>
  #include <sys/ioctl.h>
+ #include <sys/time.h>
  #include <net/if.h>
+ #include <net/if_dl.h>
  #include <netatalk/at.h>
  #include <atalk/ddp.h>
  #include <atalk/nbp.h>
***************
*** 185,190 ****
--- 187,201 ----
                for ( l = iface->i_rt->rt_zt; l; l = l->l_next ) {
                    if ( zt == (struct ziptab *)l->l_data ) {
                        /* add multicast */
+                       struct sockaddr_dl *sdl = (struct sockaddr_dl
*)&sa;
+                       sdl->sdl_family = AF_LINK;
+                       sdl->sdl_nlen = 0;
+                       bcopy( zt->zt_bcast, sdl->sdl_data,
sizeof(ethermulti));
+                       sdl->sdl_alen = sizeof(ethermulti);
+                       sdl->sdl_len = sizeof (*sdl);
+                               /* (sdl->sdl_data
+                               + sdl->sdl_alen + sdl->sdl_nlen)  
+                               - (char *)sdl; */
                        if ( ifconfig( iface->i_name, SIOCADDMULTI, &sa ))
{
                            syslog( LOG_ERR, "addmulti: %m" );
                            exit( 1 );
diff -c netatalk-dist/etc/atalkd/rtmp.c
netatalk-dist.new/etc/atalkd/rtmp.c
*** netatalk-dist/etc/atalkd/rtmp.c     Wed Sep 18 12:05:18 1996
--- netatalk-dist.new/etc/atalkd/rtmp.c Thu Jun  5 17:48:55 1997
***************
*** 7,12 ****
--- 7,13 ----
  #include <sys/types.h>
  #include <sys/socket.h>
  #include <sys/ioctl.h>
+ #include <sys/time.h>
  #include <net/if.h>
  #include <net/route.h>
  #include <netatalk/endian.h>

-------------End of forwarding message-------------------------

---

From: Steven Cook <[email-masked]>
Date: Tue, 12 Aug 1997 07:27:33 +1000 (EST)

Is there any plans to add the ADSP protocol to Netatalk soon? As we need
it to write some programs that run between Apple Newtons and DEC's. If it
is not then we will add it to the netatalk package ourselves.

Steven Cook              |   
Honours Student (CS)     | Quote Currently Under Construction 
University Of Queensland |  
[email-masked]     |