route.c (ab450605b35caa768ca33e86db9403229bf42be4) | route.c (904af04d30f303d96902584206457128c3051d8d) |
---|---|
1/* 2 * Linux INET6 implementation 3 * FIB front-end. 4 * 5 * Authors: 6 * Pedro Roque <roque@di.fc.ul.pt> 7 * 8 * This program is free software; you can redistribute it and/or --- 40 unchanged lines hidden (view full) --- 49#include <net/ipv6.h> 50#include <net/ip6_fib.h> 51#include <net/ip6_route.h> 52#include <net/ndisc.h> 53#include <net/addrconf.h> 54#include <net/tcp.h> 55#include <linux/rtnetlink.h> 56#include <net/dst.h> | 1/* 2 * Linux INET6 implementation 3 * FIB front-end. 4 * 5 * Authors: 6 * Pedro Roque <roque@di.fc.ul.pt> 7 * 8 * This program is free software; you can redistribute it and/or --- 40 unchanged lines hidden (view full) --- 49#include <net/ipv6.h> 50#include <net/ip6_fib.h> 51#include <net/ip6_route.h> 52#include <net/ndisc.h> 53#include <net/addrconf.h> 54#include <net/tcp.h> 55#include <linux/rtnetlink.h> 56#include <net/dst.h> |
57#include <net/dst_metadata.h> |
|
57#include <net/xfrm.h> 58#include <net/netevent.h> 59#include <net/netlink.h> 60#include <net/nexthop.h> 61#include <net/lwtunnel.h> | 58#include <net/xfrm.h> 59#include <net/netevent.h> 60#include <net/netlink.h> 61#include <net/nexthop.h> 62#include <net/lwtunnel.h> |
63#include <net/ip_tunnels.h> |
|
62 63#include <asm/uaccess.h> 64 65#ifdef CONFIG_SYSCTL 66#include <linux/sysctl.h> 67#endif 68 69enum rt6_nud_state { --- 1056 unchanged lines hidden (view full) --- 1126 return fib6_rule_lookup(net, fl6, flags, ip6_pol_route_input); 1127} 1128 1129void ip6_route_input(struct sk_buff *skb) 1130{ 1131 const struct ipv6hdr *iph = ipv6_hdr(skb); 1132 struct net *net = dev_net(skb->dev); 1133 int flags = RT6_LOOKUP_F_HAS_SADDR; | 64 65#include <asm/uaccess.h> 66 67#ifdef CONFIG_SYSCTL 68#include <linux/sysctl.h> 69#endif 70 71enum rt6_nud_state { --- 1056 unchanged lines hidden (view full) --- 1128 return fib6_rule_lookup(net, fl6, flags, ip6_pol_route_input); 1129} 1130 1131void ip6_route_input(struct sk_buff *skb) 1132{ 1133 const struct ipv6hdr *iph = ipv6_hdr(skb); 1134 struct net *net = dev_net(skb->dev); 1135 int flags = RT6_LOOKUP_F_HAS_SADDR; |
1136 struct ip_tunnel_info *tun_info; |
|
1134 struct flowi6 fl6 = { 1135 .flowi6_iif = skb->dev->ifindex, 1136 .daddr = iph->daddr, 1137 .saddr = iph->saddr, 1138 .flowlabel = ip6_flowinfo(iph), 1139 .flowi6_mark = skb->mark, 1140 .flowi6_proto = iph->nexthdr, 1141 }; 1142 | 1137 struct flowi6 fl6 = { 1138 .flowi6_iif = skb->dev->ifindex, 1139 .daddr = iph->daddr, 1140 .saddr = iph->saddr, 1141 .flowlabel = ip6_flowinfo(iph), 1142 .flowi6_mark = skb->mark, 1143 .flowi6_proto = iph->nexthdr, 1144 }; 1145 |
1146 tun_info = skb_tunnel_info(skb); 1147 if (tun_info && tun_info->mode == IP_TUNNEL_INFO_RX) 1148 fl6.flowi6_tun_key.tun_id = tun_info->key.tun_id; |
|
1143 skb_dst_drop(skb); 1144 skb_dst_set(skb, ip6_route_input_lookup(net, skb->dev, &fl6, flags)); 1145} 1146 1147static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table *table, 1148 struct flowi6 *fl6, int flags) 1149{ 1150 return ip6_pol_route(net, table, fl6->flowi6_oif, fl6, flags); --- 2420 unchanged lines hidden --- | 1149 skb_dst_drop(skb); 1150 skb_dst_set(skb, ip6_route_input_lookup(net, skb->dev, &fl6, flags)); 1151} 1152 1153static struct rt6_info *ip6_pol_route_output(struct net *net, struct fib6_table *table, 1154 struct flowi6 *fl6, int flags) 1155{ 1156 return ip6_pol_route(net, table, fl6->flowi6_oif, fl6, flags); --- 2420 unchanged lines hidden --- |