svn commit: r187094 - in head/sys: conf net netinet6
Qing Li
qingli at FreeBSD.org
Mon Jan 12 03:24:37 PST 2009
Author: qingli
Date: Mon Jan 12 11:24:32 2009
New Revision: 187094
URL: http://svn.freebsd.org/changeset/base/187094
Log:
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.
Modified:
head/sys/conf/options
head/sys/net/route.h
head/sys/net/rtsock.c
head/sys/netinet6/in6.c
Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options Mon Jan 12 08:22:36 2009 (r187093)
+++ head/sys/conf/options Mon Jan 12 11:24:32 2009 (r187094)
@@ -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
Modified: head/sys/net/route.h
==============================================================================
--- head/sys/net/route.h Mon Jan 12 08:22:36 2009 (r187093)
+++ head/sys/net/route.h Mon Jan 12 11:24:32 2009 (r187094)
@@ -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) */
Modified: head/sys/net/rtsock.c
==============================================================================
--- head/sys/net/rtsock.c Mon Jan 12 08:22:36 2009 (r187093)
+++ head/sys/net/rtsock.c Mon Jan 12 11:24:32 2009 (r187094)
@@ -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
Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c Mon Jan 12 08:22:36 2009 (r187093)
+++ head/sys/netinet6/in6.c Mon Jan 12 11:24:32 2009 (r187094)
@@ -2252,6 +2252,10 @@ in6_lltable_dump(struct lltable *llt, st
*/
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));
More information about the svn-src-head
mailing list