>Number:         172985
>Category:       kern
>Synopsis:       [patch] [ip6] lltable leak when adding and removing IPv6 
>addresses
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 23 15:00:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Smedley
>Release:        FreeBSD-CURRENT
>Organization:
Cisco
>Environment:
FreeBSD test-freebsd10 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r241078: Mon Oct  1 
02:35:30 UTC 2012     [email protected]:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
I've found a lltable leak when you add and remove IPv6 addresses. I've made a 
patch and it appears to address the issue but I'm not familiar with the code so 
it could do with some code review.
>How-To-Repeat:
# vmstat -m | grep lltable
      lltable    14     4K       -       14  128,256
# ifconfig em0 inet6 3ffe:b00:1:1::1 alias
# vmstat -m | grep lltable
      lltable    15     4K       -       15  128,256
# ifconfig em0 inet6 3ffe:b00:1:1::1 -alias
# vmstat -m | grep lltable
         Type InUse MemUse  HighUse Requests  Size(s)
      lltable    15     4K       -       15  128,256
>Fix:


Patch attached with submission follows:

Index: in6.c
===================================================================
--- in6.c       (revision 241923)
+++ in6.c       (working copy)
@@ -2603,10 +2603,11 @@
                if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) {
                        LLE_WLOCK(lle);
                        lle->la_flags |= LLE_DELETED;
-                       LLE_WUNLOCK(lle);
 #ifdef DIAGNOSTIC
                        log(LOG_INFO, "ifaddr cache = %p  is deleted\n", lle);
 #endif
+                       LIST_REMOVE(lle, lle_next);
+                       LLE_FREE_LOCKED(lle);
                }
                lle = (void *)-1;
        }


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to