Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Move RTF_ANNOUNCE flag so that it no longer conflicts with R...



details:   https://anonhg.NetBSD.org/src/rev/d6921ef03ad7
branches:  trunk
changeset: 771135:d6921ef03ad7
user:      gdt <gdt%NetBSD.org@localhost>
date:      Fri Nov 11 15:09:32 2011 +0000

description:
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.

diffstat:

 sbin/route/keywords.c     |  3 ++-
 sbin/route/keywords.h     |  3 ++-
 sbin/route/keywords.sh    |  3 ++-
 sbin/route/route.8        |  3 ++-
 sbin/route/route.c        |  7 +++++--
 sbin/route/show.c         |  7 ++++---
 sys/net/route.h           |  3 ++-
 sys/netinet/icmp6.h       |  4 +---
 sys/netinet/if_inarp.h    |  8 +-------
 sys/netinet6/nd6.h        |  7 +------
 usr.bin/netstat/netstat.1 |  3 ++-
 usr.bin/netstat/show.c    |  3 ++-
 12 files changed, 26 insertions(+), 28 deletions(-)

diffs (241 lines):

diff -r 65fc80d267f9 -r d6921ef03ad7 sbin/route/keywords.c
--- a/sbin/route/keywords.c     Fri Nov 11 13:26:45 2011 +0000
+++ b/sbin/route/keywords.c     Fri Nov 11 15:09:32 2011 +0000
@@ -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 @@
        {"noreject", K_NOREJECT},
        {"mpls", K_MPLS},
        {"tag", K_TAG},
+       {"proxy", K_PROXY},
        {0, 0}
 };
 
diff -r 65fc80d267f9 -r d6921ef03ad7 sbin/route/keywords.h
--- a/sbin/route/keywords.h     Fri Nov 11 13:26:45 2011 +0000
+++ b/sbin/route/keywords.h     Fri Nov 11 15:09:32 2011 +0000
@@ -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 @@
 #define        K_NOREJECT      53
 #define        K_MPLS  54
 #define        K_TAG   55
+#define        K_PROXY 56
diff -r 65fc80d267f9 -r d6921ef03ad7 sbin/route/keywords.sh
--- a/sbin/route/keywords.sh    Fri Nov 11 13:26:45 2011 +0000
+++ b/sbin/route/keywords.sh    Fri Nov 11 15:09:32 2011 +0000
@@ -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 @@
 noreject
 mpls
 tag
+proxy
 _EOF_
 
 
diff -r 65fc80d267f9 -r d6921ef03ad7 sbin/route/route.8
--- a/sbin/route/route.8        Fri Nov 11 13:26:45 2011 +0000
+++ b/sbin/route/route.8        Fri Nov 11 15:09:32 2011 +0000
@@ -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 @@
 -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
diff -r 65fc80d267f9 -r d6921ef03ad7 sbin/route/route.c
--- a/sbin/route/route.c        Fri Nov 11 13:26:45 2011 +0000
+++ b/sbin/route/route.c        Fri Nov 11 15:09:32 2011 +0000
@@ -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 @@
 #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 @@
                        case K_PROTO2:
                                flags |= RTF_PROTO2;
                                break;
+                       case K_PROXY:
+                               flags |= RTF_ANNOUNCE;
+                               break;
                        case K_CLONING:
                                flags |= RTF_CLONING;
                                break;
diff -r 65fc80d267f9 -r d6921ef03ad7 sbin/route/show.c
--- a/sbin/route/show.c Fri Nov 11 13:26:45 2011 +0000
+++ b/sbin/route/show.c Fri Nov 11 15:09:32 2011 +0000
@@ -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 @@
  * 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 @@
        { RTF_CLONED,   'c' },
        { RTF_PROTO1,   '1' },
        { RTF_PROTO2,   '2' },
+       { RTF_ANNOUNCE, 'p' },
        { 0, '\0' }
 };
 
diff -r 65fc80d267f9 -r d6921ef03ad7 sys/net/route.h
--- a/sys/net/route.h   Fri Nov 11 13:26:45 2011 +0000
+++ b/sys/net/route.h   Fri Nov 11 15:09:32 2011 +0000
@@ -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 @@
 #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 */
 
 
 /*
diff -r 65fc80d267f9 -r d6921ef03ad7 sys/netinet/icmp6.h
--- a/sys/netinet/icmp6.h       Fri Nov 11 13:26:45 2011 +0000
+++ b/sys/netinet/icmp6.h       Fri Nov 11 15:09:32 2011 +0000
@@ -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 @@
        { "nd6_maxqueuelen", CTLTYPE_INT }, \
 }
 
-#define RTF_PROBEMTU   RTF_PROTO1
-
 #ifdef _KERNEL
 struct rtentry;
 struct rttimer;
diff -r 65fc80d267f9 -r d6921ef03ad7 sys/netinet/if_inarp.h
--- a/sys/netinet/if_inarp.h    Fri Nov 11 13:26:45 2011 +0000
+++ b/sys/netinet/if_inarp.h    Fri Nov 11 15:09:32 2011 +0000
@@ -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 @@
 #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 *);
diff -r 65fc80d267f9 -r d6921ef03ad7 sys/netinet6/nd6.h
--- a/sys/netinet6/nd6.h        Fri Nov 11 13:26:45 2011 +0000
+++ b/sys/netinet6/nd6.h        Fri Nov 11 15:09:32 2011 +0000
@@ -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>
 
diff -r 65fc80d267f9 -r d6921ef03ad7 usr.bin/netstat/netstat.1
--- a/usr.bin/netstat/netstat.1 Fri Nov 11 13:26:45 2011 +0000
+++ b/usr.bin/netstat/netstat.1 Fri Nov 11 15:09:32 2011 +0000
@@ -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 @@
 .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
diff -r 65fc80d267f9 -r d6921ef03ad7 usr.bin/netstat/show.c
--- a/usr.bin/netstat/show.c    Fri Nov 11 13:26:45 2011 +0000
+++ b/usr.bin/netstat/show.c    Fri Nov 11 15:09:32 2011 +0000
@@ -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 @@
        /* { RTF_PROTO3,        '3' }, */
        { RTF_CLONED,   'c' },
        /* { RTF_JUMBO, 'J' }, */
+       { RTF_ANNOUNCE, 'p' },
        { 0, 0 }
 };
 



Home | Main Index | Thread Index | Old Index