Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Linux kernel IPv6 routing and forwarding
- ========================================
- We don't want to free the routing cache entry after a packet has been
- forwarded: the purpose of the cache entry is to be re-used shortly...
- If policy routing is enabled...
- We've found the FIB table to search for a an entry i.e. a FIB6 node
- static struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table, int oif,
- struct flowi6 *fl6, int flags)
- Once we've found the FIB node we call the function below
- static struct rt6_info *rt6_select(struct fib6_node *fn, int oif, int strict)
- It returns an entry even if no route is found, this is the
- net->ipv6.ip6_null_entry If the previous is returned or an entry that
- is already a cache entry, the functions returns. Otherwise a clone of
- the macth is created with two possible variants: COW or CLONE
- A FIB6 node is a routing table entry, not a routing cache entry: where
- is the cache entry created ?!
- static inline struct rt6_info *ip6_dst_alloc(struct net *net,
- struct net_device *dev,
- int flags,
- struct fib6_table *table)
- struct fib6_node {
- struct fib6_node *parent;
- struct fib6_node *left;
- struct fib6_node *right;
- #ifdef CONFIG_IPV6_SUBTREES
- struct fib6_node *subtree;
- #endif
- struct rt6_info *leaf;
- __u16 fn_bit; /* bit key */
- __u16 fn_flags;
- __u32 fn_sernum;
- struct rt6_info *rr_ptr;
- };
- Looking for who is allocating cache entries
- /*
- * Add routing information to the routing tree.
- * <destination addr>/<source addr>
- * with source addr info in sub-trees
- */
- int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info)
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement