From nobody  Mon Jul 28 02:10:22 1997
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.5/8.8.5) id CAA19754;
          Mon, 28 Jul 1997 02:10:22 -0700 (PDT)
Message-Id: <199707280910.CAA19754@hub.freebsd.org>
Date: Mon, 28 Jul 1997 02:10:22 -0700 (PDT)
From: denny1@home.com
To: freebsd-gnats-submit@freebsd.org
Subject: minor nits in sys/netatalk
X-Send-Pr-Version: www-1.0

>Number:         4184
>Category:       kern
>Synopsis:       [netatalk] [patch] minor nits in sys/netatalk
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    rwatson
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 28 02:20:02 PDT 1997
>Closed-Date:    Thu Dec 22 04:11:52 UTC 2011
>Last-Modified:  Thu Dec 22 04:11:52 UTC 2011
>Originator:     Denton Gentry
>Release:        N/A
>Organization:
>Environment:
Found while porting netatalk to OpenBSD.
>Description:
  Several minor problems were uncovered while bringing up netatalk
under OpenBSD. They are attached below.

  Also a number of changes to tcpdump to better support AppleTalk
were made. Those changes have been submitted to LBL, but I do not
know when they might be included in a new tcpdump release. If FreeBSD
wants to incorporate tcpdump changes for AppleTalk before that I will
happily mail the diffs.

>How-To-Repeat:

>Fix:
  The first change was made in umich 1.4a2 relative to 1.3.3.
In aarp.c incoming AARP packets are checked against the broadcast
address. In some environments they saw broadcast wars...

coventry[145] diff -c aarp.c aarp.c.orig
*** aarp.c      Sun Jul 27 23:04:01 1997
--- aarp.c.orig Sun Jul 27 23:03:00 1997
***************
*** 319,335 ****
        return;
      }
  
-     /*
-      * Check if from broadcast address.  This could be a more robust
-      * check, since we could look for multicasts. XXX
-      */
-     if ( !bcmp(( caddr_t )ea->aarp_sha, ( caddr_t )etherbroadcastaddr,
-             sizeof( etherbroadcastaddr ))) {
-         log( LOG_ERR, "aarp: source is broadcast!\n" );
-         m_freem( m );
-         return;
-     }
- 
      op = ntohs( ea->aarp_op );
      bcopy( ea->aarp_tpnet, &net, sizeof( net ));
  
--- 319,324 ----


  The second change is in ddp_output.c. FreeBSD's port of 1.3.3
removed an m_pullup, probably because it failed for length
MLEN (can only pullup for MHLEN w/ 4.4BSD). That means phase2->phase1
routing results in mbufs at odd byte alignment. For x86 this is not
an issue, but if FreeBSD does an alpha port it will be.

coventry[146] diff -c ddp_output.c ddp_output.c.orig
*** ddp_output.c        Wed Mar  5 03:13:49 1997
--- ddp_output.c.orig   Sun Jul 27 23:05:56 1997
***************
*** 141,147 ****
       * This is bad for transition routing, since phase 1 and phase 2
       * packets end up poorly aligned due to the three byte elap header.
       */
