switch /usr/bin/cpp to tradcpp

2014-08-09 Thread Jonathan Gray
This switches the /usr/bin/cpp shell script cpp wrapper to tradcpp.
As the script sets -traditional by default anything calling this script
has been getting traditional semantics.

gcc3 and gcc4 have a builtin preprocessor that is used by default
that can be disabled with -no-integrated-cpp in addition to
the standalone cpp binary.

clang only has an integrated preprocessor and does not have
a standalone preprocessor or the option of using one.

With this change src and xenocara build fine, I'd be interested
to hear how a ports build goes.  I get the impression that FreeBSD
is using tradcpp for all ports that require an external cpp
after looking at port is required by on
http://www.freshports.org/devel/tradcpp .

Index: cpp.sh
===
RCS file: /cvs/src/usr.bin/cpp/cpp.sh,v
retrieving revision 1.9
diff -u -p -r1.9 cpp.sh
--- cpp.sh  9 Dec 2013 02:35:09 -   1.9
+++ cpp.sh  8 Aug 2014 16:52:26 -
@@ -47,7 +47,7 @@ set -A OPTS
 set -A INCS -- -nostdinc
 FOUNDFILES=false
 
-CPP=/usr/libexec/cpp
+CPP=/usr/libexec/tradcpp
 if [ ! -x $CPP ]; then
CPP=`cc -print-search-dirs | sed -ne '/^install: /s/install: 
\(.*\)/\1cpp/p'`;
if [ ! -x $CPP ]; then



Re: switch /usr/bin/cpp to tradcpp

2014-08-09 Thread Joerg Sonnenberger
On Sat, Aug 09, 2014 at 11:37:02PM +1000, Jonathan Gray wrote:
 clang only has an integrated preprocessor and does not have
 a standalone preprocessor or the option of using one.

Huh? clang-cpp will certainly act as standalone preprocessor.

Joerg



Re: switch /usr/bin/cpp to tradcpp

2014-08-09 Thread Jonathan Gray
On Sat, Aug 09, 2014 at 04:17:51PM +0200, Joerg Sonnenberger wrote:
 On Sat, Aug 09, 2014 at 11:37:02PM +1000, Jonathan Gray wrote:
  clang only has an integrated preprocessor and does not have
  a standalone preprocessor or the option of using one.
 
 Huh? clang-cpp will certainly act as standalone preprocessor.

Well clang-cpp is just a different driver for clang which
unless something has changed recently doesn't implement traditional
cpp semantics?  It also doesn't seem to be built usually.

The lack of traditional is what I meant to say above.



Re: switch /usr/bin/cpp to tradcpp

2014-08-09 Thread Joerg Sonnenberger
On Sun, Aug 10, 2014 at 12:29:24AM +1000, Jonathan Gray wrote:
 On Sat, Aug 09, 2014 at 04:17:51PM +0200, Joerg Sonnenberger wrote:
  On Sat, Aug 09, 2014 at 11:37:02PM +1000, Jonathan Gray wrote:
   clang only has an integrated preprocessor and does not have
   a standalone preprocessor or the option of using one.
  
  Huh? clang-cpp will certainly act as standalone preprocessor.
 
 Well clang-cpp is just a different driver for clang which
 unless something has changed recently doesn't implement traditional
 cpp semantics?  It also doesn't seem to be built usually.
 
 The lack of traditional is what I meant to say above.

There is no separate binary, just a possible symlink. Traditional CPP
support is very, very limited, essentially to what is needed for
processing asm. That is quite a different question from a standalone cpp
mode.

Joerg



Move sending of router solicitation packages to the kernel

2014-08-09 Thread Florian Obser
This moves sending of router solicitation packages to the kernel. With
it rtsol{,d}(8) is no longer needed.
Add
inet6 autoconf
to /etc/hostname.IF
or run ifconfig IF inet6 autoconf and the kernel will start sending
rtsol packages.
An the following events a timer will be (re) started with a timeout of
1 second if the autoconf flag is set on the interface. It will
exponentially back off and until a router advertisement is received and
then settle on a 60 second timeout:
* ifconfig IF inet6 autoconf is called
* link is comming up
* the interface is set to up

Much help from mpi@ who patiently reviewed various diffs and explained
the intricacies of the network stack.

Now, mpi@ raised a very valid question: Does this code [handling of
router advertisements and sending of solicitations] belong in the
kernel?

I have no good answer for that. I guess not. However historically the
handling of router advertisements is part of the kernel. This is not so
much more code. And it's very convenient. No need to run another
daemon, the kernel knows very well when a router solicitation should
be send etc. And we can get rid of rtsol{,d}(8).

So in my opinion it's worth to move it to the kernel.

Once the magical network-management-daemon materializes we can rip
the router advertisement and solicitation handling out of the kernel
if we want to.

(Btw. Once the torches are lit and the pitchforks raised, how far do
we go? If parsing of router advertisements can go to userland, is
duplicate address detection (DAD) fair game?)

I've been running with this (or variations of the diff) since g2k14.

OK?

diff --git net/if.c net/if.c
index c325265..2081cf6 100644
--- net/if.c
+++ net/if.c
@@ -1344,6 +1344,26 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, 
struct proc *p)
splx(s);
}
}
+
+   if (ifr-ifr_flags  IFXF_AUTOCONF6)
+   nd6_rs_output_set_timo(ND6_RS_OUTPUT_QUICK_INTERVAL);
+
+   if ((ifr-ifr_flags  IFXF_AUTOCONF6) 
+   !(ifp-if_xflags  IFXF_AUTOCONF6)) {
+   nd6_rs_timeout_count++;
+   RS_LHCOOKIE(ifp) = hook_establish(
+   ifp-if_linkstatehooks, 1, nd6_rs_dev_state, ifp);
+   if (!timeout_pending(nd6_rs_output_timer))
+   nd6_rs_output_set_timo(nd6_rs_output_timeout);
+   }
+   if ((ifp-if_xflags  IFXF_AUTOCONF6) 
+   !(ifr-ifr_flags  IFXF_AUTOCONF6)) {
+   hook_disestablish(ifp-if_linkstatehooks,
+   RS_LHCOOKIE(ifp));
+   nd6_rs_timeout_count--;
+   if (nd6_rs_timeout_count == 0)
+   timeout_del(nd6_rs_output_timer);
+   }
 #endif
 
 #ifdef MPLS
diff --git netinet6/in6.c netinet6/in6.c
index e967089..2bf27f4 100644
--- netinet6/in6.c
+++ netinet6/in6.c
@@ -2087,6 +2087,9 @@ in6_if_up(struct ifnet *ifp)
if (ia6-ia6_flags  IN6_IFF_TENTATIVE)
nd6_dad_start(ifa, dad_delay);
}
+
+   if (ifp-if_xflags  IFXF_AUTOCONF6)
+   nd6_rs_output_set_timo(ND6_RS_OUTPUT_QUICK_INTERVAL);
 }
 
 int
diff --git netinet6/in6_ifattach.c netinet6/in6_ifattach.c
index 93620c4..6703c1e 100644
--- netinet6/in6_ifattach.c
+++ netinet6/in6_ifattach.c
@@ -689,4 +689,13 @@ in6_ifdetach(struct ifnet *ifp)
ifp-if_rdomain);
rtfree(rt);
}
+
+   if (ifp-if_xflags  IFXF_AUTOCONF6) {
+   nd6_rs_timeout_count--;
+   if (nd6_rs_timeout_count == 0)
+   timeout_del(nd6_rs_output_timer);
+   if (RS_LHCOOKIE(ifp) != NULL)
+   hook_disestablish(ifp-if_linkstatehooks,
+   RS_LHCOOKIE(ifp));
+   }
 }
diff --git netinet6/in6_var.h netinet6/in6_var.h
index ed1786b..11a42b7 100644
--- netinet6/in6_var.h
+++ netinet6/in6_var.h
@@ -92,6 +92,7 @@ struct in6_ifextra {
struct in6_ifstat *in6_ifstat;
struct icmp6_ifstat *icmp6_ifstat;
struct nd_ifinfo *nd_ifinfo;
+   void *rs_lhcookie;
int nprefixes;
int ndefrouters;
 };
diff --git netinet6/nd6.c netinet6/nd6.c
index 044a6ea..a653ca6 100644
--- netinet6/nd6.c
+++ netinet6/nd6.c
@@ -103,6 +103,11 @@ struct timeout nd6_timer_ch;
 struct task nd6_timer_task;
 void nd6_timer_work(void *, void *);
 
+struct timeout nd6_rs_output_timer;
+int nd6_rs_output_timeout = ND6_RS_OUTPUT_INTERVAL;
+int nd6_rs_timeout_count = 0;
+void nd6_rs_output_timo(void *);
+
 int fill_drlist(void *, size_t *, size_t);
 int fill_prlist(void *, size_t *, size_t);
 
@@ -137,6 +142,8 @@ nd6_init(void)
/* start timer */
timeout_set(nd6_slowtimo_ch, nd6_slowtimo, NULL);
timeout_add_sec(nd6_slowtimo_ch, ND6_SLOWTIMER_INTERVAL);
+
+   timeout_set(nd6_rs_output_timer, 

Re: don't ask the aperture question on virtual vga

2014-08-09 Thread Jonathan Gray
On Sat, Aug 09, 2014 at 02:51:28PM -0500, joshua stein wrote:
 On Sat, 09 Aug 2014 at 02:10:51 +1000, Jonathan Gray wrote:
  This extends the list of devices the installer will skip
  asking the vga aperture question on to cover virtual machines.
  
  If Xorg is going to be run machdep.allowaperture will have to
  be manually set in sysctl.conf.  I suspect most people aren't
  running X in VMs though, thoughts?
 
 I do under VMWare Fusion, but I won't object to this change.

I've had a few people say they do now, I think I'll drop this.



Re: enable forwarding to remote named sockets in ssh

2014-08-09 Thread Todd C. Miller
On Fri, 08 Aug 2014 16:38:11 -0400, Jared Yanovich wrote:

 I cannot forward to a socket on the remote host (No forward host name.).

Looks correct, but we should also add to the regress tests.

 - todd



Re: [patch] ldattach ignores -t for msts line discipline

2014-08-09 Thread Philip Guenther
On Thu, Aug 7, 2014 at 1:07 PM, Maurice Janssen maur...@z74.net wrote:

 The -t option for ldattach doesn't seem to work when using an msts
 time receiver.  The patch below fixes this.  I guess this part was
 forgotten when msts support was added in r1.4.


Committed.

Philip Guenther


Re: insque/remque bugs

2014-08-09 Thread Philip Guenther
On Wed, Jul 23, 2014 at 5:43 PM, enh e...@google.com wrote:

 If the queue is to be used as a linear list, invoking insque(element,
 NULL), where element is the initial element of the queue, shall
 initialize the forward and backward pointers of element to null
 pointers.


Hmm.  Do the vax ASM versions of these functions need changes to support
this (i.e., did XOPEN manage to screw these up so that they aren't the same
as the vax operations they were based on)?  We'll need to answer that
before we can make this change.  Miod?

Also, when you found these didn't compile (you forgot to pull in a header
to define NULL), _do_ please follow up to your original email...  ;-)


Philip Guenther