Commit 0c5c2d30 authored by Eric Biederman's avatar Eric Biederman Committed by David S. Miller

neigh: Allow for user space users of the neighbour table

Currently it is possible to do just about everything with the arp table
from user space except treat an entry like you are using it.  To that end
implement and a flag NTF_USE that when set in a netwlink update request
treats the neighbour table entry like the kernel does on the output path.

This allows user space applications to share the kernel's arp cache.
Signed-off-by: default avatarEric Biederman <ebiederm@aristanetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fc1f9ea5
...@@ -31,6 +31,7 @@ enum ...@@ -31,6 +31,7 @@ enum
* Neighbor Cache Entry Flags * Neighbor Cache Entry Flags
*/ */
#define NTF_USE 0x01
#define NTF_PROXY 0x08 /* == ATF_PUBL */ #define NTF_PROXY 0x08 /* == ATF_PUBL */
#define NTF_ROUTER 0x80 #define NTF_ROUTER 0x80
......
...@@ -1654,7 +1654,11 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) ...@@ -1654,7 +1654,11 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
flags &= ~NEIGH_UPDATE_F_OVERRIDE; flags &= ~NEIGH_UPDATE_F_OVERRIDE;
} }
err = neigh_update(neigh, lladdr, ndm->ndm_state, flags); if (ndm->ndm_flags & NTF_USE) {
neigh_event_send(neigh, NULL);
err = 0;
} else
err = neigh_update(neigh, lladdr, ndm->ndm_state, flags);
neigh_release(neigh); neigh_release(neigh);
goto out_dev_put; goto out_dev_put;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment