Revive the RTF_LLINFO flag in route.h. The kernel code is guarded

by the new kernel option COMPAT_ROUTE_FLAGS for binary backward
compatibility. The RTF_LLDATA flag maps to the same value as RTF_LLINFO.
RTF_LLDATA is used by the arp and ndp utilities. The RTF_LLDATA flag is
always returned to the userland regardless whether the COMPAT_ROUTE_FLAGS
is defined.
This commit is contained in:
Qing Li 2009-01-12 11:24:32 +00:00
parent 0035611858
commit 14981d8057
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=187094
4 changed files with 14 additions and 2 deletions

View File

@ -411,6 +411,7 @@ PPP_DEFLATE opt_ppp.h
PPP_FILTER opt_ppp.h
RADIX_MPATH opt_mpath.h
ROUTETABLES opt_route.h
COMPAT_ROUTE_FLAGS opt_route.h
SLIP_IFF_OPTS opt_slip.h
TCPDEBUG
TCP_OFFLOAD_DISABLE opt_inet.h #Disable code to dispatch tcp offloading

View File

@ -173,7 +173,8 @@ struct ortentry {
/* 0x80 unused, was RTF_DELCLONE */
/* 0x100 unused, was RTF_CLONING */
#define RTF_XRESOLVE 0x200 /* external daemon resolves name */
/* 0x400 unused, was RTF_LLINFO */
#define RTF_LLINFO 0x400 /* DEPRECATED - exists ONLY for backward
compatibility */
#define RTF_LLDATA 0x400 /* used by apps to add/del L2 entries */
#define RTF_STATIC 0x800 /* manually added */
#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */

View File

@ -31,6 +31,7 @@
*/
#include "opt_sctp.h"
#include "opt_mpath.h"
#include "opt_route.h"
#include "opt_inet.h"
#include "opt_inet6.h"
@ -1446,7 +1447,12 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS)
* take care of llinfo entries, the caller must
* specify an AF
*/
if (w.w_op == NET_RT_FLAGS && w.w_arg == 0) {
if (w.w_op == NET_RT_FLAGS &&
#if defined(COMPAT_ROUTE_FLAGS)
(w.w_arg & RTF_LLINFO)) {
#else
w.w_arg == 0) {
#endif
if (af != 0)
error = lltable_sysctl_dumparp(af, w.w_req);
else

View File

@ -2252,6 +2252,10 @@ in6_lltable_dump(struct lltable *llt, struct sysctl_req *wr)
*/
bzero(&ndpc, sizeof(ndpc));
ndpc.rtm.rtm_msglen = sizeof(ndpc);
ndpc.rtm.rtm_version = RTM_VERSION;
ndpc.rtm.rtm_type = RTM_GET;
ndpc.rtm.rtm_flags = RTF_UP;
ndpc.rtm.rtm_addrs = RTA_DST | RTA_GATEWAY;
ndpc.sin6.sin6_family = AF_INET6;
ndpc.sin6.sin6_len = sizeof(ndpc.sin6);
bcopy(L3_ADDR(lle), &ndpc.sin6, L3_ADDR_LEN(lle));