Index: sbin/route/keywords =================================================================== --- sbin/route/keywords +++ sbin/route/keywords @@ -7,6 +7,7 @@ blackhole change cloning +connected del delete dst @@ -34,6 +35,7 @@ mtu net netmask +noconnected nostatic nostick osi Index: sbin/route/route.8 =================================================================== --- sbin/route/route.8 +++ sbin/route/route.8 @@ -320,14 +320,16 @@ These flags may be set (or sometimes cleared) by indicating the following corresponding modifiers: .Bd -literal --xresolve RTF_XRESOLVE - emit mesg on use (for external lookup) --iface ~RTF_GATEWAY - destination is directly reachable --static RTF_STATIC - manually added route --nostatic ~RTF_STATIC - pretend route added by kernel or daemon --reject RTF_REJECT - emit an ICMP unreachable when matched --blackhole RTF_BLACKHOLE - silently discard pkts (during updates) --proto1 RTF_PROTO1 - set protocol specific routing flag #1 --proto2 RTF_PROTO2 - set protocol specific routing flag #2 +-xresolve RTF_XRESOLVE - emit mesg on use (for external lookup) +-iface ~RTF_GATEWAY - destination is directly reachable +-static RTF_STATIC - manually added route +-nostatic ~RTF_STATIC - pretend route added by kernel or daemon +-reject RTF_REJECT - emit an ICMP unreachable when matched +-blackhole RTF_BLACKHOLE - silently discard pkts (during updates) +-connected RTF_CONNECTED - treat as a connected route +-noconnected ~RTF_CONNECTED - stop treating a connected route +-proto1 RTF_PROTO1 - set protocol specific routing flag #1 +-proto2 RTF_PROTO2 - set protocol specific routing flag #2 .Ed .Pp The optional modifiers Index: sbin/route/route.c =================================================================== --- sbin/route/route.c +++ sbin/route/route.c @@ -871,6 +871,12 @@ case K_PROXY: nrflags |= F_PROXY; break; + case K_CONNECTED: + flags |= RTF_CONNECTED; + break; + case K_NOCONNECTED: + flags &= ~RTF_CONNECTED; + break; case K_XRESOLVE: flags |= RTF_XRESOLVE; break; @@ -1610,7 +1616,7 @@ "\1mtu"; static const char routeflags[] = "\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE" - "\012XRESOLVE\013LLINFO\014STATIC\015BLACKHOLE" + "\011CONNECTED\012XRESOLVE\013LLINFO\014STATIC\015BLACKHOLE" "\017PROTO2\020PROTO1\021PRCLONING\022WASCLONED\023PROTO3" "\024FIXEDMTU\025PINNED\026LOCAL\027BROADCAST\030MULTICAST\035STICKY"; static const char ifnetflags[] = Index: sys/net/route.h =================================================================== --- sys/net/route.h +++ sys/net/route.h @@ -169,7 +169,7 @@ #define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */ #define RTF_DONE 0x40 /* message confirmed */ /* 0x80 unused, was RTF_DELCLONE */ -/* 0x100 unused, was RTF_CLONING */ +#define RTF_CONNECTED 0x100 /* hosts on this route are neighbours */ #define RTF_XRESOLVE 0x200 /* external daemon resolves name */ #define RTF_LLINFO 0x400 /* DEPRECATED - exists ONLY for backward compatibility */ @@ -197,7 +197,7 @@ /* Mask of RTF flags that are allowed to be modified by RTM_CHANGE. */ #define RTF_FMASK \ (RTF_PROTO1 | RTF_PROTO2 | RTF_PROTO3 | RTF_BLACKHOLE | \ - RTF_REJECT | RTF_STATIC | RTF_STICKY) + RTF_REJECT | RTF_STATIC | RTF_STICKY | RTF_CONNECTED) /* * fib_ nexthop API flags. Index: sys/netinet/if_ether.c =================================================================== --- sys/netinet/if_ether.c +++ sys/netinet/if_ether.c @@ -1415,6 +1415,8 @@ if (ifa->ifa_carp != NULL) return; + ifa->ifa_flags |= RTF_CONNECTED; + dst = ifa->ifa_addr; dst_in = (const struct sockaddr_in *)dst; Index: sys/netinet6/nd6.c =================================================================== --- sys/netinet6/nd6.c +++ sys/netinet6/nd6.c @@ -2551,6 +2551,7 @@ return (0); ia->ia_ifa.ifa_rtrequest = nd6_rtrequest; + ia->ia_ifa.ifa_flags |= RTF_CONNECTED; dst = (struct sockaddr *)&ia->ia_addr; ln = lltable_alloc_entry(LLTABLE6(ifp), LLE_IFADDR, dst); if (ln == NULL) Index: usr.bin/netstat/netstat.1 =================================================================== --- usr.bin/netstat/netstat.1 +++ usr.bin/netstat/netstat.1 @@ -562,6 +562,7 @@ .It Li 3 Ta Dv RTF_PROTO3 Ta "Protocol specific routing flag #3" .It Li B Ta Dv RTF_BLACKHOLE Ta "Just discard pkts (during updates)" .It Li b Ta Dv RTF_BROADCAST Ta "The route represents a broadcast address" +.It Li C Ta Dv RTF_CONNECTED Ta "Hosts on this route are neighbours" .It Li D Ta Dv RTF_DYNAMIC Ta "Created dynamically (by redirect)" .It Li G Ta Dv RTF_GATEWAY Ta "Destination requires forwarding by intermediary" .It Li H Ta Dv RTF_HOST Ta "Host entry (net otherwise)" Index: usr.bin/netstat/route.c =================================================================== --- usr.bin/netstat/route.c +++ usr.bin/netstat/route.c @@ -86,6 +86,7 @@ { RTF_DYNAMIC, 'D', "dynamic" }, { RTF_MODIFIED, 'M', "modified" }, { RTF_DONE, 'd', "done" }, /* Completed -- for routing msgs only */ + { RTF_CONNECTED,'C', "connected" }, { RTF_XRESOLVE, 'X', "xresolve" }, { RTF_STATIC, 'S', "static" }, { RTF_PROTO1, '1', "proto1" }, Index: usr.sbin/arp/arp.4 =================================================================== --- usr.sbin/arp/arp.4 +++ usr.sbin/arp/arp.4 @@ -65,16 +65,9 @@ .Er EHOSTUNREACH for a non-responding router. .Pp -The ARP cache is stored in the system routing table as -dynamically-created host routes. -The route to a directly-attached Ethernet network is installed as a -.Dq cloning -route (one with the -.Li RTF_CLONING -flag set), -causing routes to individual hosts on that network to be created on -demand. -These routes time out periodically (normally 20 minutes after validated; +Each ARP cache entry is stored in a network interface which a response +of ARP comes in. +ARP cache entires time out periodically (normally 20 minutes after validated; entries are not validated when not in use). .Pp ARP entries may be added, deleted or changed with the Index: usr.sbin/ppp/route.c =================================================================== --- usr.sbin/ppp/route.c +++ usr.sbin/ppp/route.c @@ -159,6 +159,7 @@ { RTF_DYNAMIC, 'D' }, { RTF_MODIFIED, 'M' }, { RTF_DONE, 'd' }, + { RTF_CONNECTED, 'C' }, { RTF_XRESOLVE, 'X' }, { RTF_STATIC, 'S' }, { RTF_PROTO1, '1' }, @@ -167,9 +168,6 @@ #ifdef RTF_LLINFO { RTF_LLINFO, 'L' }, #endif -#ifdef RTF_CLONING - { RTF_CLONING, 'C' }, -#endif #ifdef RTF_PROTO3 { RTF_PROTO3, '3' }, #endif Index: usr.sbin/route6d/route6d.c =================================================================== --- usr.sbin/route6d/route6d.c +++ usr.sbin/route6d/route6d.c @@ -2203,7 +2203,10 @@ rrt->rrt_info.rip6_tag = htons(routetag & 0xffff); rrt->rrt_info.rip6_metric = 1 + ifcp->ifc_metric; rrt->rrt_info.rip6_plen = ifac->ifac_plen; - rrt->rrt_flags = RTF_HOST; + if (ifac->ifac_plen == 128) + rrt->rrt_flags = RTF_HOST; + else + rrt->rrt_flags = RTF_CONNECTED; rrt->rrt_rflags |= RRTF_CHANGED; applyplen(&rrt->rrt_info.rip6_dest, ifac->ifac_plen); memset(&rrt->rrt_gw, 0, sizeof(struct in6_addr)); @@ -2521,6 +2524,9 @@ #ifdef RTF_MASK RTFLAG("m", RTF_MASK); #endif +#ifdef RTF_CONNECTED + RTFLAG("C", RTF_CONNECTED); +#endif #ifdef RTF_CLONED RTFLAG("c", RTF_CLONED); #endif @@ -2660,7 +2666,7 @@ sin6_dst = sin6_gw = sin6_mask = sin6_genmask = sin6_ifp = 0; if ((rtm->rtm_flags & RTF_UP) == 0 || rtm->rtm_flags & - (RTF_XRESOLVE|RTF_BLACKHOLE)) { + (RTF_CONNECTED|RTF_XRESOLVE|RTF_BLACKHOLE)) { return; /* not interested in the link route */ } /* do not look at cloned routes */