1. 04 1月, 2008 1 次提交
    • J
      [X25]: Add missing x25_neigh_put · 76975f8a
      Julia Lawall 提交于
      The function x25_get_neigh increments a reference count.  At the point of
      the second goto out, the result of calling x25_get_neigh is only stored in
      a local variable, and thus no one outside the function will be able to
      decrease the reference count.  Thus, x25_neigh_put should be called before
      the return in this case.
      
      The problem was found using the following semantic match.
      (http://www.emn.fr/x-info/coccinelle/)
      
      // <smpl>
      
      @@
      type T,T1,T2;
      identifier E;
      statement S;
      expression x1,x2,x3;
      int ret;
      @@
      
        T E;
        ...
      * if ((E = x25_get_neigh(...)) == NULL)
        S
        ... when != x25_neigh_put(...,(T1)E,...)
            when != if (E != NULL) { ... x25_neigh_put(...,(T1)E,...); ...}
            when != x1 = (T1)E
            when != E = x3;
            when any
        if (...) {
          ... when != x25_neigh_put(...,(T2)E,...)
              when != if (E != NULL) { ... x25_neigh_put(...,(T2)E,...); ...}
              when != x2 = (T2)E
      (
      *   return;
      |
      *   return ret;
      )
        }
      // </smpl>
      Signed-off-by: NJulia Lawall <julia@diku.dk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      76975f8a
  2. 20 3月, 2007 1 次提交
  3. 09 2月, 2007 1 次提交
    • A
      [X.25]: Add call forwarding · 95a9dc43
      Andrew Hendry 提交于
      Adds call forwarding to X.25, allowing it to operate like an X.25 router.
      Useful if one needs to manipulate X.25 traffic with tools like tc.
      This is an update/cleanup based off a patch submitted by Daniel Ferenci a few years ago.
      
      Thanks Alan for the feedback.
      Added the null check to the clones.
      Moved the skb_clone's into the forwarding functions.
      
      Worked ok with Cisco XoT, linux X.25 back to back, and some old NTUs/PADs.
      Signed-off-by: NAndrew Hendry <andrew.hendry@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      95a9dc43