|
@@ -154,6 +154,7 @@ static u32 *ipv4_cow_metrics(struct dst_entry *dst, unsigned long old)
|
|
static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst,
|
|
static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst,
|
|
struct sk_buff *skb,
|
|
struct sk_buff *skb,
|
|
const void *daddr);
|
|
const void *daddr);
|
|
|
|
+static void ipv4_confirm_neigh(const struct dst_entry *dst, const void *daddr);
|
|
|
|
|
|
static struct dst_ops ipv4_dst_ops = {
|
|
static struct dst_ops ipv4_dst_ops = {
|
|
.family = AF_INET,
|
|
.family = AF_INET,
|
|
@@ -168,6 +169,7 @@ static struct dst_ops ipv4_dst_ops = {
|
|
.redirect = ip_do_redirect,
|
|
.redirect = ip_do_redirect,
|
|
.local_out = __ip_local_out,
|
|
.local_out = __ip_local_out,
|
|
.neigh_lookup = ipv4_neigh_lookup,
|
|
.neigh_lookup = ipv4_neigh_lookup,
|
|
|
|
+ .confirm_neigh = ipv4_confirm_neigh,
|
|
};
|
|
};
|
|
|
|
|
|
#define ECN_OR_COST(class) TC_PRIO_##class
|
|
#define ECN_OR_COST(class) TC_PRIO_##class
|
|
@@ -461,6 +463,23 @@ static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst,
|
|
return neigh_create(&arp_tbl, pkey, dev);
|
|
return neigh_create(&arp_tbl, pkey, dev);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void ipv4_confirm_neigh(const struct dst_entry *dst, const void *daddr)
|
|
|
|
+{
|
|
|
|
+ struct net_device *dev = dst->dev;
|
|
|
|
+ const __be32 *pkey = daddr;
|
|
|
|
+ const struct rtable *rt;
|
|
|
|
+
|
|
|
|
+ rt = (const struct rtable *)dst;
|
|
|
|
+ if (rt->rt_gateway)
|
|
|
|
+ pkey = (const __be32 *)&rt->rt_gateway;
|
|
|
|
+ else if (!daddr ||
|
|
|
|
+ (rt->rt_flags &
|
|
|
|
+ (RTCF_MULTICAST | RTCF_BROADCAST | RTCF_LOCAL)))
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ __ipv4_confirm_neigh(dev, *(__force u32 *)pkey);
|
|
|
|
+}
|
|
|
|
+
|
|
#define IP_IDENTS_SZ 2048u
|
|
#define IP_IDENTS_SZ 2048u
|
|
|
|
|
|
static atomic_t *ip_idents __read_mostly;
|
|
static atomic_t *ip_idents __read_mostly;
|