route.c (2702e0a46c2d28da92b32c9b068ee1291fc0de35) route.c (1ce85fe402137824246bad03ff85f3913d565c17)
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

--- 84 unchanged lines hidden (view full) ---

93 unsigned pref);
94static struct rt6_info *rt6_get_route_info(struct net *net,
95 struct in6_addr *prefix, int prefixlen,
96 struct in6_addr *gwaddr, int ifindex);
97#endif
98
99static struct dst_ops ip6_dst_ops_template = {
100 .family = AF_INET6,
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

--- 84 unchanged lines hidden (view full) ---

93 unsigned pref);
94static struct rt6_info *rt6_get_route_info(struct net *net,
95 struct in6_addr *prefix, int prefixlen,
96 struct in6_addr *gwaddr, int ifindex);
97#endif
98
99static struct dst_ops ip6_dst_ops_template = {
100 .family = AF_INET6,
101 .protocol = __constant_htons(ETH_P_IPV6),
101 .protocol = cpu_to_be16(ETH_P_IPV6),
102 .gc = ip6_dst_gc,
103 .gc_thresh = 1024,
104 .check = ip6_dst_check,
105 .destroy = ip6_dst_destroy,
106 .ifdown = ip6_dst_ifdown,
107 .negative_advice = ip6_negative_advice,
108 .link_failure = ip6_link_failure,
109 .update_pmtu = ip6_rt_update_pmtu,
110 .local_out = __ip6_local_out,
111 .entries = ATOMIC_INIT(0),
112};
113
114static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu)
115{
116}
117
118static struct dst_ops ip6_dst_blackhole_ops = {
119 .family = AF_INET6,
102 .gc = ip6_dst_gc,
103 .gc_thresh = 1024,
104 .check = ip6_dst_check,
105 .destroy = ip6_dst_destroy,
106 .ifdown = ip6_dst_ifdown,
107 .negative_advice = ip6_negative_advice,
108 .link_failure = ip6_link_failure,
109 .update_pmtu = ip6_rt_update_pmtu,
110 .local_out = __ip6_local_out,
111 .entries = ATOMIC_INIT(0),
112};
113
114static void ip6_rt_blackhole_update_pmtu(struct dst_entry *dst, u32 mtu)
115{
116}
117
118static struct dst_ops ip6_dst_blackhole_ops = {
119 .family = AF_INET6,
120 .protocol = __constant_htons(ETH_P_IPV6),
120 .protocol = cpu_to_be16(ETH_P_IPV6),
121 .destroy = ip6_dst_destroy,
122 .check = ip6_dst_check,
123 .update_pmtu = ip6_rt_blackhole_update_pmtu,
124 .entries = ATOMIC_INIT(0),
125};
126
127static struct rt6_info ip6_null_entry_template = {
128 .u = {

--- 2266 unchanged lines hidden (view full) ---

2395 err = rt6_fill_node(net, skb, rt, NULL, NULL, 0,
2396 event, info->pid, seq, 0, 0, 0);
2397 if (err < 0) {
2398 /* -EMSGSIZE implies BUG in rt6_nlmsg_size() */
2399 WARN_ON(err == -EMSGSIZE);
2400 kfree_skb(skb);
2401 goto errout;
2402 }
121 .destroy = ip6_dst_destroy,
122 .check = ip6_dst_check,
123 .update_pmtu = ip6_rt_blackhole_update_pmtu,
124 .entries = ATOMIC_INIT(0),
125};
126
127static struct rt6_info ip6_null_entry_template = {
128 .u = {

--- 2266 unchanged lines hidden (view full) ---

2395 err = rt6_fill_node(net, skb, rt, NULL, NULL, 0,
2396 event, info->pid, seq, 0, 0, 0);
2397 if (err < 0) {
2398 /* -EMSGSIZE implies BUG in rt6_nlmsg_size() */
2399 WARN_ON(err == -EMSGSIZE);
2400 kfree_skb(skb);
2401 goto errout;
2402 }
2403 err = rtnl_notify(skb, net, info->pid, RTNLGRP_IPV6_ROUTE,
2404 info->nlh, gfp_any());
2403 rtnl_notify(skb, net, info->pid, RTNLGRP_IPV6_ROUTE,
2404 info->nlh, gfp_any());
2405 return;
2405errout:
2406 if (err < 0)
2407 rtnl_set_sk_err(net, RTNLGRP_IPV6_ROUTE, err);
2408}
2409
2410static int ip6_route_dev_notify(struct notifier_block *this,
2411 unsigned long event, void *data)
2412{

--- 408 unchanged lines hidden ---
2406errout:
2407 if (err < 0)
2408 rtnl_set_sk_err(net, RTNLGRP_IPV6_ROUTE, err);
2409}
2410
2411static int ip6_route_dev_notify(struct notifier_block *this,
2412 unsigned long event, void *data)
2413{

--- 408 unchanged lines hidden ---