Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. Linux kernel IPv6 routing and forwarding
  2. ========================================
  3.  
  4. We don't want to free the routing cache entry after a packet has been
  5. forwarded: the purpose of the cache entry is to be re-used shortly...
  6.  
  7. If policy routing is enabled...
  8.  
  9.  
  10. We've found the FIB table to search for a an entry i.e. a FIB6 node
  11.  
  12. static struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table, int oif,
  13. struct flowi6 *fl6, int flags)
  14.  
  15. Once we've found the FIB node we call the function below
  16.  
  17. static struct rt6_info *rt6_select(struct fib6_node *fn, int oif, int strict)
  18.  
  19. It returns an entry even if no route is found, this is the
  20. net->ipv6.ip6_null_entry If the previous is returned or an entry that
  21. is already a cache entry, the functions returns. Otherwise a clone of
  22. the macth is created with two possible variants: COW or CLONE
  23.  
  24.  
  25. A FIB6 node is a routing table entry, not a routing cache entry: where
  26. is the cache entry created ?!
  27.  
  28. static inline struct rt6_info *ip6_dst_alloc(struct net *net,
  29. struct net_device *dev,
  30. int flags,
  31. struct fib6_table *table)
  32.  
  33. struct fib6_node {
  34. struct fib6_node *parent;
  35. struct fib6_node *left;
  36. struct fib6_node *right;
  37. #ifdef CONFIG_IPV6_SUBTREES
  38. struct fib6_node *subtree;
  39. #endif
  40. struct rt6_info *leaf;
  41.  
  42. __u16 fn_bit; /* bit key */
  43. __u16 fn_flags;
  44. __u32 fn_sernum;
  45. struct rt6_info *rr_ptr;
  46. };
  47.  
  48.  
  49. Looking for who is allocating cache entries
  50.  
  51. /*
  52. * Add routing information to the routing tree.
  53. * <destination addr>/<source addr>
  54. * with source addr info in sub-trees
  55. */
  56.  
  57. int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info)
  58. {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement