Module Name:    src
Committed By:   gdt
Date:           Fri Nov 11 15:09:33 UTC 2011

Modified Files:
        src/sbin/route: keywords.c keywords.h keywords.sh route.8 route.c
            show.c
        src/sys/net: route.h
        src/sys/netinet: icmp6.h if_inarp.h
        src/sys/netinet6: nd6.h
        src/usr.bin/netstat: netstat.1 show.c

Log Message:
Move RTF_ANNOUNCE flag so that it no longer conflicts with RTF_PROTO2.

RTF_ANNOUNCE was defined as RTF_PROTO2.  The flag is used to indicated
that host should act as a proxy for a link level arp or ndp request.
(If RTF_PROTO2 is used as an experimental flag (as advertised),
various problems can occur.)

This commit provides a first-class definition with its own bit for
RTF_ANNOUNCE, removes the old aliasing definitions, and adds support
for the new RTF_ANNOUNCE flag to netstat(8) and route(8).,

Also, remove unused RTF_ flags that collide with RTF_PROTO1:
  netinet/icmp6.h defined RTF_PROBEMTU as RTF_PROTO1
  netinet/if_inarp.h defined RTF_USETRAILERS as RTF_PROTO1
  (Neither of these flags are used anywhere.  Both have been removed
  to reduce chances of collision with RTF_PROTO1.)

Figuring this out and the diff are the work of Beverly Schwartz of
BBN.

(Passed release build, boot in VM, with no apparently related atf
failures.)

Approved for Public Release, Distribution Unlimited
This material is based upon work supported by the Defense Advanced
Research Projects Agency and Space and Naval Warfare Systems Center,
Pacific, under Contract No. N66001-09-C-2073.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/route/keywords.c
cvs rdiff -u -r1.11 -r1.12 src/sbin/route/keywords.h
cvs rdiff -u -r1.9 -r1.10 src/sbin/route/keywords.sh
cvs rdiff -u -r1.45 -r1.46 src/sbin/route/route.8
cvs rdiff -u -r1.133 -r1.134 src/sbin/route/route.c
cvs rdiff -u -r1.43 -r1.44 src/sbin/route/show.c
cvs rdiff -u -r1.79 -r1.80 src/sys/net/route.h
cvs rdiff -u -r1.42 -r1.43 src/sys/netinet/icmp6.h src/sys/netinet/if_inarp.h
cvs rdiff -u -r1.54 -r1.55 src/sys/netinet6/nd6.h
cvs rdiff -u -r1.61 -r1.62 src/usr.bin/netstat/netstat.1
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/netstat/show.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/route/keywords.c
diff -u src/sbin/route/keywords.c:1.8 src/sbin/route/keywords.c:1.9
--- src/sbin/route/keywords.c:1.8	Sat Jun 26 14:29:36 2010
+++ src/sbin/route/keywords.c	Fri Nov 11 15:09:32 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: keywords.c,v 1.8 2010/06/26 14:29:36 kefren Exp $ */
+/* $NetBSD: keywords.c,v 1.9 2011/11/11 15:09:32 gdt Exp $ */
 
 /* WARNING!  This file was generated by keywords.sh  */
 
@@ -61,6 +61,7 @@ struct keytab keywords[] = {
 	{"noreject", K_NOREJECT},
 	{"mpls", K_MPLS},
 	{"tag", K_TAG},
+	{"proxy", K_PROXY},
 	{0, 0}
 };
 

Index: src/sbin/route/keywords.h
diff -u src/sbin/route/keywords.h:1.11 src/sbin/route/keywords.h:1.12
--- src/sbin/route/keywords.h:1.11	Sat Jun 26 14:29:36 2010
+++ src/sbin/route/keywords.h	Fri Nov 11 15:09:32 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: keywords.h,v 1.11 2010/06/26 14:29:36 kefren Exp $ */
+/* $NetBSD: keywords.h,v 1.12 2011/11/11 15:09:32 gdt Exp $ */
 
 /* WARNING!  This file was generated by keywords.sh  */
 
@@ -63,3 +63,4 @@ extern struct keytab {
 #define	K_NOREJECT	53
 #define	K_MPLS	54
 #define	K_TAG	55
+#define	K_PROXY	56

Index: src/sbin/route/keywords.sh
diff -u src/sbin/route/keywords.sh:1.9 src/sbin/route/keywords.sh:1.10
--- src/sbin/route/keywords.sh:1.9	Sat Jun 26 14:29:36 2010
+++ src/sbin/route/keywords.sh	Fri Nov 11 15:09:32 2011
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: keywords.sh,v 1.9 2010/06/26 14:29:36 kefren Exp $
+# $NetBSD: keywords.sh,v 1.10 2011/11/11 15:09:32 gdt Exp $
 # @(#)keywords	8.2 (Berkeley) 3/19/94
 #
 # WARNING!  If you change this file, re-run it!
@@ -63,6 +63,7 @@ noblackhole
 noreject
 mpls
 tag
+proxy
 _EOF_
 
 

Index: src/sbin/route/route.8
diff -u src/sbin/route/route.8:1.45 src/sbin/route/route.8:1.46
--- src/sbin/route/route.8:1.45	Sun Jul 17 23:46:53 2011
+++ src/sbin/route/route.8	Fri Nov 11 15:09:32 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: route.8,v 1.45 2011/07/17 23:46:53 dholland Exp $
+.\"	$NetBSD: route.8,v 1.46 2011/11/11 15:09:32 gdt Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -295,6 +295,7 @@ by indicating the following correspondin
 -proto1       RTF_PROTO1     - set protocol specific routing flag #1
 -proto2       RTF_PROTO2     - set protocol specific routing flag #2
 -llinfo       RTF_LLINFO     - validly translates proto addr to link addr
+-proxy        RTF_ANNOUNCE   - make entry a link level proxy
 .Ed
 .Pp
 The optional modifiers

Index: src/sbin/route/route.c
diff -u src/sbin/route/route.c:1.133 src/sbin/route/route.c:1.134
--- src/sbin/route/route.c:1.133	Fri Oct  7 09:56:15 2011
+++ src/sbin/route/route.c	Fri Nov 11 15:09:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.133 2011/10/07 09:56:15 joerg Exp $	*/
+/*	$NetBSD: route.c,v 1.134 2011/11/11 15:09:32 gdt Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)route.c	8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.133 2011/10/07 09:56:15 joerg Exp $");
+__RCSID("$NetBSD: route.c,v 1.134 2011/11/11 15:09:32 gdt Exp $");
 #endif
 #endif /* not lint */
 
@@ -922,6 +922,9 @@ newroute(int argc, char *const *argv)
 			case K_PROTO2:
 				flags |= RTF_PROTO2;
 				break;
+			case K_PROXY:
+				flags |= RTF_ANNOUNCE;
+				break;
 			case K_CLONING:
 				flags |= RTF_CLONING;
 				break;

Index: src/sbin/route/show.c
diff -u src/sbin/route/show.c:1.43 src/sbin/route/show.c:1.44
--- src/sbin/route/show.c:1.43	Fri Feb  4 14:31:23 2011
+++ src/sbin/route/show.c	Fri Nov 11 15:09:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: show.c,v 1.43 2011/02/04 14:31:23 martin Exp $	*/
+/*	$NetBSD: show.c,v 1.44 2011/11/11 15:09:32 gdt Exp $	*/
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from: @(#)route.c	8.3 (Berkeley) 3/9/94";
 #else
-__RCSID("$NetBSD: show.c,v 1.43 2011/02/04 14:31:23 martin Exp $");
+__RCSID("$NetBSD: show.c,v 1.44 2011/11/11 15:09:32 gdt Exp $");
 #endif
 #endif /* not lint */
 
@@ -70,7 +70,7 @@ __RCSID("$NetBSD: show.c,v 1.43 2011/02/
  * Definitions for showing gateway flags.
  */
 struct bits {
-	short	b_mask;
+	int	b_mask;
 	char	b_val;
 };
 static const struct bits bits[] = {
@@ -90,6 +90,7 @@ static const struct bits bits[] = {
 	{ RTF_CLONED,	'c' },
 	{ RTF_PROTO1,	'1' },
 	{ RTF_PROTO2,	'2' },
+	{ RTF_ANNOUNCE,	'p' },
 	{ 0, '\0' }
 };
 

Index: src/sys/net/route.h
diff -u src/sys/net/route.h:1.79 src/sys/net/route.h:1.80
--- src/sys/net/route.h:1.79	Thu Mar 31 19:40:52 2011
+++ src/sys/net/route.h	Fri Nov 11 15:09:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.h,v 1.79 2011/03/31 19:40:52 dyoung Exp $	*/
+/*	$NetBSD: route.h,v 1.80 2011/11/11 15:09:32 gdt Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -154,6 +154,7 @@ struct ortentry {
 #define RTF_PROTO2	0x4000		/* protocol specific routing flag */
 #define RTF_PROTO1	0x8000		/* protocol specific routing flag */
 #define RTF_SRC		0x10000		/* route has fixed source address */
+#define	RTF_ANNOUNCE	0x20000		/* announce new arp or ndp entry */
 
 
 /*

Index: src/sys/netinet/icmp6.h
diff -u src/sys/netinet/icmp6.h:1.42 src/sys/netinet/icmp6.h:1.43
--- src/sys/netinet/icmp6.h:1.42	Tue May 24 18:07:11 2011
+++ src/sys/netinet/icmp6.h	Fri Nov 11 15:09:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: icmp6.h,v 1.42 2011/05/24 18:07:11 spz Exp $	*/
+/*	$NetBSD: icmp6.h,v 1.43 2011/11/11 15:09:32 gdt Exp $	*/
 /*	$KAME: icmp6.h,v 1.84 2003/04/23 10:26:51 itojun Exp $	*/
 
 
@@ -641,8 +641,6 @@ struct icmp6_filter {
 	{ "nd6_maxqueuelen", CTLTYPE_INT }, \
 }
 
-#define RTF_PROBEMTU	RTF_PROTO1
-
 #ifdef _KERNEL
 struct	rtentry;
 struct	rttimer;
Index: src/sys/netinet/if_inarp.h
diff -u src/sys/netinet/if_inarp.h:1.42 src/sys/netinet/if_inarp.h:1.43
--- src/sys/netinet/if_inarp.h:1.42	Wed Feb 18 13:17:50 2009
+++ src/sys/netinet/if_inarp.h	Fri Nov 11 15:09:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_inarp.h,v 1.42 2009/02/18 13:17:50 yamt Exp $	*/
+/*	$NetBSD: if_inarp.h,v 1.43 2011/11/11 15:09:33 gdt Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -52,12 +52,6 @@ struct sockaddr_inarp {
 #define SIN_PROXY 1
 };
 
-/*
- * IP and ethernet specific routing flags
- */
-#define	RTF_USETRAILERS	RTF_PROTO1	/* use trailers */
-#define	RTF_ANNOUNCE	RTF_PROTO2	/* announce new arp entry */
-
 #ifdef _KERNEL
 extern struct ifqueue arpintrq;
 void arp_ifinit(struct ifnet *, struct ifaddr *);

Index: src/sys/netinet6/nd6.h
diff -u src/sys/netinet6/nd6.h:1.54 src/sys/netinet6/nd6.h:1.55
--- src/sys/netinet6/nd6.h:1.54	Tue May 24 18:07:11 2011
+++ src/sys/netinet6/nd6.h	Fri Nov 11 15:09:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.h,v 1.54 2011/05/24 18:07:11 spz Exp $	*/
+/*	$NetBSD: nd6.h,v 1.55 2011/11/11 15:09:33 gdt Exp $	*/
 /*	$KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $	*/
 
 /*
@@ -33,11 +33,6 @@
 #ifndef _NETINET6_ND6_H_
 #define _NETINET6_ND6_H_
 
-/* see net/route.h, or net/if_inarp.h */
-#ifndef RTF_ANNOUNCE
-#define RTF_ANNOUNCE	RTF_PROTO2
-#endif
-
 #include <sys/queue.h>
 #include <sys/callout.h>
 

Index: src/usr.bin/netstat/netstat.1
diff -u src/usr.bin/netstat/netstat.1:1.61 src/usr.bin/netstat/netstat.1:1.62
--- src/usr.bin/netstat/netstat.1:1.61	Tue Jun 21 20:51:27 2011
+++ src/usr.bin/netstat/netstat.1	Fri Nov 11 15:09:33 2011
@@ -1,4 +1,4 @@
-.\"	$NetBSD: netstat.1,v 1.61 2011/06/21 20:51:27 wiz Exp $
+.\"	$NetBSD: netstat.1,v 1.62 2011/11/11 15:09:33 gdt Exp $
 .\"
 .\" Copyright (c) 1983, 1990, 1992, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -348,6 +348,7 @@ The mapping between letters and flags is
 .It H	RTF_HOST	Host entry (net otherwise)
 .It L	RTF_LLINFO	Valid protocol to link address translation.
 .It M	RTF_MODIFIED	Modified dynamically (by redirect)
+.It p	RTF_ANNOUNCE	Link level proxy
 .It R	RTF_REJECT	Host or net unreachable
 .It S	RTF_STATIC	Manually added
 .It U	RTF_UP	Route usable

Index: src/usr.bin/netstat/show.c
diff -u src/usr.bin/netstat/show.c:1.14 src/usr.bin/netstat/show.c:1.15
--- src/usr.bin/netstat/show.c:1.14	Tue Jun 21 19:42:45 2011
+++ src/usr.bin/netstat/show.c	Fri Nov 11 15:09:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: show.c,v 1.14 2011/06/21 19:42:45 kefren Exp $	*/
+/*	$NetBSD: show.c,v 1.15 2011/11/11 15:09:33 gdt Exp $	*/
 /*	$OpenBSD: show.c,v 1.1 2006/05/27 19:16:37 claudio Exp $	*/
 
 /*
@@ -90,6 +90,7 @@ static const struct bits bits[] = {
 	/* { RTF_PROTO3,	'3' }, */
 	{ RTF_CLONED,	'c' },
 	/* { RTF_JUMBO,	'J' }, */
+	{ RTF_ANNOUNCE,	'p' },
 	{ 0, 0 }
 };
 

Reply via email to