!     if ( !(aa->aa_flags & AFA_PHASE2) ) {
        MGET( m0, M_WAIT, MT_HEADER );
        if ( m0 == 0 ) {
            m_freem( m );
--- 141,151 ----
       * This is bad for transition routing, since phase 1 and phase 2
       * packets end up poorly aligned due to the three byte elap header.
       */
!     if ( aa->aa_flags & AFA_PHASE2 ) {
!       if (( m = m_pullup( m, MIN( MHLEN, m->m_pkthdr.len ))) == 0 ) {
!           return( ENOBUFS );
!       }
!     } else {
        MGET( m0, M_WAIT, MT_HEADER );
        if ( m0 == 0 ) {
            m_freem( m );


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: phk 
State-Changed-When: Mon May 4 04:12:11 PDT 1998 
State-Changed-Why:  
ready for committer to pick this up 
State-Changed-From-To: suspended->open 
State-Changed-By: bms 
State-Changed-When: Tue 25 Nov 2003 08:51:55 PST 
State-Changed-Why:  
I'm in hoover up network PRs mode. I'll look into this. 



Responsible-Changed-From-To: freebsd-bugs->bms 
Responsible-Changed-By: bms 
Responsible-Changed-When: Tue 25 Nov 2003 08:51:55 PST 
Responsible-Changed-Why:  
I'm in hoover up network PRs mode. I'll look into this. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=4184 
State-Changed-From-To: open->feedback 
State-Changed-By: bms 
State-Changed-When: Wed 26 Nov 2003 21:52:30 PST 
State-Changed-Why:  
Still want to see this fix go in? I can't test it, but don't mind 
reviewing it for style/sanity. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=4184 
State-Changed-From-To: feedback->suspended 
State-Changed-By: bms 
State-Changed-When: Wed 26 Nov 2003 21:55:49 PST 
State-Changed-Why:  
Submitter's email bounces. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=4184 
Responsible-Changed-From-To: bms->freebsd-bugs 
Responsible-Changed-By: bms 
Responsible-Changed-When: Wed Jun 16 06:20:55 GMT 2004 
Responsible-Changed-Why:  
I'm disowning this because I have no means of testing the diffs; 
they look trivial and beneficial. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=4184 
Responsible-Changed-From-To: freebsd-bugs->rwatson 
Responsible-Changed-By: kmacy 
Responsible-Changed-When: Fri Nov 16 03:50:56 UTC 2007 
Responsible-Changed-Why:  

Robert has been most active in netatalk. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=4184 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/4184: commit references a PR
Date: Tue, 20 Nov 2007 18:36:04 +0000 (UTC)

 rwatson     2007-11-20 18:35:57 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/netatalk         aarp.c 
   Log:
   Add additional robustness to at_aarpinput() by testing for broadcast
   addresses as the source of an AARP request.  While this PR was submitted
   in the context of work in OpenBSD to port netatalk (in 1997), I've
   synchronized the code more to our ARP input routine, which had similar
   requirements.
   
   Submitted by:   Denton Gentry
   PR:             kern/4184
   MFC after:      1 week
   
   Revision  Changes    Path
   1.45      +7 -0      src/sys/netatalk/aarp.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: suspended->patched 
State-Changed-By: rwatson 
State-Changed-When: Tue Nov 20 18:51:17 UTC 2007 
State-Changed-Why:  
I've applied a variant of the first patch in order to synchronized the 
checks in AARP with those in ARP; they check for the broadcast but not 
multicast case.  The second bug is somewhat overshadowed by more buggy 
handling of mbuf headers, so I've committed a comment about that 
section of the code needing revisiting and will explore this more at a 
later date. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=4184 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/4184: commit references a PR
Date: Tue, 20 Nov 2007 18:51:01 +0000 (UTC)

 rwatson     2007-11-20 18:50:54 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/netatalk         ddp_output.c 
   Log:
   Annotate two possible bugs in a comment: (1) we allocate and explicitly
   prepend a data mbuf in front of a header mbuf without moving the header
   to the new mbuf, and (2) a possible alignment problem on architectures
   with strict alignment as reported in kern/4184.
   
   PR:     kern/4184 (1)
   
   Revision  Changes    Path
   1.32      +8 -0      src/sys/netatalk/ddp_output.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->suspended 
State-Changed-By: rwatson 
State-Changed-When: Wed Jan 30 22:28:02 UTC 2008 
State-Changed-Why:  
Now MFC'd to 7.x and will appear in 7.1.  Placing in 'suspended' state 
since there are further issues in the netatalk code that probably 
require more looking at at another point. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=4184 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/4184: commit references a PR
Date: Wed, 30 Jan 2008 22:25:22 +0000 (UTC)

 rwatson     2008-01-30 22:25:13 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sys/netatalk         aarp.c 
   Log:
   Merge aarp.c:1.45 from HEAD to RELENG_7:
   
     Add additional robustness to at_aarpinput() by testing for broadcast
     addresses as the source of an AARP request.  While this PR was submitted
     in the context of work in OpenBSD to port netatalk (in 1997), I've
     synchronized the code more to our ARP input routine, which had similar
     requirements.
   
     Submitted by:   Denton Gentry
     PR:             kern/4184
   
   Revision  Changes    Path
   1.42.2.1  +7 -0      src/sys/netatalk/aarp.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/4184: commit references a PR
Date: Wed, 30 Jan 2008 22:25:39 +0000 (UTC)

 rwatson     2008-01-30 22:25:34 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sys/netatalk         ddp_output.c 
   Log:
   Merge ddp_output.c:1.32 from HEAD to RELENG_7:
   
     Annotate two possible bugs in a comment: (1) we allocate and explicitly
     prepend a data mbuf in front of a header mbuf without moving the header
     to the new mbuf, and (2) a possible alignment problem on architectures
     with strict alignment as reported in kern/4184.
   
     PR:     kern/4184 (1)
   
   Revision  Changes    Path
   1.30.2.1  +8 -0      src/sys/netatalk/ddp_output.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: suspended->closed 
State-Changed-By: eadler 
State-Changed-When: Thu Dec 22 04:11:51 UTC 2011 
State-Changed-Why:  
the issues reported here have been fixed. further issues should be 
reported in a new pr 

http://www.freebsd.org/cgi/query-pr.cgi?pr=4184 
>Unformatted:

Please resolve and close.
