[haiku-bugs] Re: [Haiku] #9184: ifconfig up/down an interface repeatedly causes a kdl

  • From: "jackburton" <trac@xxxxxxxxxxxx>
  • Date: Tue, 08 Jan 2013 15:58:43 -0000

#9184: ifconfig up/down an interface repeatedly causes a kdl
---------------------------------------+----------------------------
   Reporter:  kallisti5                |      Owner:  axeld
       Type:  bug                      |     Status:  new
   Priority:  normal                   |  Milestone:  R1/beta1
  Component:  Network & Internet/IPv6  |    Version:  R1/Development
 Resolution:                           |   Keywords:
 Blocked By:                           |   Blocking:
Has a Patch:  0                        |   Platform:  All
---------------------------------------+----------------------------

Comment (by jackburton):

 I found out that the KDL doesn't happen if I remove the ipv6 module.
 After having a look at the code, I suspect that the culprit is the
 function
 ipv6_setsockopt() in src/add-ons/kernel/network/protocols/ipv6.cpp

 at line 1240 it calls sDatalinkModule->get_interface_with_address() but,
 unlike the ipv4 equivalent code, it does not call
 sDatalinkModule->put_interface(interface).

 ipv6:
 {{{
         struct net_interface* interface
                 = sDatalinkModule->get_interface_with_address(
                         (sockaddr*)address);
         if (interface == NULL) {
                 delete address;
                 return EADDRNOTAVAIL;
         }

         delete protocol->multicast_address;
         protocol->multicast_address = (struct sockaddr*)address;
         return B_OK;
 }}}

 cf. ipv4:
 {{{
         struct net_interface* interface
                 = sDatalinkModule->get_interface_with_address(
                         (sockaddr*)address);
         if (interface == NULL) {
                 delete address;
                 return EADDRNOTAVAIL;
         }

         delete protocol->multicast_address;
         protocol->multicast_address = (struct sockaddr*)address;
         sDatalinkModule->put_interface(interface);
         return B_OK;
 }}}

 I don't have a development system at hand, but maybe somebody can comment
 on this, or even commit the fix.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/9184#comment:2>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: