#6211 BLOC Future : patch for support of per packet mesh ttl

Zarro Boogs per Child bugtracker at laptop.org
Wed Feb 13 17:36:33 EST 2008


#6211: patch for support of per packet mesh ttl
--------------------------+-------------------------------------------------
  Reporter:  mbletsas     |       Owner:  dwmw2                         
      Type:  enhancement  |      Status:  new                           
  Priority:  blocker      |   Milestone:  Future Release                
 Component:  wireless     |     Version:                                
Resolution:               |    Keywords:  libertas, ttl, mesh, Update.1?
  Verified:  0            |    Blocking:                                
 Blockedby:               |  
--------------------------+-------------------------------------------------
Changes (by cscott):

 * cc: jg, mbletsas, cjb, dilinger, dwmw2 (added)


Comment:

 Has this patch ever been tested?

 Some fundamental problems:
 {{{
 +               if (mesh_opts.get_sock_ttl) {
 +                       tx_data[0] = 0; /* reserved */
 +                       tx_data[1] = 0; /* reserved */
 +                       tx_data[2] = 1; /* ttl */
 }}}
  * In the first line, get_sock_ttl is a function pointer.  It is supposed
 to return the appropriate ttl, but it is never called.
  * In the last line, the ttl is apparently always hardcoded to one (again,
 get_sock_ttl is never called anywhere)
  * In addition, there are locking and lookup issues: do_set_mesh_ttl
 always creates a new entry in a linked list, but lookup will only find the
 first.  When the entry is freed, the wrong entry will be cleaned up and
 cause races to boot.  (see mesh_sk_destruct)

 Some style problems:
  * There are, not one, but *two* global variables, both named 'mesh_opts'.
  * If get_sock_ttl were ever to be called, it would perform a linear
 search through a list of socket options, which could be unpleasant.
 (thanks, wad)
  * Craziness with txpd->tx_packet_length and pkt_len.

 The basic idea is not completely unreasonable. Traceroute, for example,
 contains this code:
 {{{
         if (af == AF_INET)
                 setsockopt (sk, SOL_IP, IP_RECVTTL, &n, sizeof (n));
         else if (af == AF_INET6)
                 setsockopt (sk, SOL_IPV6, IPV6_RECVHOPLIMIT, &n, sizeof
 (n));
 }}}
 The trick here is that we want a link-layer ttl, not a IP ttl, since mesh
 hops aren't IP hops.
 The suggestion at http://lists.openwall.net/netdev/2007/08/16/141 of using
 a generic SO_LL_TTL socket option seems reasonable to me, since you can
 have link-layer hops even on a switched ethernet network (say).

 This patch, however, is certainly not ready to apply.

 (Could someone please add Javier to the CC list?  I don't know his trac
 username.)

-- 
Ticket URL: <http://dev.laptop.org/ticket/6211#comment:4>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system



More information about the Bugs mailing list