diff options
author | ru <ru@FreeBSD.org> | 2001-06-12 13:31:53 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2001-06-12 13:31:53 +0000 |
commit | 1947791f919aee85ba70ae619e1acb01b4785442 (patch) | |
tree | a2dfa2059af469cf8d3eaf610a117ede5fc11473 /sbin/route/route.c | |
parent | e2ee5e2463262adf56309acd620a3a2d62787f25 (diff) | |
download | FreeBSD-src-1947791f919aee85ba70ae619e1acb01b4785442.zip FreeBSD-src-1947791f919aee85ba70ae619e1acb01b4785442.tar.gz |
Allow route(8) to create "proxy only" published ARP entries.
PR: bin/12357
Submitted by: Craig Leres <leres@ee.lbl.gov>
Diffstat (limited to 'sbin/route/route.c')
-rw-r--r-- | sbin/route/route.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c index 02a8dce..38c35f7 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -56,6 +56,7 @@ static const char rcsid[] = #include <net/route.h> #include <net/if_dl.h> #include <netinet/in.h> +#include <netinet/if_ether.h> #include <netatalk/at.h> #ifdef NS #include <netns/ns.h> @@ -94,6 +95,7 @@ union sockunion { struct sockaddr_ns sns; #endif struct sockaddr_dl sdl; + struct sockaddr_inarp sinarp; struct sockaddr_storage ss; /* added to avoid memory overrun */ } so_dst, so_gate, so_mask, so_genmask, so_ifa, so_ifp; @@ -581,7 +583,7 @@ newroute(argc, argv) register char **argv; { char *cmd, *dest = "", *gateway = "", *err; - int ishost = 0, ret, attempts, oerrno, flags = RTF_STATIC; + int ishost = 0, proxy = 0, ret, attempts, oerrno, flags = RTF_STATIC; int key; struct hostent *hp = 0; @@ -653,6 +655,9 @@ newroute(argc, argv) case K_PROTO2: flags |= RTF_PROTO2; break; + case K_PROXY: + proxy = 1; + break; case K_CLONING: flags |= RTF_CLONING; break; @@ -750,6 +755,10 @@ newroute(argc, argv) flags |= RTF_HOST; if (iflag == 0) flags |= RTF_GATEWAY; + if (proxy) { + so_dst.sinarp.sin_other = SIN_PROXY; + flags |= RTF_ANNOUNCE; + } for (attempts = 1; ; attempts++) { errno = 0; if ((ret = rtmsg(*cmd, flags)) == 0) |