diff options
author | qingli <qingli@FreeBSD.org> | 2009-01-12 11:24:32 +0000 |
---|---|---|
committer | qingli <qingli@FreeBSD.org> | 2009-01-12 11:24:32 +0000 |
commit | 751dff36104851edee18dc55bd333b085a912d68 (patch) | |
tree | d82dbdbb0112cce72e73dff9f89fa6d0429199e8 | |
parent | c9e59ec6fa825d5d93c9929e20f76b414e42e005 (diff) | |
download | FreeBSD-src-751dff36104851edee18dc55bd333b085a912d68.zip FreeBSD-src-751dff36104851edee18dc55bd333b085a912d68.tar.gz |
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.
-rw-r--r-- | sys/conf/options | 1 | ||||
-rw-r--r-- | sys/net/route.h | 3 | ||||
-rw-r--r-- | sys/net/rtsock.c | 8 | ||||
-rw-r--r-- | sys/netinet6/in6.c | 4 |
4 files changed, 14 insertions, 2 deletions
diff --git a/sys/conf/options b/sys/conf/options index 34c1d63..b7424f61 100644 --- a/sys/conf/options +++ b/sys/conf/options @@ -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 diff --git a/sys/net/route.h b/sys/net/route.h index ed43496..44b04ac 100644 --- a/sys/net/route.h +++ b/sys/net/route.h @@ -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) */ diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 45e3c92..8c5499c 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -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 diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index b7c5111..fc0333b 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -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)); |