Re: CVS commit: src/sys

2021-02-16 Thread Roy Marples

Hi Christos

On 14/02/2021 20:58, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Sun Feb 14 20:58:35 UTC 2021

Modified Files:
src/sys/net: if_arp.h if_bridge.c
src/sys/netinet: icmp_private.h if_arp.c igmp_var.h in_l2tp.c ip_flow.c
ip_input.c ip_private.h tcp_input.c tcp_private.h udp_private.h
udp_usrreq.c
src/sys/netinet6: icmp6.c in6_l2tp.c ip6_flow.c ip6_input.c
ip6_private.h udp6_usrreq.c
src/sys/sys: mbuf.h param.h

Log Message:
- centralize header align and pullup into a single inline function
- use a single macro to align pointers and expose the alignment, instead
   of hard-coding 3 in 1/2 the macros.
- fix an issue in the ipv6 lt2p where it was aligning for ipv4 and pulling
   for ipv6.


-#ifdef __NO_STRICT_ALIGNMENT
-#defineIP_HDR_ALIGNED_P(ip)1
-#else
-#defineIP_HDR_ALIGNED_P(ip)vaddr_t) (ip)) & 3) == 0)
-#endif
+#defineIP_HDR_ALIGNMENT3
 #endif /* _KERNEL */

While this is a like for like change, I feel that the meaning of 
IP_HDR_ALIGNMENT is no longer clear as 3 without context makes no sense at all.

We know it should be aligned to 4 bytes.

I suggest we change POINTER_ALIGNED_P to accept the alignment value we want 
rather than the bitwise test we supply, like so:


#define POINTER_ALIGNED_P(p, a) (((uintptr_t)(p) & ((a) - 1)) == 0)

Roy


Re: CVS commit: src/sys/netinet

2021-02-16 Thread Roy Marples

On 16/02/2021 09:20, Martin Husemann wrote:

On Tue, Feb 16, 2021 at 08:26:40AM +, Roy Marples wrote:

Is that because ARP_HDR_ALIGNMENT is forcing 4 byte alignment?


The KASSERT a few lines below triggerd, we need to be consistent.


For the purposes of using just the header we define I'm pretty sure we can
use 2 byte alignment and set ARP_HDR_ALIGNMENT to 1.


I can test (I have an alignment critical machine with non-ETHER_ALIGN'ing
network driver). Send me a patch, I lost track in the ongoing overhaul.


ARP_HDR_ALIGNED_P can now be removed from if_arp.c as well.


Not sure I understand what you mean here.



Index: net/if_arp.h
===
RCS file: /cvsroot/src/sys/net/if_arp.h,v
retrieving revision 1.40
diff -u -p -r1.40 if_arp.h
--- net/if_arp.h14 Feb 2021 20:58:34 -  1.40
+++ net/if_arp.h16 Feb 2021 09:26:23 -
@@ -72,7 +72,7 @@ structarphdr {
uint8_t  ar_tpa[];  /* target protocol address */
 #endif
 };
-#defineARP_HDR_ALIGNMENT   3
+#defineARP_HDR_ALIGNMENT   1

 static __inline uint8_t *
 ar_data(struct arphdr *ap)
Index: netinet/if_arp.c
===
RCS file: /cvsroot/src/sys/netinet/if_arp.c,v
retrieving revision 1.305
diff -u -p -r1.305 if_arp.c
--- netinet/if_arp.c16 Feb 2021 05:44:13 -  1.305
+++ netinet/if_arp.c16 Feb 2021 09:26:23 -
@@ -133,12 +133,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1
  */
 #define ETHERTYPE_IPTRAILERS ETHERTYPE_TRAIL

-#ifdef __NO_STRICT_ALIGNMENT
-#defineARP_HDR_ALIGNED_P(ar)   1
-#else
-#defineARP_HDR_ALIGNED_P(ar)   vaddr_t) (ar)) & 1) == 0)
-#endif
-
 /* timers */
 static int arp_reachable = REACHABLE_TIME;
 static int arp_retrans = RETRANS_TIMER;


In my testing on aarch64 and octeon (both of which I think are strict alignment) 
neither need pullups nor copyups as the mbuf already has enough and arphrd is 
aligned correctly already.


Roy


Re: CVS commit: src/sys/netinet

2021-02-16 Thread Roy Marples

On 16/02/2021 05:44, Martin Husemann wrote:

Module Name:src
Committed By:   martin
Date:   Tue Feb 16 05:44:14 UTC 2021

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
Undo previous backout: alignment is needed here.
The reason for the previous backout was a misunderstanding (POINTER_ALIGNED_P
was broken, but the assertion fired even after it got fixed).


Is that because ARP_HDR_ALIGNMENT is forcing 4 byte alignment?
For the purposes of using just the header we define I'm pretty sure we can use 2 
byte alignment and set ARP_HDR_ALIGNMENT to 1.


ARP_HDR_ALIGNED_P can now be removed from if_arp.c as well.

Roy


Re: CVS commit: src/sys

2021-02-14 Thread Roy Marples

On 13/02/2021 21:34, David Young wrote:

On Tue, Feb 09, 2021 at 07:02:32AM +, Roy Marples wrote:

Hi David

On 03/02/2021 21:45, David Young wrote:


This change looks a little hasty to me.

It looks to me like some of these structs were __packed so that
they could be read/written directly from/to any offset in a packet
chain using mtod(), which does not pay any mind to the alignment
of `*t`:

#define mtod(m, t)  ((t)((m)->m_data))

I see gre_h is accessed in that way, just for one example.


Looking at the other places where this is handled, does this patch to gre_h
address your concerns?
I tested this on aarch64 which does not define __NO_STRICT_ALIGNMENT and it
passes the KASSERT.


It is possible to simplify your patch a lot.  The GRE header is only 4
bytes long.  On the receive side, just perform the m_pullup like the
old code did and then memcpy to a `struct gre_h` on the stack.  On the
send side, construct the header on the stack and then memcpy it into the
mbuf.

The same general approach, of copying headers between mbufs the stack,
is probably plenty fast for virtually any size of header used in the
network stack.


Done


Re: CVS commit: src/sys/net

2021-02-14 Thread Roy Marples

On 13/02/2021 14:19, Jonathan A. Kollasch wrote:

On Sat, Feb 13, 2021 at 07:28:05AM +, Roy Marples wrote:

Module Name:src
Committed By:   roy
Date:   Sat Feb 13 07:28:05 UTC 2021

Modified Files:
src/sys/net: if_ether.h if_ethersubr.c

Log Message:
if_ether: Ensure that ether_header is aligned


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/net/if_ether.h
cvs rdiff -u -r1.289 -r1.290 src/sys/net/if_ethersubr.c


This appears to ensure the Ethernet header is naturally aligned on a
32-bit boundary.  The 16-bit ether_type field is the only thing in
ether_header that is wider than a uint8_t.

Many drivers will place the start of the receive buffer at an
ETHER_ALIGN (which is 2) offset to ensure the layer three header
is 32-bit aligned after the 14-byte Ethernet header.  Thus this
will result in always calling m_copyup() in ether_input() on strict
alignment platforms.


Reverted


Re: CVS commit: src/sys

2021-02-08 Thread Roy Marples

Hi David

On 03/02/2021 21:45, David Young wrote:
>
> This change looks a little hasty to me.
>
> It looks to me like some of these structs were __packed so that
> they could be read/written directly from/to any offset in a packet
> chain using mtod(), which does not pay any mind to the alignment
> of `*t`:
>
> #define mtod(m, t)  ((t)((m)->m_data))
>
> I see gre_h is accessed in that way, just for one example.

Looking at the other places where this is handled, does this patch to gre_h 
address your concerns?
I tested this on aarch64 which does not define __NO_STRICT_ALIGNMENT and it 
passes the KASSERT.


Roy

diff -r e3c82b1d9c2e sys/net/if_gre.c
--- a/sys/net/if_gre.c  Mon Feb 08 01:00:49 2021 +
+++ b/sys/net/if_gre.c  Tue Feb 09 06:55:44 2021 +
@@ -395,10 +395,26 @@
sc->sc_error_ev.ev_count++;
return;
}
-   if (m->m_len < sizeof(*gh) && (m = m_pullup(m, sizeof(*gh))) == NULL) {
-   GRE_DPRINTF(sc, "m_pullup failed\n");
-   sc->sc_pullup_ev.ev_count++;
-   return;
+
+   /* If the GRE header is not aligned, slurp it up into a new
+* mbuf with space for link headers, in the event we forward
+* it.  Otherwise, if it is aligned, make sure the entire
+* base GRE header is in the first mbuf of the chain.
+*/
+   if (GRE_HDR_ALIGNED_P(mtod(m, void *)) == 0) {
+   if ((m = m_copyup(m, sizeof(struct gre_h),
+   (max_linkhdr + 3) & ~3)) == NULL) {
+   /* XXXJRT new stat, please */
+   GRE_DPRINTF(sc, "m_copyup failed\n");
+   sc->sc_pullup_ev.ev_count++;
+   return;
+   }
+   } else if (__predict_false(m->m_len < sizeof(struct gre_h))) {
+   if ((m = m_pullup(m, sizeof(struct gre_h))) == NULL) {
+   GRE_DPRINTF(sc, "m_pullup failed\n");
+   sc->sc_pullup_ev.ev_count++;
+   return;
+   }
}
gh = mtod(m, const struct gre_h *);

@@ -940,7 +956,6 @@
 #endif

M_PREPEND(m, sizeof(*gh), M_DONTWAIT);
-
if (m == NULL) {
IF_DROP(>if_snd);
error = ENOBUFS;
@@ -948,6 +963,7 @@
}

gh = mtod(m, struct gre_h *);
+   KASSERT(GRE_HDR_ALIGNED_P(gh));
gh->flags = 0;
gh->ptype = etype;
/* XXX Need to handle IP ToS.  Look at how I handle IP TTL. */
diff -r e3c82b1d9c2e sys/net/if_gre.h
--- a/sys/net/if_gre.h  Mon Feb 08 01:00:49 2021 +
+++ b/sys/net/if_gre.h  Tue Feb 09 06:55:44 2021 +
@@ -131,6 +131,11 @@
Present if (rt_pres == 1)
  */
 };
+#ifdef __NO_STRICT_ALIGNMENT
+#defineGRE_HDR_ALIGNED_P(gh)   1
+#else
+#defineGRE_HDR_ALIGNED_P(gh)   vaddr_t) (gh)) & 3) == 0)
+#endif
 #ifdef __CTASSERT
 __CTASSERT(sizeof(struct gre_h) == 4);
 #endif


Re: CVS commit: src/sys

2021-02-07 Thread Roy Marples

On 04/02/2021 20:18, matthew green wrote:

Roy Marples writes:

On 03/02/2021 21:45, David Young wrote:

On Wed, Feb 03, 2021 at 05:51:40AM +, Roy Marples wrote:

Module Name:src
Committed By:   roy
Date:   Wed Feb  3 05:51:40 UTC 2021

Modified Files:
src/sys/net: if_arp.h if_ether.h if_gre.h
src/sys/netinet: if_ether.h igmp.h in.h ip.h ip6.h ip_carp.h ip_icmp.h
ip_mroute.h ip_var.h tcp.h tcp_debug.h tcp_var.h udp.h udp_var.h

Log Message:
Remove __packed from various network structures

They are already network aligned and adding the __packed attribute
just causes needless compiler warnings about accssing members of packed
objects.


This change looks a little hasty to me.

It looks to me like some of these structs were __packed so that
they could be read/written directly from/to any offset in a packet
chain using mtod(), which does not pay any mind to the alignment
of `*t`:

#define mtod(m, t)  ((t)((m)->m_data))

I see gre_h is accessed in that way, just for one example.  I don't
see any reason in principle that every gre_h accessed through mtod()
should be 16-bit aligned in its buffer, but that is the alignment
the compiler will expect if gre_h is not __packed.  If the actual
alignment ever differs from compiler's expectation, then there
could be a bus error or an unwanted byte rotation/shift.

It looks to me like there's a bit of cleanup to do elsewhere before
removing __packed from network structures.


ssh over a gre tunnel using erlite (mips64) and pinebook (aarch64) as both ends
seems to work fine. I also tested an amd64 endpoint.

Not that I disagree with your assessment that the code can always be improved.


i looked at removing __packed from these when GCC 9 came
around and really started complaining about them.  however,
i was not able to convince myself that all the users were
actually safe if __packed was removed.

in particular, 'struct ip' has 4-byte objects at offset
14, 18, 22, and 26.  code accessing data directly from the
network may fail, and eg, mtod() makes it virtually
impossible to check for this at compile time.  sanitizers
could check at run time.


Isn't that already solved here?
http://anonhg.netbsd.org/src/rev/9f66cecd950e

And if I'm not wrong, just ignoring the warning causes alignment failures as it 
stands? So it's just swapping one bad thing with another? If so, then there is 
no right answer other than doing similar alignment checks for our mbufs.


Roy


Re: CVS commit: src/sys

2021-02-04 Thread Roy Marples

On 03/02/2021 21:45, David Young wrote:

On Wed, Feb 03, 2021 at 05:51:40AM +, Roy Marples wrote:

Module Name:src
Committed By:   roy
Date:   Wed Feb  3 05:51:40 UTC 2021

Modified Files:
src/sys/net: if_arp.h if_ether.h if_gre.h
src/sys/netinet: if_ether.h igmp.h in.h ip.h ip6.h ip_carp.h ip_icmp.h
ip_mroute.h ip_var.h tcp.h tcp_debug.h tcp_var.h udp.h udp_var.h

Log Message:
Remove __packed from various network structures

They are already network aligned and adding the __packed attribute
just causes needless compiler warnings about accssing members of packed
objects.


This change looks a little hasty to me.

It looks to me like some of these structs were __packed so that
they could be read/written directly from/to any offset in a packet
chain using mtod(), which does not pay any mind to the alignment
of `*t`:

#define mtod(m, t)  ((t)((m)->m_data))

I see gre_h is accessed in that way, just for one example.  I don't
see any reason in principle that every gre_h accessed through mtod()
should be 16-bit aligned in its buffer, but that is the alignment
the compiler will expect if gre_h is not __packed.  If the actual
alignment ever differs from compiler's expectation, then there
could be a bus error or an unwanted byte rotation/shift.

It looks to me like there's a bit of cleanup to do elsewhere before
removing __packed from network structures.


ssh over a gre tunnel using erlite (mips64) and pinebook (aarch64) as both ends 
seems to work fine. I also tested an amd64 endpoint.


Not that I disagree with your assessment that the code can always be improved.

Roy


Re: CVS commit: src/sys

2021-02-03 Thread Roy Marples

On 03/02/2021 12:54, Kamil Rytarowski wrote:

This is still a valid usage and ABI breakage for userland. You cannot
blame a user for using system structures and headers that stop working
after an upgrade, at least before at least libc version bump.

For the record, I broke ABI here (it was the reverse situation, addition
of __packed).

https://github.com/NetBSD/src/commit/a833bd5cfdba983ecb5560512a3547f46f35f11e

I vote to revert and handling these structures with appropriate
functions that are aware of potentially misaligned data operations.

If we you or the project resist and insists on ABI breakage, it should
be boldly documented.


I don't buy this argument as we frequently do this:

r1.1
struct aaa {
uint16 a;
};


r1.2
struct oaaa {
uint16 a;
};

struct aaa {
uint16 a;
uint8 b;
};

Now if you choose to put your own stuff before and after in another struct, 
frankly you are really on your own.


Here's another example:

struct ehteripudp {
struct etherhdr;
struct iphdr;
struct udphdr;
};

This still works!
However, it's potentially broken as you are making the assumption there are no 
options after the ip header.


Infact this is how all the network headers have been designed.
From the start of the structure you can chain header structures together until 
you either reach options or data.


But you *have* to interogate the headers in order to work this out.

Roy


Re: CVS commit: src/sys

2021-02-03 Thread Roy Marples

On 03/02/2021 10:03, Kamil Rytarowski wrote:

On 03.02.2021 06:51, Roy Marples wrote:

Module Name:src
Committed By:   roy
Date:   Wed Feb  3 05:51:40 UTC 2021

Modified Files:
src/sys/net: if_arp.h if_ether.h if_gre.h
src/sys/netinet: if_ether.h igmp.h in.h ip.h ip6.h ip_carp.h ip_icmp.h
ip_mroute.h ip_var.h tcp.h tcp_debug.h tcp_var.h udp.h udp_var.h

Log Message:
Remove __packed from various network structures

They are already network aligned and adding the __packed attribute
just causes needless compiler warnings about accssing members of packed
objects.



This changes the ABI for userland programs. With __packed, these
structures, whenever contain at least 2-byte data, can be placed in a
different location inside another structure now.

#include 
#include 
#include 
#include 

struct aaa {
 uint16_t a;
 uint8_t b;
 uint8_t c;
} __packed;

struct aaa2 {
 uint8_t x;
 struct aaa y;
};

struct bbb {
 uint16_t a;
 uint8_t b;
 uint8_t c;
};

struct bbb2 {
 uint8_t x;
 struct bbb y;
};


Assuming that struct aaa and bbb are from NetBSD headers and aaa2 and bbb2 are 
your own constructs then you just have yourself to blame.


struct bbb2 {
  uint8_t x;
  struct bbb y;
} __packed;

Makes bbb2 the same as aaa2.


Before I saw your commit, I wanted to ask to revert the following changes:

icmp6: Remove __packed attribute from icmp6 structures

https://github.com/NetBSD/src/commit/427831ba4bdf388aecf3a378de8faf3a4d44a462

ip6: Remove __packed attribute from ip6 structures

https://github.com/NetBSD/src/commit/e82879afd70b0e801e6ee53bd14c27be3dd1738f

The fallout can be subtle and hard to debug. Once, I removed __packed
from one innocent networking structure myself, qemu networking stopped
working at all.


How you use the structure is up to you.
For the record, we were the only BSD to ever apply __packed to these structures 
and thanks to modern compilers emitting these wonderful warnings it proved to be 
a bad move.


Roy


Re: CVS commit: src/sys

2021-02-03 Thread Roy Marples

On 03/02/2021 08:34, Joerg Sonnenberger wrote:

On Wed, Feb 03, 2021 at 05:51:40AM +, Roy Marples wrote:

Module Name:src
Committed By:   roy
Date:   Wed Feb  3 05:51:40 UTC 2021

Modified Files:
src/sys/net: if_arp.h if_ether.h if_gre.h
src/sys/netinet: if_ether.h igmp.h in.h ip.h ip6.h ip_carp.h ip_icmp.h
ip_mroute.h ip_var.h tcp.h tcp_debug.h tcp_var.h udp.h udp_var.h

Log Message:
Remove __packed from various network structures

They are already network aligned and adding the __packed attribute
just causes needless compiler warnings about accssing members of packed
objects.


Please add a compile-time assert at least for _KERNEL that the size
matches the expectation in that case.


Done


Re: CVS commit: src/sys/compat/netbsd32

2021-01-17 Thread Roy Marples

Hi Simon

On 17/01/2021 11:26, Simon Burge wrote:

On 15/01/2021 07:15, matthew green wrote:

Oh, I quite agree. However, in6_nbrinfo predates my involvement with NetBSD
and is the same struct on all BSD. While bringing the same functionality to
IPv4, I elected to keep the same struct just to have the same API, warts
and all. I like consistency.


Does anyone else have an in_nbrinfo?  I _think_ the "asked" member only
seems to get assigned a 0 for ipv4, and with a long being 32-bits on any
32 bit platform making it a long instead of an int doesn't buy anything.


No, it's currently unique to NetBSD.
Other BSD's just don't have the infrastructure in their network for it either.
I'll note that on a 64-bit platform it's 64 bits though so these do gains 
something.

The value is similar to struct if_data counters really, so maybe it should be a 
uint64_t if you really want to change it.
I would then argue that it might be better then to version it proper and move it 
out of compat32.




I'm still keen to make this change (asked as an int instead of a long in
in_nbrinfo) and announce a mini flag day for arp for -current users so
that it's one less compat32 ioctl we have to maintain.


I would just like arp to work without error.
My personal preference would be to keep the same API and add compat.


I've committed compat32 support for SIOCGNBRINFO_IN6 and in6_nbrinfo.


Looks great!
Also looks the same as what I did but couldn't get to work.
Maybe I missed the netbsd32 on the long.

Roy


Re: CVS commit: src/sys/compat/netbsd32

2021-01-15 Thread Roy Marples

On 15/01/2021 02:43, Simon Burge wrote:

I'll test a bit more

I can't actually test as my ERLite won't boot anymore.
Console light is green, cu says I'm connected but I get nothing out of it.
With cat5 cables plugged in the ports they flash green and then stick on amber.

I'm guessing this is non recoverable :(
If it is recoverable somehow I can put NetBSD back on it as I have a shiny new 
USG in it's place.


Roy


Re: CVS commit: src/sys/compat/netbsd32

2021-01-14 Thread Roy Marples

On 15/01/2021 07:15, matthew green wrote:

Oh, I quite agree. However, in6_nbrinfo predates my involvement with NetBSD
and is the same struct on all BSD. While bringing the same functionality to
IPv4, I elected to keep the same struct just to have the same API, warts
and all. I like consistency.

[ .. ]


That breaks API/ABI though yes? As such it would require stuff in compat
anyway, but leaving it as it just needs n32 compat gunk instead which is
less impactful on other systems.


in6_nbrinfo/in_nbrinfo are not in any published netbsd release so we can
choose to break them in -current.  there's a slight problem that -current has
a minor flag day here, but it's not the compat issue you seem to think.


CVS disagrees - in6_nbrinfo is from NetBSD-1, only in_nbrinfo is recent:
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/netinet6/nd6.h?rev=1.14.4.2=text/x-cvsweb-markup_with_tag=netbsd-1-5

Roy


Re: CVS commit: src/sys/compat/netbsd32

2021-01-14 Thread Roy Marples

On 15/01/2021 02:43, Simon Burge wrote:

Hi Roy,

Roy Marples wrote:


On 14/01/2021 11:03, Simon Burge wrote:

Sure, I will have a look.  Anything IPv6 related I might need a helping
hand to get a test case though :).


As they share a similar structure, you solve one you likely solve the other.
I can assume you have working IPv4 ;)


In general where we can define the structure that are passed in an
interface, regardless if it's a ioctl or sysctl or whatever, we should
try to design the structure so that it's the same regardless of if it's
built with 32-bit or 64-bit userlands.


Oh, I quite agree.
However, in6_nbrinfo predates my involvement with NetBSD and is the same struct 
on all BSD. While bringing the same functionality to IPv4, I elected to keep the 
same struct just to have the same API, warts and all. I like consistency.




The issue with in_nbrinfo and in6_nbrinfo is that there's a "long" in
the structure, so this has different sizes depending on your native long
size.

I _think_ this is the is value out of the la_asked member of struct
llentry which is a uint16_t so we can just make it an int the your
structures will align nicely.  In both cases the ifname name is 16
bytes.  For in_nbrinfo in_addr is effectively an int so we have just
four ints after the ifname.  For in6_nbrinfo the in6_addr is 128 bytes
so aligns nicely, then a couple more ints after that.

If "asked" is from struct llentry then the attached patch should work
without requiring any compat32 support.  If you're happy with this, I'll
test a bit more then commit.


That breaks API/ABI though yes?
As such it would require stuff in compat anyway, but leaving it as it just needs 
n32 compat gunk instead which is less impactful on other systems.


Roy


Re: CVS commit: src/sys/compat/netbsd32

2021-01-14 Thread Roy Marples

On 14/01/2021 11:03, Simon Burge wrote:

Sure, I will have a look.  Anything IPv6 related I might need a helping
hand to get a test case though :).


As they share a similar structure, you solve one you likely solve the other.
I can assume you have working IPv4 ;)

Roy


Re: CVS commit: src/sys/compat/netbsd32

2021-01-14 Thread Roy Marples

On 14/01/2021 08:00, Simon Burge wrote:

Module Name:src
Committed By:   simonb
Date:   Thu Jan 14 08:00:45 UTC 2021

Modified Files:
src/sys/compat/netbsd32: netbsd32.h netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
Handle FSSIOCSET and FSSIOCGET; vndconfig(8) works with compat32 now.
XXX: FSSIOCSET50 and FSSIOCGET50 are not (yet) handled.


Could I prompt you into looking at SIOCGNBRINFO (arp -a) and SIOCGNBRINFO_IN6 
(ndp -a) please?


I could never get that working.

Thanks

Roy


Re: CVS commit: src/external/bsd/ntp/dist/ntpd

2021-01-03 Thread Roy Marples

On 02/01/2021 23:33, Frank Kardel wrote:
Also the behavior now fully relies in the routing message functionality which 
can be disabled


on serious procession errors - at that point the code robustness relies on the 
periodic


re-scanning - so I am not sure whether the periodic re-scanning should be 
completely


disabled.


Could you expand on this please? It sounds like you want it to be user disabled 
but not for routing messages? I don't understand.


Roy


Re: CVS commit: src/external/bsd/ntp/dist/ntpd

2021-01-03 Thread Roy Marples

On 02/01/2021 23:33, Frank Kardel wrote:

Hi Roy !

This may look like a better solution from the interface tracking side.

People have requested being able to disable dynamic interface updates 
completely.

This was implemented via the -U 0.


...


This patch seems (by visual inspection) to break that logic.

Also the behavior now fully relies in the routing message functionality which 
can be disabled


on serious procession errors - at that point the code robustness relies on the 
periodic


re-scanning - so I am not sure whether the periodic re-scanning should be 
completely


Valid points.

New patch sets disable_dynamic_updates if the -U 0 is given.
The only other code to touch disable_dynamic_updates is this
disable_dynamic_updates |= (sw_uid != 0);  /* also notifies routing message 
listener *


So this should be good now.

diff -r 9e64cf4881a1 external/bsd/ntp/dist/ntpd/cmd_args.c
--- a/external/bsd/ntp/dist/ntpd/cmd_args.c Sat Jan 02 12:39:33 2021 +
+++ b/external/bsd/ntp/dist/ntpd/cmd_args.c Sun Jan 03 10:56:58 2021 +
@@ -181,9 +181,11 @@
if (HAVE_OPT( UPDATEINTERVAL )) {
long val = OPT_VALUE_UPDATEINTERVAL;

-   if (val >= 0)
+   if (val >= 0) {
interface_interval = val;
-   else {
+   if (interface_interval == 0)
+   disable_dynamic_updates = 1;
+   } else {
fprintf(stderr,
"command line interface update interval %ld 
must not be negative\n",

val);
diff -r 9e64cf4881a1 external/bsd/ntp/dist/ntpd/ntp_io.c
--- a/external/bsd/ntp/dist/ntpd/ntp_io.c   Sat Jan 02 12:39:33 2021 +
+++ b/external/bsd/ntp/dist/ntpd/ntp_io.c   Sun Jan 03 10:56:58 2021 +
@@ -455,8 +455,13 @@
 {
/* Init buffer free list and stat counters */
init_recvbuff(RECV_INIT);
+#ifdef SO_RERROR
+   /* route(4) overflow can be observed */
+   interface_interval = 0;
+#else
/* update interface every 5 minutes as default */
interface_interval = 300;
+#endif

 #ifdef WORK_PIPE
addremove_io_fd = _addremove_io_fd;
diff -r 9e64cf4881a1 external/bsd/ntp/dist/ntpd/ntp_timer.c
--- a/external/bsd/ntp/dist/ntpd/ntp_timer.cSat Jan 02 12:39:33 2021 +
+++ b/external/bsd/ntp/dist/ntpd/ntp_timer.cSun Jan 03 10:56:58 2021 +
@@ -423,9 +423,11 @@
/*
 * Interface update timer
 */
-   if (interface_interval && interface_timer <= current_time) {
-   timer_interfacetimeout(current_time +
-   interface_interval);
+   if (!disable_dynamic_updates &&
+   interface_timer && interface_timer <= current_time) {
+   if (interface_interval)
+   timer_interfacetimeout(current_time +
+   interface_interval);
DPRINTF(2, ("timer: interface update\n"));
interface_update(NULL, NULL);
}



Re: CVS commit: src/external/bsd/ntp/dist/ntpd

2021-01-02 Thread Roy Marples

On 02/01/2021 17:23, Roy Marples wrote:
That's a good point, with this we can now remove that forced sync on a timer 
approach.


Does this look ok?


Better patch:

diff -r 9e64cf4881a1 external/bsd/ntp/dist/ntpd/ntp_io.c
--- a/external/bsd/ntp/dist/ntpd/ntp_io.c   Sat Jan 02 12:39:33 2021 +
+++ b/external/bsd/ntp/dist/ntpd/ntp_io.c   Sat Jan 02 18:39:34 2021 +
@@ -455,8 +455,13 @@
 {
/* Init buffer free list and stat counters */
init_recvbuff(RECV_INIT);
+#ifdef SO_RERROR
+   /* route(4) overflow can be observed */
+   interface_interval = 0;
+#else
/* update interface every 5 minutes as default */
interface_interval = 300;
+#endif

 #ifdef WORK_PIPE
addremove_io_fd = _addremove_io_fd;
diff -r 9e64cf4881a1 external/bsd/ntp/dist/ntpd/ntp_timer.c
--- a/external/bsd/ntp/dist/ntpd/ntp_timer.cSat Jan 02 12:39:33 2021 +
+++ b/external/bsd/ntp/dist/ntpd/ntp_timer.cSat Jan 02 18:39:34 2021 +
@@ -423,9 +423,10 @@
/*
 * Interface update timer
 */
-   if (interface_interval && interface_timer <= current_time) {
-   timer_interfacetimeout(current_time +
-   interface_interval);
+   if (interface_timer && interface_timer <= current_time) {
+   if (interface_interval)
+   timer_interfacetimeout(current_time +
+   interface_interval);
DPRINTF(2, ("timer: interface update\n"));
interface_update(NULL, NULL);
}


Re: CVS commit: src/external/bsd/ntp/dist/ntpd

2021-01-02 Thread Roy Marples

Hi Frank

On 02/01/2021 09:55, Frank Kardel wrote:

I doubt that the explicit draining is helpful here as it already happens


I was aware of that.
I was just trying to avoid excess timer interface timeouts if we don't get 
around to reading the next message in UPDATE_GRACE time.

Let's see what upstream says.

Also the ntp_io system will periodically refresh it interface lists in time as 
it was explicitly designed to be robust against lost messages from the routing 
socket.


That's a good point, with this we can now remove that forced sync on a timer 
approach.


Does this look ok?

diff -r 9e64cf4881a1 external/bsd/ntp/dist/ntpd/ntp_timer.c
--- a/external/bsd/ntp/dist/ntpd/ntp_timer.cSat Jan 02 12:39:33 2021 +
+++ b/external/bsd/ntp/dist/ntpd/ntp_timer.cSat Jan 02 17:19:28 2021 +
@@ -423,9 +423,18 @@
/*
 * Interface update timer
 */
-   if (interface_interval && interface_timer <= current_time) {
-   timer_interfacetimeout(current_time +
-   interface_interval);
+   if (interface_timer && interface_timer <= current_time) {
+#ifdef SO_RERROR
+   /*
+* Because we can catch route(4) overflow, there is no
+* need to update interfaces every interface_interval.
+*/
+   interface_timer = 0;
+#else
+   if (interface_interval)
+   timer_interfacetimeout(current_time +
+   interface_interval);
+#endif
DPRINTF(2, ("timer: interface update\n"));
interface_update(NULL, NULL);
}

We should try to keep the differences to the up-stream code as little as 
possible. Especially when the upstream code already handles the situation 
reasonably the is no need for additional code.


Agreed.
I already submitted the diff upstream, but will adjust it to remove the forced 
refresh.



Happy new year!


And the same to you!

Roy


Re: CVS import: src/external/bsd/dhcpcd/dist

2020-10-15 Thread Roy Marples

Hi Ryo

On 15/10/2020 02:23, Ryo ONODERA wrote:

dhcpcd-9.3.1 do not detect carrier with cdce(4) and urndis(4) devices.
dhcpcd-9.2.0 from pkgsrc-2020Q3 branch works without problems.
(Maybe 9.3.0 in NetBSD base worked for me.)

cdce and urndis have no "status" line in ifconfig command output.
Is this related to my problem?


Does this fix it?

diff --git a/src/if.c b/src/if.c
index 5f4edb86..deb5280b 100644
--- a/src/if.c
+++ b/src/if.c
@@ -198,10 +198,8 @@ if_is_link_up(const struct interface *ifp)
 {

return ifp->flags & IFF_UP &&
-   (ifp->carrier == LINK_UP ||
-(ifp->carrier == LINK_UNKNOWN &&
- !(ifp->options == NULL ||
-   ifp->options->options & DHCPCD_LINK)));
+   (ifp->carrier != LINK_DOWN ||
+(ifp->options != NULL && !(ifp->options->options & DHCPCD_LINK)));
 }

 int


Re: CVS commit: src

2020-10-14 Thread Roy Marples

On 14/10/2020 20:07, Kimmo Suominen wrote:
> - not interfere with (static) IPv4 configuration

How do you expect
ifconfig_vioif0='dhcp rtsol'
to work?

With recent dhcpcd changes, it is possible to get them working independently of 
each other, but as it stands right now, you just killed ipv4 running in vioif0.



- only update the IPv6 routing table, not the IPv6 address configuration


This is new behaviour, and this is my objection.
We've never had a knob to instruct the kernel not to apply IPv6 addresses from 
the RA.


In my view, rtsol means "Solicit a RA, apply it's configuration."
This includes starting DHCP6 based on the O or M flags inside the RA.
Your meaning of rtsol means "Solicit an RA but discard it's configuration and 
only set a default route to it."


As we have a difference of opinion, I would like to hear the opinions of others.


I also think it is very good that with this change we once again have
backwards compatibility for configuring static network addressing.


We've never lost it.
We've never really had static addressing with an RA router before either.
Looking through the NetBSD-9 sources, if the RA advertises an address you didn't 
have set, it would install one for you.
What it wouldn't do though was adjust the timings of existing addresses, which 
admitedly dhcpcd would which i suspect is the behaviour you're trying to get to.


If you want static, go full static. Anything else is probably undefined 
behaviour. This is certainly true with NetBSD-9 kernels handling RA.



My preference for a static address configuration would be to also use
defaultroute6, but since on some of my networks the routers do not
support VRRP v3, I cannot configure an IPv6 address in VRRP to be used
as the default gateway.


And now we get to the real reason.
I don't see why we should overload a generic "rtsol" command to workaround an 
issue with your network.


Would you object to adding a new command, maybe rtsol_router_only?
This is then very clear as to the behaviour desired.

Roy


Re: CVS commit: src

2020-10-12 Thread Roy Marples

Hi Kimmo

On 11/10/2020 23:38, Kimmo Suominen wrote:

Module Name:src
Committed By:   kim
Date:   Sun Oct 11 22:38:48 UTC 2020

Modified Files:
src/etc/rc.d: network
src/share/man/man5: ifconfig.if.5

Log Message:
Make "rtsol" functional again.


rtsol)
if ! checkyesno dhcpcd; then
-   /sbin/dhcpcd -n --ipv6rs \
+   /sbin/dhcpcd -n -f /dev/null \
+   --background --persistent \
+   --noipv4 --nodhcp6 \
+   --ipv6ra_noautoconf \
${dhcpcd_flags} $int
fi
;;

Can you explain how it was not functional before and how this fixes it?

Roy


Re: CVS commit: src/etc/mtree

2020-09-30 Thread Roy Marples

On 30/09/2020 08:55, matthew green wrote:

Module Name:src
Committed By:   mrg
Date:   Wed Sep 30 07:55:31 UTC 2020

Modified Files:
src/etc/mtree: NetBSD.dist.tests

Log Message:
add missing new if_vether subdir.


Thanks!


Re: CVS commit: src/sys/crypto/aes

2020-07-28 Thread Roy Marples

On 27/07/2020 21:44, Taylor R Campbell wrote:

Module Name:src
Committed By:   riastradh
Date:   Mon Jul 27 20:44:30 UTC 2020

Modified Files:
src/sys/crypto/aes: aes_ccm.c aes_ccm.h

Log Message:
Gather auth[16] and ctr[16] into one authctr[32].

Should appease clang.


clang is still not appeased :/

--- aes_via.o ---
/home/roy/src/hg/src/sys/crypto/aes/arch/x86/aes_via.c:807:6: error: variable 
'authctr' is used uninitialized whenever 'if' condition is false 
[-Werror,-Wsometimes-uninitialized]

if ((uintptr_t)authctr0 & 0xf) {
^
/home/roy/src/hg/src/sys/crypto/aes/arch/x86/aes_via.c:820:10: note: 
uninitialized use occurs here

be32enc(authctr + 16 + 4*3, ++c3);
^~~
/home/roy/src/hg/src/sys/crypto/aes/arch/x86/aes_via.c:807:2: note: remove the 
'if' if its condition is always true

if ((uintptr_t)authctr0 & 0xf) {
^~~
/home/roy/src/hg/src/sys/crypto/aes/arch/x86/aes_via.c:796:18: note: initialize 
the variable 'authctr' to silence this warning

uint8_t *authctr;
^
 = NULL
1 error generated.
*** [aes_via.o] Error code 1


Re: CVS commit: src/external/bsd/dhcpcd/dist/src

2020-05-14 Thread Roy Marples

On 10/05/2020 18:58, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Sun May 10 17:58:16 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcpcd.c

Log Message:
Add SIGPIPE to the list of dhcpcd affected signals since we sigignore it.


Why?

BTW, this breaks non kqueue OS's so can't be accepted upstream.

Roy


Re: CVS commit: [phil-wifi] src/sys/net

2020-04-27 Thread Roy Marples

On 27/04/2020 08:27, Nathanial Sloss wrote:

Module Name:src
Committed By:   nat
Date:   Mon Apr 27 07:27:35 UTC 2020

Modified Files:
src/sys/net [phil-wifi]: pfil.c

Log Message:
Skip pfil_run_hooks if no packet filter enabled in the kernel.


I thought martin@ moved development of this branch over to hg?
https://wiki.netbsd.org/Wifi_renewal_on_hg/

Roy


Re: CVS commit: src/sys/netinet6

2020-04-22 Thread Roy Marples

On 22/04/2020 20:32, Roy Marples wrote:

Module Name:src
Committed By:   roy
Date:   Wed Apr 22 19:32:11 UTC 2020

Modified Files:
src/sys/netinet6: nd6_nbr.c

Log Message:
inet6: nd6_na_input() now considers ln_state <= ND6_LLINFO_INCOMPLETE

Otherwise if ln_state != ND6_LLINFO_INCOMPLETE and the is no lladdr
and this message was solicited then ln_state is set to ND6_LLINFO_REACHABLE
which could then cause a panic in nd6_resolve().
If ln_state > ND6_LLINFO_INCOMPLETE then it's assumed we have a lladdr.

Potentially this could have been triggered by the introduction of
ND6_LLINFO_PURGE in nd6.c r1.143 but also by the re-introduction of
ND6_LLINFO_INCOMPLETE in nd6.c r1.263.


I meant ND6_LLINFO_WAITDELETE, not ND6_LLINFO_INCOMPLETE here.


Depending on the timing, it's technically possible to receive such
a message after the llentry is created with ND6_LLINFO_NOSTATE.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/sys/netinet6/nd6_nbr.c

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



Re: CVS commit: src/sys/kern

2020-04-13 Thread Roy Marples

On 13/04/2020 16:31, Andrew Doran wrote:

Hi Roy.

On Sat, Apr 11, 2020 at 02:13:06AM +0100, Roy Marples wrote:

On 10/04/2020 23:34, Andrew Doran wrote:

Module Name:src
Committed By:   ad
Date:   Fri Apr 10 22:34:36 UTC 2020

Modified Files:
src/sys/kern: vfs_mount.c

Log Message:
vfs_mountroot(): don't needlessly grab a second reference to the root vnode
(the kernel never chdirs) nor a lock on it.


So the kernel chrooting to sysctl init.root is still ok?


How is that accomplished?  I couldn't find the code and don't recall seeing
it.


sysctl -w init.root=/altroot

See the ZFS Root ramdisk:
https://nxr.netbsd.org/xref/src/distrib/common/zfsroot.rc#33

I tested kernel from yesterdays sources and it still works fine, so I guess 
nothing was needed here.


Roy


Re: CVS commit: src/sys/kern

2020-04-10 Thread Roy Marples

On 10/04/2020 23:34, Andrew Doran wrote:

Module Name:src
Committed By:   ad
Date:   Fri Apr 10 22:34:36 UTC 2020

Modified Files:
src/sys/kern: vfs_mount.c

Log Message:
vfs_mountroot(): don't needlessly grab a second reference to the root vnode
(the kernel never chdirs) nor a lock on it.


So the kernel chrooting to sysctl init.root is still ok?

Roy


Re: CVS commit: src/sys/dev/usb

2020-03-22 Thread Roy Marples

On 22/03/2020 08:30, Maxime Villard wrote:

Overall "From OpenBSD" is a redflag for buggy and vulnerable code..


We should be above this, no software is perfect, not even ours.

Roy


Re: CVS commit: src/lib/libcurses

2020-03-12 Thread Roy Marples

On 12/03/2020 01:53, Valery Ushakov wrote:

On Wed, Mar 11, 2020 at 23:47:40 +, Roy Marples wrote:


Module Name:src
Committed By:   roy
Date:   Wed Mar 11 23:47:40 UTC 2020

Modified Files:
src/lib/libcurses: erase.c

Log Message:
curses: Fix werase(3) wide character support

We need to consider erasing all attributes, not just WA_ATTRIBUTES.
Fixes PR lib/23910.

While here, make the function a little more readable.


Do we need the same change in wclrtoeol()?


Actually no, that code looks correct and my initial fix was slightly wrong.
Still, I've now normalised the change with wclrtoeol and wclrtobot as well.
All 3 now have the same code, maybe we should consider adding it a macro to save 
future headaches?


Roy


Re: CVS commit: src/lib/libcurses

2020-03-12 Thread Roy Marples

On 12/03/2020 06:02, Simon Burge wrote:

Can you please adjust the manpage to reflect this?  It currently says:

RETURN VALUES
  Functions returning pointers will return NULL if an error is detected.


Fixed!

Roy


Re: CVS commit: src/external/bsd/blacklist

2020-03-12 Thread Roy Marples

On 11/03/2020 15:02, Christos Zoulas wrote:

In article <20200311021208.bfb5cf...@cvs.netbsd.org>,
Roy Marples  wrote:

-=-=-=-=-=-

Module Name:src
Committed By:   roy
Date:   Wed Mar 11 02:12:08 UTC 2020

Modified Files:
src/external/bsd/blacklist/bin: blacklistd.c conf.c
src/external/bsd/blacklist/lib: bl.c

Log Message:
blacklist: Allow blacklist_sa to work with an invalid fd

fd -1 is invalid, so don't query it for protocol, port or address.

fd is supposed to represent how the client is connected, but if we are
parsing route(4) messages or log files then there is no client connection
to interogate.


Yes, but this (with the cmsg passed in the fd) is how we do access
control. If you can't figure out if the remote owns the socket,
then anyone can DoS the system by writing messages to the daemon?


I'll revert this for the time being.

Roy


Re: CVS commit: src/external/bsd/blacklist/bin

2020-03-12 Thread Roy Marples

On 11/03/2020 15:12, Christos Zoulas wrote:

In article <20200311023318.c6a7ff...@cvs.netbsd.org>,
Roy Marples  wrote:

-=-=-=-=-=-

Module Name:src
Committed By:   roy
Date:   Wed Mar 11 02:33:18 UTC 2020

Modified Files:
src/external/bsd/blacklist/bin: blacklistd.c

Log Message:
blacklist: Don't remove a ruleset if we have already added it

The noted argument is wrong - if it's already been deleted then the id we
have for it is invalid.
Because we don't track deletions to the ruleset, working it out is
problematic at best.

Instead, if we have already added the rule treat it as a non-op.

This is a valid use case because we might receive a burst of messages
in the downstream application for the same address and process them
one by one. It's not the job of the downstream application to track
blacklistd state.


The comment was correct. You need to consider the case where someone
manually deleted the rule directly from the packet filter. The
database will think it is there, but now you'll never add it again.


If we just re-add the rule, we should either get an error that it already exists 
which we should gracefully handle or it just overwrites the existing rule.

I don't see the point in deleting something which by your logic is already 
deleted.

Roy


Re: CVS commit: src/external/apache2/llvm/config/llvm/Config

2020-02-19 Thread Roy Marples

On 19/02/2020 22:29, Kamil Rytarowski wrote:

Why do you need terminfo/termios in ./build.sh tools?


We build the nbtic tool so we can build the terminfo database.

Roy


Re: CVS commit: src/external/bsd/dhcpcd/dist/src

2020-02-15 Thread Roy Marples

On 14/02/2020 20:36, Santhosh Raju wrote:

On Thu, Feb 13, 2020 at 4:44 PM Santhosh Raju  wrote:


On Thu, Feb 13, 2020 at 4:32 PM Kamil Rytarowski  wrote:


On 13.02.2020 22:20, Valery Ushakov wrote:

I did not propose to disable the warning.  I proposed to downgrade
-Werror to -Wno-error (i.e. a warning) and only for the buggy
sanitizer build.  That file will still be compiled in normal builds
with all the warnings=errors enabled, so real problems won't be
overlooked.


OK, we can try this path.

Santosh, could you please revert and try -Wno-error + upstream it?

Thank you in advance!



Sure, let me prepare the patch.



The patch has been prepared.

The builds were run both with and without MKLIBCSANITIZER=yes and it
was completed successfully.

Let us know if it alright to commit this.


Looks ok to me, commit it.

Roy


Re: CVS commit: src/external/bsd/dhcpcd/dist/src

2020-02-12 Thread Roy Marples

On 13/02/2020 02:17, Joerg Sonnenberger wrote:

I thought this fell under int promotion and thus became signed vs unsigned?


size_t is guaranteed to be at least 16bit. If INT_MAX == 32767, an
implicit cast of uint16_t would go to unsigned anyway and in all other
cases, any implicit cast must be value preserving.


My understanding was if it could be promoted to an int it would be.
So it size_t is bigger in bits than uint16_t and int is also bigger then 
promotion occurs and we then have signed vs unsigned.


Roy


Re: CVS commit: src/external/bsd/dhcpcd/dist/src

2020-02-12 Thread Roy Marples

On 12/02/2020 23:58, Joerg Sonnenberger wrote:

On Mon, Feb 10, 2020 at 04:45:35PM +, Roy Marples wrote:

On 09/02/2020 19:21, Joerg Sonnenberger wrote:

On Sat, Feb 08, 2020 at 12:17:16PM +, Santhosh Raju wrote:

Module Name:src
Committed By:   fox
Date:   Sat Feb  8 12:17:16 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c

Log Message:
external/bsd/dhcpcd: Fix a -Wconversion warning.

Type cast uint16_t to size_t to prevent implicit type conversion.


Seriously? That should not warn and no cast should be used either.


What fix would you recommend then?


Disable the warning in GCC and fill an upstream PR against it. A
conversion from uint16_t to size_t is value preserving by definition of
the ISO C platform limits. It should never create a warning.


I thought this fell under int promotion and thus became signed vs unsigned?

Roy


Re: CVS commit: src/external/bsd/dhcpcd/dist/src

2020-02-10 Thread Roy Marples

On 09/02/2020 19:21, Joerg Sonnenberger wrote:

On Sat, Feb 08, 2020 at 12:17:16PM +, Santhosh Raju wrote:

Module Name:src
Committed By:   fox
Date:   Sat Feb  8 12:17:16 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c

Log Message:
external/bsd/dhcpcd: Fix a -Wconversion warning.

Type cast uint16_t to size_t to prevent implicit type conversion.


Seriously? That should not warn and no cast should be used either.


What fix would you recommend then?

Roy


Re: CVS commit: src/games/battlestar

2020-02-05 Thread Roy Marples

On 05/02/2020 21:28, Joerg Sonnenberger wrote:

On Wed, Feb 05, 2020 at 08:11:54PM +, Santhosh Raju wrote:

Module Name:src
Committed By:   fox
Date:   Wed Feb  5 20:11:54 UTC 2020

Modified Files:
src/games/battlestar: parse.c

Log Message:
games/battlestar: Fix the -Werror=restrict warning.

Replace strcpy(1) with the safer snprintf(3) which guarantees NULL
termination of strings.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.


This can all use plain memcpy?


And if not memcpy, strlcpy is a better choice for replacing strcpy than 
snprintf.

Roy


Re: CVS commit: src/external/bsd/dhcpcd/sbin/dhcpcd

2020-01-29 Thread Roy Marples

On 29/01/2020 23:42, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Wed Jan 29 23:42:58 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/sbin/dhcpcd: Makefile

Log Message:
Hack for clang/powerpc


What error does this solve?


Re: CVS commit: src/external/bsd/dhcpcd/dist/src

2020-01-27 Thread Roy Marples

On 27/01/2020 09:03, Roy Marples wrote:

On 26/01/2020 22:57, Christos Zoulas wrote:

Module Name:    src
Committed By:    christos
Date:    Sun Jan 26 22:57:52 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/src: script.c

Log Message:
prevent coredump when state == NULL


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.12 -r1.2 src/external/bsd/dhcpcd/dist/src/script.c


A quick perusal through the code shows that this should not happen. Every time 
IPV4LL is given as a reason, the state should exist.


There is one code path where there may be no state  when an IPv4LL address 
exists and dhcpcd no longer controlls it (ie dhcpcd restarted or a 3rd party 
added it) then we delete it anyway (for say when we obtain a DHCP address).

We should still run the IPV4LL hook script, but it will be empty.

I've accepted this patch upstream.

Roy


Re: CVS commit: src/external/bsd/dhcpcd/dist/src

2020-01-27 Thread Roy Marples

On 26/01/2020 22:57, Christos Zoulas wrote:

Module Name:src
Committed By:   christos
Date:   Sun Jan 26 22:57:52 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/dist/src: script.c

Log Message:
prevent coredump when state == NULL


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.12 -r1.2 src/external/bsd/dhcpcd/dist/src/script.c


A quick perusal through the code shows that this should not happen. Every time 
IPV4LL is given as a reason, the state should exist.
If there really is no state then the script should not be called at all - we 
wouldn't want to pass the error down to dhcpcd listeners who would expect either 
an old address or new address to be present.


Hopefully you still have the coredump so this can be analysed more?

Should we also remove this line fromm 3RDPARTY?
http://anonhg.netbsd.org/src/file/tip/doc/3RDPARTY#l340

Roy


Re: CVS commit: src/sys/sys

2019-12-22 Thread Roy Marples

On 22/12/2019 22:24, Andrew Doran wrote:

NetBSD 9.99.29 - struct mount changed.


Just curious - does our build software cope with 3 digit for the last number?

Roy


Re: CVS commit: src/distrib/notes/common

2019-12-02 Thread Roy Marples

On 02/12/2019 23:09, Valery Ushakov wrote:

My apologies.  Thanks for the heads up.  I was running the extraction
script on src only.  I will restore these entries.


Is it worth having this file in xsrc for what pertains to be in xsrc?

Roy


CVS commit: src/common/lib/libc/stdlib

2019-11-28 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Nov 28 12:33:23 UTC 2019

Modified Files:
src/common/lib/libc/stdlib: strtoi.c strtou.c

Log Message:
Make it easier to use strtoi and strtou in downsteam applications
without the need to define HAVE_NBTOOL_CONFIG_H and yet allow -Wundef
not to log any warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/stdlib/strtoi.c \
src/common/lib/libc/stdlib/strtou.c

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

Modified files:

Index: src/common/lib/libc/stdlib/strtoi.c
diff -u src/common/lib/libc/stdlib/strtoi.c:1.2 src/common/lib/libc/stdlib/strtoi.c:1.3
--- src/common/lib/libc/stdlib/strtoi.c:1.2	Fri May  1 14:17:56 2015
+++ src/common/lib/libc/stdlib/strtoi.c	Thu Nov 28 12:33:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: strtoi.c,v 1.2 2015/05/01 14:17:56 christos Exp $	*/
+/*	$NetBSD: strtoi.c,v 1.3 2019/11/28 12:33:23 roy Exp $	*/
 
 /*-
  * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
@@ -30,12 +30,12 @@
  * NetBSD: src/common/lib/libc/stdlib/strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp
  */
 
-#if HAVE_NBTOOL_CONFIG_H
+#if defined(HAVE_NBTOOL_CONFIG_H) && HAVE_NBTOOL_CONFIG_H
 #include "nbtool_config.h"
 #endif
 
 #include 
-__RCSID("$NetBSD: strtoi.c,v 1.2 2015/05/01 14:17:56 christos Exp $");
+__RCSID("$NetBSD: strtoi.c,v 1.3 2019/11/28 12:33:23 roy Exp $");
 
 #ifdef _LIBC
 #include "namespace.h"
Index: src/common/lib/libc/stdlib/strtou.c
diff -u src/common/lib/libc/stdlib/strtou.c:1.2 src/common/lib/libc/stdlib/strtou.c:1.3
--- src/common/lib/libc/stdlib/strtou.c:1.2	Fri May  1 14:17:56 2015
+++ src/common/lib/libc/stdlib/strtou.c	Thu Nov 28 12:33:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: strtou.c,v 1.2 2015/05/01 14:17:56 christos Exp $	*/
+/*	$NetBSD: strtou.c,v 1.3 2019/11/28 12:33:23 roy Exp $	*/
 
 /*-
  * Copyright (c) 2005 The DragonFly Project.  All rights reserved.
@@ -30,12 +30,12 @@
  * NetBSD: src/common/lib/libc/stdlib/strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp
  */
 
-#if HAVE_NBTOOL_CONFIG_H
+#if defined(HAVE_NBTOOL_CONFIG_H) && HAVE_NBTOOL_CONFIG_H
 #include "nbtool_config.h"
 #endif
 
 #include 
-__RCSID("$NetBSD: strtou.c,v 1.2 2015/05/01 14:17:56 christos Exp $");
+__RCSID("$NetBSD: strtou.c,v 1.3 2019/11/28 12:33:23 roy Exp $");
 
 #ifdef _LIBC
 #include "namespace.h"



CVS commit: src/common/lib/libc/stdlib

2019-11-28 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Nov 28 12:33:23 UTC 2019

Modified Files:
src/common/lib/libc/stdlib: strtoi.c strtou.c

Log Message:
Make it easier to use strtoi and strtou in downsteam applications
without the need to define HAVE_NBTOOL_CONFIG_H and yet allow -Wundef
not to log any warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/stdlib/strtoi.c \
src/common/lib/libc/stdlib/strtou.c

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



Re: CVS commit: src/share/mk

2019-11-15 Thread Roy Marples

On 15/11/2019 13:41, Greg Troxel wrote:

Me too.


#metoo

Roy


Re: CVS commit: src/share/mk

2019-11-13 Thread Roy Marples

On 14/11/2019 04:53, matthew green wrote:

TLDR; libarchive has feature parity with NetBSD pax.


i don't know how you can make this claim.  are you simply
ignoring that others have a problem you haven't seen?


How can you make this claim?
Are you ignoring my very simple request that NetBSD tar should be able 
to extract modern archives?


I asked this simple question internally:
"Why does this archive give error on extraction using NetBSD?"

and lo the answer was
"Our tar is too old and not maintained. Does libarchive work?"

And verily I answered
"Yes! It does work? Can we fix the standard tar?"

"N" cameth the answer.

So, I asked the simple question ..
"Can we change the tar from pax to libarchive?"

And verily no-one had any reason to dispute this . until now.


people's upgrades are breaking now in ways they never have
before.  that's not feature parity by a long shot.

instead of ignoring the real issues, perhaps you could
argue that bsdtar should actually match the features of
pax-as-tar, and then we can all benefit from the change.

i'm not happy about this change.  i wish that bsdtar was
fixed to not be unfriendly, because it mostly is a better
implementation.  just these edge cases are rather ..
problematic yet these issues are being ignored or
rejected as being irrelevant.

we can do better.  i like christos' patch.  there's some
nuance with the symlink vs security issue, but there is
only clear additional failure cases with the unlink vs
rename issue.


Please do not be blind to my issues either.

From the conversations internally it's basically revert to pax and fuck 
modern archives or add a warning note to upgraders that chroot symlinks 
wont work on upgrading.


I myself have been bitten by this on my ERLITE router.
Real men have backups!
Actually I didn't (lesson learned here) and rc.d/nsd and unbound refused 
to copy over  so I was able to restore my configs from the chroots.

So here, our rc.d is A WIN FOR UPGRADERS!

Can we not add a note to check links in etc?

Roy


Re: CVS commit: src/share/mk

2019-11-13 Thread Roy Marples

On 14/11/2019 05:47, Martin Husemann wrote:

On Thu, Nov 14, 2019 at 03:53:02PM +1100, matthew green wrote:

i'm not happy about this change.  i wish that bsdtar was
fixed to not be unfriendly, because it mostly is a better
implementation.  just these edge cases are rather ..
problematic yet these issues are being ignored or
rejected as being irrelevant.


Me neither, especially as we now effectively have different command line
args passed from sysinst to tar depending on the tar invocation (and this
is all hard coded). I'll have to make it a define in sysinst depending
on the seleted tar variant :-/.


Just for the record, I don't really care about different cmd line args, 
symlinks and security involved.


My expectation is that a modern NetBSD tar can extract a modern tar 
archive from other sources.


If it cannot do this we have failed.

Roy


Re: CVS commit: src/share/mk

2019-11-13 Thread Roy Marples

On 14/11/2019 02:40, Kamil Rytarowski wrote:

On 14.11.2019 03:34, Roy Marples wrote:

On 13/11/2019 22:32, Joerg Sonnenberger wrote:

Module Name:    src
Committed By:    joerg
Date:    Wed Nov 13 22:32:16 UTC 2019

Modified Files:
 src/share/mk: bsd.own.mk

Log Message:
Restore pax-as-tar.


To generate a diff of this commit:
cvs rdiff -u -r1.1159 -r1.1160 src/share/mk/bsd.own.mk


And so we are doomed that we cannot open more modern archives with the
base system tar  :/


Nothing is determined here to be doomed.

Michal prepared a summary of TAR features in his write up:

https://dev.gentoo.org/~mgorny/articles/portability-of-tar-features.html


TLDR; libarchive has feature parity with NetBSD pax.
So why the peanut gallery complaints or is this write missing something 
or I've missed something.


I've had two recent archives that failed to open with NetBSD pax as tar 
and the internal consensous was to use libarchive instead because NetBSD 
pax wasn't maintained and thus would never support these.


So, to re-iterate, am I doomed never to open these archives w NetBSD 
base OS or do you have some magic wand of +4 solving Roy's problems I've 
not seen yet?


Roy


Re: CVS commit: src/share/mk

2019-11-13 Thread Roy Marples

On 13/11/2019 22:32, Joerg Sonnenberger wrote:

Module Name:src
Committed By:   joerg
Date:   Wed Nov 13 22:32:16 UTC 2019

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Restore pax-as-tar.


To generate a diff of this commit:
cvs rdiff -u -r1.1159 -r1.1160 src/share/mk/bsd.own.mk


And so we are doomed that we cannot open more modern archives with the 
base system tar  :/


CVS commit: src/doc

2019-11-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Nov 13 10:52:40 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-8.1.2


To generate a diff of this commit:
cvs rdiff -u -r1.1669 -r1.1670 src/doc/3RDPARTY
cvs rdiff -u -r1.2612 -r1.2613 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1669 src/doc/3RDPARTY:1.1670
--- src/doc/3RDPARTY:1.1669	Tue Nov 12 21:03:49 2019
+++ src/doc/3RDPARTY	Wed Nov 13 10:52:40 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1669 2019/11/12 21:03:49 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1670 2019/11/13 10:52:40 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -327,12 +327,12 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	8.1.1
-Current Vers:	8.1.1
+Version:	8.1.2
+Current Vers:	8.1.2
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/
-Date:		2019-10-16
+Date:		2019-11-13
 Mailing List: 	dhcpcd-disc...@marples.name
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2612 src/doc/CHANGES:1.2613
--- src/doc/CHANGES:1.2612	Tue Nov 12 21:03:49 2019
+++ src/doc/CHANGES	Wed Nov 13 10:52:40 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2612 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2613 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -75,3 +75,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		KS8731 and KSZ9477.
 		[msaitoh 20191107]
 	tmux(1): Imported 2.9a. [christos 20191112]
+	dhcpcd(8): Import 8.1.2. [roy 20191113]



CVS commit: src/doc

2019-11-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Nov 13 10:52:40 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-8.1.2


To generate a diff of this commit:
cvs rdiff -u -r1.1669 -r1.1670 src/doc/3RDPARTY
cvs rdiff -u -r1.2612 -r1.2613 src/doc/CHANGES

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



CVS commit: src/external/bsd/dhcpcd/dist/src

2019-11-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Nov 13 10:50:22 UTC 2019

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c dhcp6.c dhcpcd.c if-bsd.c
ipv6nd.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/dhcpcd/dist/src/dhcp6.c
cvs rdiff -u -r1.28 -r1.29 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/dhcpcd/dist/src/if-bsd.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/dhcpcd/dist/src/ipv6nd.c

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



CVS commit: src/external/bsd/dhcpcd/dist/src

2019-11-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Nov 13 10:50:22 UTC 2019

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c dhcp6.c dhcpcd.c if-bsd.c
ipv6nd.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/dhcpcd/dist/src/dhcp6.c
cvs rdiff -u -r1.28 -r1.29 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/dhcpcd/dist/src/if-bsd.c
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/dhcpcd/dist/src/ipv6nd.c

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

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.29 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.30
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.29	Wed Oct 16 14:54:39 2019
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Wed Nov 13 10:50:22 2019
@@ -41,6 +41,10 @@
 #include 
 #undef __FAVOR_BSD
 
+#ifdef AF_LINK
+#  include 
+#endif
+
 #include 
 #include 
 #include 
@@ -132,9 +136,7 @@ static void dhcp_arp_found(struct arp_st
 #endif
 static void dhcp_handledhcp(struct interface *, struct bootp *, size_t,
 const struct in_addr *);
-#ifdef IP_PKTINFO
 static void dhcp_handleifudp(void *);
-#endif
 static int dhcp_initstate(struct interface *);
 
 void
@@ -1550,7 +1552,10 @@ dhcp_openudp(struct interface *ifp)
 	n = 1;
 	if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, , sizeof(n)) == -1)
 		goto eexit;
-#ifdef IP_RECVPKTINFO
+#ifdef IP_RECVIF
+	if (setsockopt(s, IPPROTO_IP, IP_RECVIF, , sizeof(n)) == -1)
+		goto eexit;
+#else
 	if (setsockopt(s, IPPROTO_IP, IP_RECVPKTINFO, , sizeof(n)) == -1)
 		goto eexit;
 #endif
@@ -1647,39 +1652,36 @@ dhcp_makeudppacket(size_t *sz, const uin
 static ssize_t
 dhcp_sendudp(struct interface *ifp, struct in_addr *to, void *data, size_t len)
 {
-	int s;
-	struct msghdr msg;
-	struct sockaddr_in sin;
-	struct iovec iov[1];
-	struct dhcp_state *state = D_STATE(ifp);
-	ssize_t r;
-
-	iov[0].iov_base = data;
-	iov[0].iov_len = len;
-
-	memset(, 0, sizeof(sin));
-	sin.sin_family = AF_INET;
-	sin.sin_addr = *to;
-	sin.sin_port = htons(BOOTPS);
+	struct sockaddr_in sin = {
+		.sin_family = AF_INET,
+		.sin_addr = *to,
+		.sin_port = htons(BOOTPS),
 #ifdef HAVE_SA_LEN
-	sin.sin_len = sizeof(sin);
+		.sin_len = sizeof(sin),
 #endif
+	};
+	struct iovec iov[] = {
+		{ .iov_base = data, .iov_len = len }
+	};
+	struct msghdr msg = {
+		.msg_name = (void *),
+		.msg_namelen = sizeof(sin),
+		.msg_iov = iov,
+		.msg_iovlen = 1,
+	};
+	struct dhcp_state *state = D_STATE(ifp);
+	ssize_t r;
+	int fd;
 
-	memset(, 0, sizeof(msg));
-	msg.msg_name = (void *)
-	msg.msg_namelen = sizeof(sin);
-	msg.msg_iov = iov;
-	msg.msg_iovlen = 1;
-
-	s = state->udp_fd;
-	if (s == -1) {
-		s = dhcp_openudp(ifp);
-		if (s == -1)
+	fd = state->udp_fd;
+	if (fd == -1) {
+		fd = dhcp_openudp(ifp);
+		if (fd == -1)
 			return -1;
 	}
-	r = sendmsg(s, , 0);
+	r = sendmsg(fd, , 0);
 	if (state->udp_fd == -1)
-		close(s);
+		close(fd);
 	return r;
 }
 
@@ -1780,7 +1782,7 @@ send_message(struct interface *ifp, uint
 	 * As such we remove it from consideration without actually
 	 * stopping the interface. */
 	if (r == -1) {
-		logerr("%s: if_sendraw", ifp->name);
+		logerr("%s: bpf_send", ifp->name);
 		switch(errno) {
 		case ENETDOWN:
 		case ENETRESET:
@@ -2257,30 +2259,27 @@ dhcp_bind(struct interface *ifp)
 
 	ipv4_applyaddr(ifp);
 
-#ifdef IP_PKTINFO
 	/* Close the BPF filter as we can now receive DHCP messages
 	 * on a UDP socket. */
-	if (state->udp_fd == -1 ||
-	(state->old != NULL && state->old->yiaddr != state->new->yiaddr))
-	{
-		dhcp_close(ifp);
-		/* If not in master mode, open an address specific socket. */
-		if (ctx->udp_fd == -1) {
-			state->udp_fd = dhcp_openudp(ifp);
-			if (state->udp_fd == -1) {
-logerr(__func__);
-/* Address sharing without master mode is
- * not supported. It's also possible another
- * DHCP client could be running which is
- * even worse.
- * We still need to work, so re-open BPF. */
-dhcp_openbpf(ifp);
-			} else
-eloop_event_add(ctx->eloop,
-state->udp_fd, dhcp_handleifudp, ifp);
-		}
+	if (!(state->udp_fd == -1 ||
+	(state->old != NULL && state->old->yiaddr != state->new->yiaddr)))
+		return;
+	dhcp_close(ifp);
+
+	/* If not in master mode, open an address specific socket. */
+	if (ctx->udp_fd != -1)
+		return;
+	state->udp_fd = dhcp_openudp(ifp);
+	if (state->udp_fd == -1) {
+		logerr(__func__);
+		/* Address sharing without master mode is not supported.
+		 * It's also possible another DHCP client could be running,
+		 * which is even worse.
+		 * We still need to work, so re-open BPF. */
+		dhcp_openbpf(ifp);
+		return;
 	}
-#endif
+	eloop_event_add(ctx->eloop, state->udp_fd, dhcp_handleifudp, ifp);
 }
 
 static void
@@ -2609,6 +2608,11 @@ dhcp_reboot(struct interface 

CVS import: src/external/bsd/dhcpcd/dist

2019-11-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Nov 13 10:49:21 UTC 2019

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv23019

Log Message:
Import dhcpcd-8.1.2 with the following changes:
 * hooks: STOPPED is now run on timeout and exit
 * BSD: Use IP_REVCIF rather than IN_PKTINFO
 * DHCP: When rebinding, ensure we have a DHCP ARP state
 * RA: Sort routers when reachability changes
 * RA: Apply hoplimit, reachable and retrans timer values to kernel
 * RA: Warn if advertised MTU > interface MTU
 * dhcpcd: Report SSID connection to when we gain carrier
 * DHCP: Fix corruption of address flags when renewing

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-8_1_2

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
U src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
C src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
U src/external/bsd/dhcpcd/dist/src/ipv6.c
C src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/02-dump
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

5 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS commit: src/usr.sbin/rtadvd

2019-11-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Nov 11 13:42:49 UTC 2019

Modified Files:
src/usr.sbin/rtadvd: config.c rtadvd.8 rtadvd.c rtadvd.h

Log Message:
rtadvd: Add C flag to control the zeroing of the leaving configuration

This is only intended to assist the testing of clients which consume
Router Advertisement messages, such as dhcpcd(8).


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/rtadvd/config.c
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/rtadvd/rtadvd.8
cvs rdiff -u -r1.70 -r1.71 src/usr.sbin/rtadvd/rtadvd.c
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/rtadvd/rtadvd.h

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

Modified files:

Index: src/usr.sbin/rtadvd/config.c
diff -u src/usr.sbin/rtadvd/config.c:1.42 src/usr.sbin/rtadvd/config.c:1.43
--- src/usr.sbin/rtadvd/config.c:1.42	Sun Nov 10 21:32:38 2019
+++ src/usr.sbin/rtadvd/config.c	Mon Nov 11 13:42:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.c,v 1.42 2019/11/10 21:32:38 roy Exp $	*/
+/*	$NetBSD: config.c,v 1.43 2019/11/11 13:42:49 roy Exp $	*/
 /*	$KAME: config.c,v 1.93 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -719,6 +719,11 @@ getconfig(const char *intface, int exith
 	TAILQ_FOREACH(rai, , next) {
 		if (rai->ifindex == tmp->ifindex) {
 			TAILQ_REMOVE(, rai, next);
+			if (Cflag) {
+free_rainfo(rai);
+rai = NULL;
+break;
+			}
 			/* If we already have a leaving RA use that
 			 * as this config hasn't been advertised */
 			if (rai->leaving) {

Index: src/usr.sbin/rtadvd/rtadvd.8
diff -u src/usr.sbin/rtadvd/rtadvd.8:1.26 src/usr.sbin/rtadvd/rtadvd.8:1.27
--- src/usr.sbin/rtadvd/rtadvd.8:1.26	Mon Nov  6 15:15:04 2017
+++ src/usr.sbin/rtadvd/rtadvd.8	Mon Nov 11 13:42:49 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: rtadvd.8,v 1.26 2017/11/06 15:15:04 christos Exp $
+.\"	$NetBSD: rtadvd.8,v 1.27 2019/11/11 13:42:49 roy Exp $
 .\"	$KAME: rtadvd.8,v 1.24 2002/05/31 16:16:08 jinmei Exp $
 .\"
 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -28,7 +28,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd November 6, 2017
+.Dd November 11, 2019
 .Dt RTADVD 8
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 .Nd router advertisement daemon
 .Sh SYNOPSIS
 .Nm
-.Op Fl DdfRs
+.Op Fl CDdfRs
 .Op Fl c Ar configfile
 .Op Fl M Ar ifname
 .Op Fl p Ar pidfile
@@ -112,6 +112,10 @@ advertising interface.
 The command line options are:
 .Bl -tag -width indent
 .\"
+.It Fl C
+Don't expire the existing configuration on receipt of SIGHUP.
+This option is only intended to aid the testing of clients that consume
+Router Advertisement messages.
 .It Fl c Ar configfile
 Specify an alternate location,
 .Ar configfile ,
@@ -175,7 +179,9 @@ to reload the configuration file
 .Pa /etc/rtadvd.conf .
 If an invalid parameter is found in the configuration file upon the reload, the
 entry will be ignored and the old configuration will be used.
-When parameters in an existing entry are updated,
+When parameters in an existing entry are updated and the
+.Fl C
+flag is not used,
 .Nm
 will send Router Advertisement messages with the old configuration but zero
 router lifetime to the interface first, and then start to send a new message.

Index: src/usr.sbin/rtadvd/rtadvd.c
diff -u src/usr.sbin/rtadvd/rtadvd.c:1.70 src/usr.sbin/rtadvd/rtadvd.c:1.71
--- src/usr.sbin/rtadvd/rtadvd.c:1.70	Sun Nov 10 21:07:39 2019
+++ src/usr.sbin/rtadvd/rtadvd.c	Mon Nov 11 13:42:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtadvd.c,v 1.70 2019/11/10 21:07:39 roy Exp $	*/
+/*	$NetBSD: rtadvd.c,v 1.71 2019/11/11 13:42:49 roy Exp $	*/
 /*	$KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -89,7 +89,7 @@ static char *mcastif;
 int sock;
 int rtsock = -1;
 int accept_rr = 0;
-int dflag = 0, sflag = 0, Dflag;
+int Cflag = 0, dflag = 0, sflag = 0, Dflag;
 
 static char **if_argv;
 static int if_argc;
@@ -194,6 +194,9 @@ main(int argc, char *argv[])
 		case 'c':
 			conffile = optarg;
 			break;
+		case 'C':
+			Cflag++;
+			break;
 		case 'd':
 			dflag++;
 			break;

Index: src/usr.sbin/rtadvd/rtadvd.h
diff -u src/usr.sbin/rtadvd/rtadvd.h:1.19 src/usr.sbin/rtadvd/rtadvd.h:1.20
--- src/usr.sbin/rtadvd/rtadvd.h:1.19	Fri Apr 20 16:37:17 2018
+++ src/usr.sbin/rtadvd/rtadvd.h	Mon Nov 11 13:42:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtadvd.h,v 1.19 2018/04/20 16:37:17 roy Exp $	*/
+/*	$NetBSD: rtadvd.h,v 1.20 2019/11/11 13:42:49 roy Exp $	*/
 /*	$KAME: rtadvd.h,v 1.30 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -197,3 +197,5 @@ void ra_timer_set_short_delay(struct rai
 int prefix_match(struct in6_addr *, int, struct in6_addr *, int);
 struct rainfo *if_indextorainfo(unsigned int);
 struct prefix *find_prefix(struct rainfo *, struct in6_addr *, int);
+
+extern int Cflag;



CVS commit: src/usr.sbin/rtadvd

2019-11-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Mon Nov 11 13:42:49 UTC 2019

Modified Files:
src/usr.sbin/rtadvd: config.c rtadvd.8 rtadvd.c rtadvd.h

Log Message:
rtadvd: Add C flag to control the zeroing of the leaving configuration

This is only intended to assist the testing of clients which consume
Router Advertisement messages, such as dhcpcd(8).


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/rtadvd/config.c
cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/rtadvd/rtadvd.8
cvs rdiff -u -r1.70 -r1.71 src/usr.sbin/rtadvd/rtadvd.c
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/rtadvd/rtadvd.h

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



CVS commit: src/usr.sbin/rtadvd

2019-11-10 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Nov 10 21:32:38 UTC 2019

Modified Files:
src/usr.sbin/rtadvd: config.c

Log Message:
rtadvd: remove support for SIOCSIFINFO_IN6

It's been broken since we enabled dropping privs.
It's also probably the wrong place to do this, and support for
SIOCSIFINFO_IN6 will be in the next dhcpcd import.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/rtadvd/config.c

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



CVS commit: src/usr.sbin/rtadvd

2019-11-10 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Nov 10 21:32:38 UTC 2019

Modified Files:
src/usr.sbin/rtadvd: config.c

Log Message:
rtadvd: remove support for SIOCSIFINFO_IN6

It's been broken since we enabled dropping privs.
It's also probably the wrong place to do this, and support for
SIOCSIFINFO_IN6 will be in the next dhcpcd import.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/usr.sbin/rtadvd/config.c

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

Modified files:

Index: src/usr.sbin/rtadvd/config.c
diff -u src/usr.sbin/rtadvd/config.c:1.41 src/usr.sbin/rtadvd/config.c:1.42
--- src/usr.sbin/rtadvd/config.c:1.41	Fri Jun 14 09:06:45 2019
+++ src/usr.sbin/rtadvd/config.c	Sun Nov 10 21:32:38 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.c,v 1.41 2019/06/14 09:06:45 roy Exp $	*/
+/*	$NetBSD: config.c,v 1.42 2019/11/10 21:32:38 roy Exp $	*/
 /*	$KAME: config.c,v 1.93 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -507,34 +507,6 @@ getconfig(const char *intface, int exith
 		goto errexit;
 	}
 
-#ifdef SIOCSIFINFO_IN6
-	{
-		struct in6_ndireq ndi;
-		int s;
-
-		if ((s = prog_socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
-			logit(LOG_ERR, "<%s> socket: %m", __func__);
-			goto errexit;
-		}
-		memset(, 0, sizeof(ndi));
-		strncpy(ndi.ifname, intface, IFNAMSIZ);
-		if (prog_ioctl(s, SIOCGIFINFO_IN6, ) < 0) {
-			logit(LOG_INFO, "<%s> ioctl:SIOCGIFINFO_IN6 at %s: %m",
-			 __func__, intface);
-		}
-
-		/* reflect the RA info to the host variables in kernel */
-		ndi.ndi.chlim = tmp->hoplimit;
-		ndi.ndi.retrans = tmp->retranstimer;
-		ndi.ndi.basereachable = tmp->reachabletime;
-		if (prog_ioctl(s, SIOCSIFINFO_IN6, ) < 0) {
-			logit(LOG_INFO, "<%s> ioctl:SIOCSIFINFO_IN6 at %s: %m",
-			 __func__, intface);
-		}
-		prog_close(s);
-	}
-#endif
-
 	/* route information */
 	for (i = -1; i < MAXROUTE; i++) {
 		struct rtinfo *rti;



CVS commit: src/usr.sbin/rtadvd

2019-11-10 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Nov 10 21:07:39 UTC 2019

Modified Files:
src/usr.sbin/rtadvd: rtadvd.c

Log Message:
rtadvd: Fix reloading configuration killing interface timers


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/usr.sbin/rtadvd/rtadvd.c

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



CVS commit: src/usr.sbin/rtadvd

2019-11-10 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Nov 10 21:07:39 UTC 2019

Modified Files:
src/usr.sbin/rtadvd: rtadvd.c

Log Message:
rtadvd: Fix reloading configuration killing interface timers


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/usr.sbin/rtadvd/rtadvd.c

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

Modified files:

Index: src/usr.sbin/rtadvd/rtadvd.c
diff -u src/usr.sbin/rtadvd/rtadvd.c:1.69 src/usr.sbin/rtadvd/rtadvd.c:1.70
--- src/usr.sbin/rtadvd/rtadvd.c:1.69	Fri Mar 29 21:51:52 2019
+++ src/usr.sbin/rtadvd/rtadvd.c	Sun Nov 10 21:07:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtadvd.c,v 1.69 2019/03/29 21:51:52 christos Exp $	*/
+/*	$NetBSD: rtadvd.c,v 1.70 2019/11/10 21:07:39 roy Exp $	*/
 /*	$KAME: rtadvd.c,v 1.92 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -452,6 +452,18 @@ die(void)
 }
 
 static void
+ra_timer_reset(struct rainfo *rai)
+{
+
+	rtadvd_remove_timer(>timer);
+	rai->timer = rtadvd_add_timer(ra_timeout, ra_timer_update, rai, rai);
+	ra_timer_update(rai, >timer->tm);
+	rtadvd_set_timer(>timer->tm, rai->timer);
+	rtadvd_remove_timer(>timer_sol);
+	rai->timer_sol = rtadvd_add_timer(ra_timeout_sol, NULL, rai, NULL);
+}
+
+static void
 rtmsg_input(void)
 {
 	int n, type, ifindex = 0, plen;
@@ -698,14 +710,7 @@ rtmsg_input(void)
 
 			rai->initcounter = 0; /* reset the counter */
 			rai->waiting = 0; /* XXX */
-			rtadvd_remove_timer(>timer);
-			rai->timer = rtadvd_add_timer(ra_timeout,
-			ra_timer_update, rai, rai);
-			ra_timer_update(rai, >timer->tm);
-			rtadvd_set_timer(>timer->tm, rai->timer);
-			rtadvd_remove_timer(>timer_sol);
-			rai->timer_sol = rtadvd_add_timer(ra_timeout_sol,
-			NULL, rai, NULL);
+			ra_timer_reset(rai);
 		} else if (prefixchange && rai->ifflags & IFF_UP) {
 			/*
 			 * An advertised prefix has been added or invalidated.
@@ -1760,10 +1765,7 @@ ra_output(struct rainfo *rai, bool solic
 			   "%s: expired RA,"
 			   " new config active for interface (%s)",
 			   __func__, rai->ifname);
-			rai->leaving_for->timer = rtadvd_add_timer(ra_timeout,
-			ra_timer_update,
-			rai->leaving_for, rai->leaving_for);
-			ra_timer_set_short_delay(rai->leaving_for, rai->timer);
+			ra_timer_reset(rai->leaving_for);
 			rai->leaving_for->leaving = NULL;
 			free_rainfo(rai);
 			return NULL;



Re: CVS import: src/external/bsd/dhcpcd/dist

2019-10-16 Thread Roy Marples
This should now be fixed.

On 14 October 2019 16:39:24 BST, "Herbert J. Skuhra"  wrote:
>On Fri, 11 Oct 2019 13:01:23 +0200, "Roy Marples" wrote:
>> 
>> Module Name: src
>> Committed By:roy
>> Date:Fri Oct 11 11:01:23 UTC 2019
>> 
>> Update of /cvsroot/src/external/bsd/dhcpcd/dist
>> In directory ivanova.netbsd.org:/tmp/cvs-serv19794
>> 
>> Log Message:
>> Import dhcpcd-8.1.0 with the following changes:
>> 
>>  * Fix carrier status after a route socket overflow
>>  * Allow domain spaced options
>>  * DHCP: Allow not sending Force Renew Nonce or Reconf Accept
>>  * IPv4LL: Now passes Apple Bonjour test versions 1.4 and 1.5
>>  * ARP: Fix a typo and remove pragma (thus working with old gcc)
>>  * DHCP6: Fix a cosmetic issue with infinite leases
>>  * DHCP6: SLA 0 and Prefix Len 0 will now add a delegatd /64 address
>>  * Ignore some virtual interfaces such as Tap and Bridge by default
>>  * BPF: Move validation logic out of BPF and back into dhcpcd 
>
>Hi,
>
>this obviously breaks DHCP on my Raspberry PI 2B (earmv7hf).
>I've also checked daily snapshots:
>
>201910102350Z OK
>201910111300Z not OK usmsc0 169.254.x.x/16
>
>--
>Herbert

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

CVS commit: src/doc

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:56:34 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-8.1.1


To generate a diff of this commit:
cvs rdiff -u -r1.1663 -r1.1664 src/doc/3RDPARTY
cvs rdiff -u -r1.2595 -r1.2596 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1663 src/doc/3RDPARTY:1.1664
--- src/doc/3RDPARTY:1.1663	Tue Oct 15 16:17:43 2019
+++ src/doc/3RDPARTY	Wed Oct 16 14:56:34 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1663 2019/10/15 16:17:43 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1664 2019/10/16 14:56:34 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -327,12 +327,12 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	8.1.0
-Current Vers:	8.1.0
+Version:	8.1.1
+Current Vers:	8.1.1
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/
-Date:		2019-10-11
+Date:		2019-10-16
 Mailing List: 	dhcpcd-disc...@marples.name
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2595 src/doc/CHANGES:1.2596
--- src/doc/CHANGES:1.2595	Tue Oct 15 18:35:29 2019
+++ src/doc/CHANGES	Wed Oct 16 14:56:34 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2595 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2596 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -58,3 +58,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	OpenSSH: Import 8.1. [christos 20191012]
 	acpi(4): Updated ACPICA to 20190816. [christos 20191015]
 	sup: removed, use ftp://ftp.astron.com/pub/sup [christos 20191015]
+	dhcpcd(8): Import dhcpcd-8.1.1 [roy 20191016]



CVS commit: src/doc

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:56:34 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-8.1.1


To generate a diff of this commit:
cvs rdiff -u -r1.1663 -r1.1664 src/doc/3RDPARTY
cvs rdiff -u -r1.2595 -r1.2596 src/doc/CHANGES

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



CVS commit: src/external/bsd/dhcpcd/dist/src

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:54:39 UTC 2019

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c dhcpcd.c ipv6.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.27 -r1.28 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/dhcpcd/dist/src/ipv6.c

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

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.28 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.29
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.28	Fri Oct 11 11:03:59 2019
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Wed Oct 16 14:54:39 2019
@@ -164,8 +164,6 @@ dhcp_printoptions(const struct dhcpcd_ct
 	}
 }
 
-#define get_option_raw(ctx, bootp, bootp_len, opt)	\
-	get_option((ctx), (bootp), (bootp_len), NULL)
 static const uint8_t *
 get_option(struct dhcpcd_ctx *ctx,
 const struct bootp *bootp, size_t bootp_len,
@@ -3275,26 +3273,35 @@ is_packet_udp_bootp(void *packet, size_t
 {
 	struct ip *ip = packet;
 	size_t ip_hlen;
-	struct udphdr *udp;
+	struct udphdr udp;
 
-	if (sizeof(*ip) > plen)
+	if (plen < sizeof(*ip))
 		return false;
 
 	if (ip->ip_v != IPVERSION || ip->ip_p != IPPROTO_UDP)
 		return false;
 
 	/* Sanity. */
-	if (ntohs(ip->ip_len) != plen)
+	if (ntohs(ip->ip_len) > plen)
 		return false;
 
 	ip_hlen = (size_t)ip->ip_hl * 4;
+	if (ip_hlen < sizeof(*ip))
+		return false;
+
 	/* Check we have a UDP header and BOOTP. */
-	if (ip_hlen + sizeof(*udp) + offsetof(struct bootp, vend) > plen)
+	if (ip_hlen + sizeof(udp) + offsetof(struct bootp, vend) > plen)
+		return false;
+
+	/* Sanity. */
+	memcpy(, (char *)ip + ip_hlen, sizeof(udp));
+	if (ntohs(udp.uh_ulen) < sizeof(udp))
+		return false;
+	if (ip_hlen + ntohs(udp.uh_ulen) > plen)
 		return false;
 
 	/* Check it's to and from the right ports. */
-	udp = (struct udphdr *)(void *)((char *)ip + ip_hlen);
-	if (udp->uh_dport != htons(BOOTPC) || udp->uh_sport != htons(BOOTPS))
+	if (udp.uh_dport != htons(BOOTPC) || udp.uh_sport != htons(BOOTPS))
 		return false;
 
 	return true;
@@ -3306,14 +3313,17 @@ checksums_valid(void *packet,
 struct in_addr *from, unsigned int flags)
 {
 	struct ip *ip = packet;
-	struct ip pseudo_ip = {
-		.ip_p = IPPROTO_UDP,
-		.ip_src = ip->ip_src,
-		.ip_dst = ip->ip_dst
+	union pip {
+		struct ip ip;
+		uint16_t w[sizeof(struct ip)];
+	} pip = {
+		.ip.ip_p = IPPROTO_UDP,
+		.ip.ip_src = ip->ip_src,
+		.ip.ip_dst = ip->ip_dst,
 	};
 	size_t ip_hlen;
-	uint16_t udp_len, uh_sum;
-	struct udphdr *udp;
+	struct udphdr udp;
+	char *udpp, *uh_sump;
 	uint32_t csum;
 
 	if (from != NULL)
@@ -3324,22 +3334,32 @@ checksums_valid(void *packet,
 		return false;
 
 	if (flags & BPF_PARTIALCSUM)
-		return 0;
+		return true;
 
-	udp = (struct udphdr *)(void *)((char *)ip + ip_hlen);
-	if (udp->uh_sum == 0)
-		return 0;
+	udpp = (char *)ip + ip_hlen;
+	memcpy(, udpp, sizeof(udp));
+	if (udp.uh_sum == 0)
+		return true;
 
 	/* UDP checksum is based on a pseudo IP header alongside
 	 * the UDP header and payload. */
-	udp_len = ntohs(udp->uh_ulen);
-	uh_sum = udp->uh_sum;
-	udp->uh_sum = 0;
-	pseudo_ip.ip_len = udp->uh_ulen;
+	pip.ip.ip_len = udp.uh_ulen;
 	csum = 0;
-	in_cksum(_ip, sizeof(pseudo_ip), );
-	csum = in_cksum(udp, udp_len, );
-	return csum == uh_sum;
+
+	/* Need to zero the UDP sum in the packet for the checksum to work. */
+	uh_sump = udpp + offsetof(struct udphdr, uh_sum);
+	memset(uh_sump, 0, sizeof(udp.uh_sum));
+
+	/* Checksum psuedo header and then UDP + payload. */
+	in_cksum(pip.w, sizeof(pip.w), );
+	csum = in_cksum(udpp, ntohs(udp.uh_ulen), );
+
+#if 0	/* Not needed, just here for completeness. */
+	/* Put the checksum back. */
+	memcpy(uh_sump, _sum, sizeof(udp.uh_sum));
+#endif
+
+	return csum == udp.uh_sum;
 }
 
 static void

Index: src/external/bsd/dhcpcd/dist/src/dhcpcd.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.27 src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.28
--- src/external/bsd/dhcpcd/dist/src/dhcpcd.c:1.27	Fri Oct 11 11:03:59 2019
+++ src/external/bsd/dhcpcd/dist/src/dhcpcd.c	Wed Oct 16 14:54:39 2019
@@ -1984,12 +1984,10 @@ printpidfile:
 	logdebugx(PACKAGE "-" VERSION " starting");
 	ctx.options |= DHCPCD_STARTED;
 
-#ifdef HAVE_SETPROCTITLE
 	setproctitle("%s%s%s",
 	ctx.options & DHCPCD_MASTER ? "[master]" : argv[optind],
 	ctx.options & DHCPCD_IPV4 ? " [ip4]" : "",
 	ctx.options & DHCPCD_IPV6 ? " [ip6]" : "");
-#endif
 
 	if (if_opensockets() == -1) {
 		logerr("%s: if_opensockets", __func__);
@@ -2155,6 +2153,9 @@ exit1:
 		loginfox(PACKAGE " exited");
 	logclose();
 	free(ctx.logfile);
+#ifdef SETPROCTITLE_H
+	setproctitle_free();
+#endif
 #ifdef USE_SIGNALS
 	if (ctx.options & DHCPCD_FORKED)
 		_exit(i); /* so atexit won't remove our pidfile */

Index: 

CVS commit: src/external/bsd/dhcpcd/dist/src

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:54:39 UTC 2019

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c dhcpcd.c ipv6.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.27 -r1.28 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/dhcpcd/dist/src/ipv6.c

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



CVS import: src/external/bsd/dhcpcd/dist

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:53:23 UTC 2019

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv27686

Log Message:
Import dhcpcd-8.1.1 with the following changes:

 * IPv6: Fix a potential crash when learning interface addresses.
 * DHCP: Fix fallout from dhcpcd-8.1.0 for checksum calculation.

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-8_1_1

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
U src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
C src/external/bsd/dhcpcd/dist/src/ipv6.c
C src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/02-dump
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

5 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS import: src/external/bsd/dhcpcd/dist

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:53:23 UTC 2019

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv27686

Log Message:
Import dhcpcd-8.1.1 with the following changes:

 * IPv6: Fix a potential crash when learning interface addresses.
 * DHCP: Fix fallout from dhcpcd-8.1.0 for checksum calculation.

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-8_1_1

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
U src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
C src/external/bsd/dhcpcd/dist/src/ipv6.c
C src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/02-dump
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

5 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS import: src/external/bsd/dhcpcd/dist

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:50:28 UTC 2019

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv13885

Log Message:
Import dhcpcd-8.1.1 with the following changes:

 * IPv6: Fix a potential crash when learning interface addresses.
 * DHCP: Fix fallout from dhcpcd-8.1.0 for checksum calculation.

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-8_1_1

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
U src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
C src/external/bsd/dhcpcd/dist/src/ipv6.c
C src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/02-dump
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

5 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS import: src/external/bsd/dhcpcd/dist

2019-10-16 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Wed Oct 16 14:50:28 UTC 2019

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv13885

Log Message:
Import dhcpcd-8.1.1 with the following changes:

 * IPv6: Fix a potential crash when learning interface addresses.
 * DHCP: Fix fallout from dhcpcd-8.1.0 for checksum calculation.

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-8_1_1

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
U src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
U src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
U src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
C src/external/bsd/dhcpcd/dist/src/ipv6.c
C src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/02-dump
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

5 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS commit: src/sys/netinet

2019-10-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Oct 11 13:32:46 UTC 2019

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
ARP: Don't defend ARP probes.

We should let the nature of ARP takes it's course here when our address
is neither tentative nor duplicated.
This allows the host to work with ARP ping, which was broken in r1.279.


To generate a diff of this commit:
cvs rdiff -u -r1.288 -r1.289 src/sys/netinet/if_arp.c

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



CVS commit: src/sys/netinet

2019-10-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Oct 11 13:32:46 UTC 2019

Modified Files:
src/sys/netinet: if_arp.c

Log Message:
ARP: Don't defend ARP probes.

We should let the nature of ARP takes it's course here when our address
is neither tentative nor duplicated.
This allows the host to work with ARP ping, which was broken in r1.279.


To generate a diff of this commit:
cvs rdiff -u -r1.288 -r1.289 src/sys/netinet/if_arp.c

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

Modified files:

Index: src/sys/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.288 src/sys/netinet/if_arp.c:1.289
--- src/sys/netinet/if_arp.c:1.288	Wed Sep 25 09:52:32 2019
+++ src/sys/netinet/if_arp.c	Fri Oct 11 13:32:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.288 2019/09/25 09:52:32 ozaki-r Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.289 2019/10/11 13:32:46 roy Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.288 2019/09/25 09:52:32 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.289 2019/10/11 13:32:46 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1157,15 +1157,17 @@ in_arpinput(struct mbuf *m)
 	/*
 	 * DAD check, RFC 5227.
 	 * Collision on sender address is always a duplicate.
-	 * Collision on target address is only a duplicate IF
-	 * the sender address is the null host (ie a DAD probe) AND
-	 * the message was broadcast - if it's unicast then it's
-	 * a valid Unicast Poll from RFC 1122.
+	 * Collision on target address is only a duplicate
+	 * IF the sender address is the null host (ie a DAD probe)
+	 * AND the message was broadcast
+	 * AND our address is either tentative or duplicated
+	 * If it was unicast then it's a valid Unicast Poll from RFC 1122.
 	 */
 	if (do_dad &&
 	(in_hosteq(isaddr, myaddr) ||
 	(in_nullhost(isaddr) && in_hosteq(itaddr, myaddr) &&
-	 m->m_flags & M_BCAST)))
+	 m->m_flags & M_BCAST &&
+	 ia->ia4_flags & (IN_IFF_TENTATIVE | IN_IFF_DUPLICATED
 	{
 		struct sockaddr_dl sdl, *sdlp;
 



CVS commit: src/doc

2019-10-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Oct 11 11:05:42 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-8.1.0


To generate a diff of this commit:
cvs rdiff -u -r1.1660 -r1.1661 src/doc/3RDPARTY
cvs rdiff -u -r1.2591 -r1.2592 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1660 src/doc/3RDPARTY:1.1661
--- src/doc/3RDPARTY:1.1660	Thu Oct 10 18:23:43 2019
+++ src/doc/3RDPARTY	Fri Oct 11 11:05:41 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1660 2019/10/10 18:23:43 mrg Exp $
+#	$NetBSD: 3RDPARTY,v 1.1661 2019/10/11 11:05:41 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -327,12 +327,12 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	8.0.6
-Current Vers:	8.0.6
+Version:	8.1.0
+Current Vers:	8.1.0
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/
-Date:		2019-09-13
+Date:		2019-10-11
 Mailing List: 	dhcpcd-disc...@marples.name
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2591 src/doc/CHANGES:1.2592
--- src/doc/CHANGES:1.2591	Wed Oct  9 22:50:14 2019
+++ src/doc/CHANGES	Fri Oct 11 11:05:41 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2591 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2592 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -54,3 +54,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	tzdata updates from 2019a to 2019c (incl 2019b) [kre 20191008]
 	services(5): Update to version 2019-10-04 from IANA.
 		[sevan 20191009]
+	dhcpcd(8): Import dhcpcd-8.1.0 [roy 20191011]



CVS commit: src/doc

2019-10-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Oct 11 11:05:42 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note import of dhcpcd-8.1.0


To generate a diff of this commit:
cvs rdiff -u -r1.1660 -r1.1661 src/doc/3RDPARTY
cvs rdiff -u -r1.2591 -r1.2592 src/doc/CHANGES

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



CVS commit: src/external/bsd/dhcpcd/dist/src

2019-10-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Oct 11 11:03:59 UTC 2019

Modified Files:
src/external/bsd/dhcpcd/dist/src: bpf.c dhcp.c dhcp6.c dhcpcd.8.in
dhcpcd.c if-bsd.c if-options.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/dhcpcd/dist/src/bpf.c \
src/external/bsd/dhcpcd/dist/src/dhcp6.c
cvs rdiff -u -r1.27 -r1.28 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
cvs rdiff -u -r1.26 -r1.27 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/dhcpcd/dist/src/if-bsd.c
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/dhcpcd/dist/src/if-options.c

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

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/bpf.c
diff -u src/external/bsd/dhcpcd/dist/src/bpf.c:1.12 src/external/bsd/dhcpcd/dist/src/bpf.c:1.13
--- src/external/bsd/dhcpcd/dist/src/bpf.c:1.12	Wed Aug 21 17:12:19 2019
+++ src/external/bsd/dhcpcd/dist/src/bpf.c	Fri Oct 11 11:03:59 2019
@@ -410,13 +410,7 @@ bpf_cmp_hwaddr(struct bpf_insn *bpf, siz
 #endif
 
 #ifdef ARP
-
 static const struct bpf_insn bpf_arp_ether [] = {
-	/* Ensure packet is at least correct size. */
-	BPF_STMT(BPF_LD + BPF_W + BPF_LEN, 0),
-	BPF_JUMP(BPF_JMP + BPF_JGE + BPF_K, sizeof(struct ether_arp), 1, 0),
-	BPF_STMT(BPF_RET + BPF_K, 0),
-
 	/* Check this is an ARP packet. */
 	BPF_STMT(BPF_LD + BPF_H + BPF_ABS,
 	 offsetof(struct ether_header, ether_type)),
@@ -552,17 +546,8 @@ bpf_arp(struct interface *ifp, int fd)
 }
 #endif
 
-#define	BPF_M_FHLEN	0
-#define	BPF_M_IPHLEN	1
-#define	BPF_M_IPLEN	2
-#define	BPF_M_UDP	3
-#define	BPF_M_UDPLEN	4
-
 #ifdef ARPHRD_NONE
 static const struct bpf_insn bpf_bootp_none[] = {
-	/* Set the frame header length to zero. */
-	BPF_STMT(BPF_LD + BPF_IMM, 0),
-	BPF_STMT(BPF_ST, BPF_M_FHLEN),
 };
 #define BPF_BOOTP_NONE_LEN	__arraycount(bpf_bootp_none)
 #endif
@@ -574,13 +559,14 @@ static const struct bpf_insn bpf_bootp_e
 	BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, ETHERTYPE_IP, 1, 0),
 	BPF_STMT(BPF_RET + BPF_K, 0),
 
-	/* Load frame header length into X. */
-	BPF_STMT(BPF_LDX + BPF_W + BPF_IMM, sizeof(struct ether_header)),
-	/* Copy frame header length to memory */
-	BPF_STMT(BPF_STX, BPF_M_FHLEN),
+	/* Advance to the IP header. */
+	BPF_STMT(BPF_LDX + BPF_K, sizeof(struct ether_header)),
 };
 #define BPF_BOOTP_ETHER_LEN	__arraycount(bpf_bootp_ether)
 
+#define BOOTP_MIN_SIZE		sizeof(struct ip) + sizeof(struct udphdr) + \
+sizeof(struct bootp)
+
 static const struct bpf_insn bpf_bootp_filter[] = {
 	/* Make sure it's an IPv4 packet. */
 	BPF_STMT(BPF_LD + BPF_B + BPF_IND, 0),
@@ -588,15 +574,6 @@ static const struct bpf_insn bpf_bootp_f
 	BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, 0x40, 1, 0),
 	BPF_STMT(BPF_RET + BPF_K, 0),
 
-	/* Ensure IP header length is big enough and
-	 * store the IP header length in memory. */
-	BPF_STMT(BPF_LD + BPF_B + BPF_IND, 0),
-	BPF_STMT(BPF_ALU + BPF_AND + BPF_K, 0x0f),
-	BPF_STMT(BPF_ALU + BPF_MUL + BPF_K, 4),
-	BPF_JUMP(BPF_JMP + BPF_JGE + BPF_K, sizeof(struct ip), 1, 0),
-	BPF_STMT(BPF_RET + BPF_K, 0),
-	BPF_STMT(BPF_ST, BPF_M_IPHLEN),
-
 	/* Make sure it's a UDP packet. */
 	BPF_STMT(BPF_LD + BPF_B + BPF_IND, offsetof(struct ip, ip_p)),
 	BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, IPPROTO_UDP, 1, 0),
@@ -607,49 +584,17 @@ static const struct bpf_insn bpf_bootp_f
 	BPF_JUMP(BPF_JMP + BPF_JSET + BPF_K, 0x1fff, 0, 1),
 	BPF_STMT(BPF_RET + BPF_K, 0),
 
-	/* Store IP length. */
-	BPF_STMT(BPF_LD + BPF_H + BPF_IND, offsetof(struct ip, ip_len)),
-	BPF_STMT(BPF_ST, BPF_M_IPLEN),
-
 	/* Advance to the UDP header. */
-	BPF_STMT(BPF_LD + BPF_MEM, BPF_M_IPHLEN),
+	BPF_STMT(BPF_LD + BPF_B + BPF_IND, 0),
+	BPF_STMT(BPF_ALU + BPF_AND + BPF_K, 0x0f),
+	BPF_STMT(BPF_ALU + BPF_MUL + BPF_K, 4),
 	BPF_STMT(BPF_ALU + BPF_ADD + BPF_X, 0),
 	BPF_STMT(BPF_MISC + BPF_TAX, 0),
 
-	/* Store UDP location */
-	BPF_STMT(BPF_STX, BPF_M_UDP),
-
 	/* Make sure it's from and to the right port. */
 	BPF_STMT(BPF_LD + BPF_W + BPF_IND, 0),
 	BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_K, (BOOTPS << 16) + BOOTPC, 1, 0),
 	BPF_STMT(BPF_RET + BPF_K, 0),
-
-	/* Store UDP length. */
-	BPF_STMT(BPF_LD + BPF_H + BPF_IND, offsetof(struct udphdr, uh_ulen)),
-	BPF_STMT(BPF_ST, BPF_M_UDPLEN),
-
-	/* Ensure that UDP length + IP header length == IP length */
-	/* Copy IP header length to X. */
-	BPF_STMT(BPF_LDX + BPF_MEM, BPF_M_IPHLEN),
-	/* Add UDP length (A) to IP header length (X). */
-	BPF_STMT(BPF_ALU + BPF_ADD + BPF_X, 0),
-	/* Store result in X. */
-	BPF_STMT(BPF_MISC + BPF_TAX, 0),
-	/* Copy IP length to A. */
-	BPF_STMT(BPF_LD + BPF_MEM, BPF_M_IPLEN),
-	/* Ensure X == A. */
-	BPF_JUMP(BPF_JMP + BPF_JEQ + BPF_X, 0, 1, 0),
-	BPF_STMT(BPF_RET + BPF_K, 0),
-
-	/* Advance to the BOOTP packet. */
-	BPF_STMT(BPF_LD + BPF_MEM, BPF_M_UDP),
-	BPF_STMT(BPF_ALU + BPF_ADD + BPF_K, 

CVS commit: src/external/bsd/dhcpcd/dist/src

2019-10-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Oct 11 11:03:59 UTC 2019

Modified Files:
src/external/bsd/dhcpcd/dist/src: bpf.c dhcp.c dhcp6.c dhcpcd.8.in
dhcpcd.c if-bsd.c if-options.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/dhcpcd/dist/src/bpf.c \
src/external/bsd/dhcpcd/dist/src/dhcp6.c
cvs rdiff -u -r1.27 -r1.28 src/external/bsd/dhcpcd/dist/src/dhcp.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
cvs rdiff -u -r1.26 -r1.27 src/external/bsd/dhcpcd/dist/src/dhcpcd.c
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/dhcpcd/dist/src/if-bsd.c
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/dhcpcd/dist/src/if-options.c

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



CVS import: src/external/bsd/dhcpcd/dist

2019-10-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Oct 11 11:01:23 UTC 2019

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv19794

Log Message:
Import dhcpcd-8.1.0 with the following changes:

 * Fix carrier status after a route socket overflow
 * Allow domain spaced options
 * DHCP: Allow not sending Force Renew Nonce or Reconf Accept
 * IPv4LL: Now passes Apple Bonjour test versions 1.4 and 1.5
 * ARP: Fix a typo and remove pragma (thus working with old gcc)
 * DHCP6: Fix a cosmetic issue with infinite leases
 * DHCP6: SLA 0 and Prefix Len 0 will now add a delegatd /64 address
 * Ignore some virtual interfaces such as Tap and Bridge by default
 * BPF: Move validation logic out of BPF and back into dhcpcd 

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-8_1_0

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
C src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
C src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
C src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
U src/external/bsd/dhcpcd/dist/src/ipv6.c
U src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
C src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/02-dump
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

7 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



CVS import: src/external/bsd/dhcpcd/dist

2019-10-11 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Oct 11 11:01:23 UTC 2019

Update of /cvsroot/src/external/bsd/dhcpcd/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv19794

Log Message:
Import dhcpcd-8.1.0 with the following changes:

 * Fix carrier status after a route socket overflow
 * Allow domain spaced options
 * DHCP: Allow not sending Force Renew Nonce or Reconf Accept
 * IPv4LL: Now passes Apple Bonjour test versions 1.4 and 1.5
 * ARP: Fix a typo and remove pragma (thus working with old gcc)
 * DHCP6: Fix a cosmetic issue with infinite leases
 * DHCP6: SLA 0 and Prefix Len 0 will now add a delegatd /64 address
 * Ignore some virtual interfaces such as Tap and Bridge by default
 * BPF: Move validation logic out of BPF and back into dhcpcd 

Status:

Vendor Tag: ROY
Release Tags:   dhcpcd-8_1_0

U src/external/bsd/dhcpcd/dist/LICENSE
U src/external/bsd/dhcpcd/dist/README.md
U src/external/bsd/dhcpcd/dist/src/defs.h
U src/external/bsd/dhcpcd/dist/src/common.c
U src/external/bsd/dhcpcd/dist/src/control.c
C src/external/bsd/dhcpcd/dist/src/dhcpcd.c
U src/external/bsd/dhcpcd/dist/src/duid.c
U src/external/bsd/dhcpcd/dist/src/eloop.c
U src/external/bsd/dhcpcd/dist/src/logerr.c
U src/external/bsd/dhcpcd/dist/src/if.c
C src/external/bsd/dhcpcd/dist/src/if-options.c
U src/external/bsd/dhcpcd/dist/src/sa.c
U src/external/bsd/dhcpcd/dist/src/route.c
U src/external/bsd/dhcpcd/dist/src/dhcp-common.c
U src/external/bsd/dhcpcd/dist/src/script.c
U src/external/bsd/dhcpcd/dist/src/auth.c
C src/external/bsd/dhcpcd/dist/src/if-bsd.c
C src/external/bsd/dhcpcd/dist/src/dhcp.c
U src/external/bsd/dhcpcd/dist/src/ipv4.c
C src/external/bsd/dhcpcd/dist/src/bpf.c
U src/external/bsd/dhcpcd/dist/src/arp.c
U src/external/bsd/dhcpcd/dist/src/ipv4ll.c
U src/external/bsd/dhcpcd/dist/src/ipv6.c
U src/external/bsd/dhcpcd/dist/src/ipv6nd.c
C src/external/bsd/dhcpcd/dist/src/dhcp6.c
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.c
U src/external/bsd/dhcpcd/dist/src/common.h
U src/external/bsd/dhcpcd/dist/src/control.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.h
U src/external/bsd/dhcpcd/dist/src/duid.h
U src/external/bsd/dhcpcd/dist/src/eloop.h
U src/external/bsd/dhcpcd/dist/src/logerr.h
U src/external/bsd/dhcpcd/dist/src/if.h
U src/external/bsd/dhcpcd/dist/src/if-options.h
U src/external/bsd/dhcpcd/dist/src/sa.h
U src/external/bsd/dhcpcd/dist/src/route.h
U src/external/bsd/dhcpcd/dist/src/dhcp-common.h
U src/external/bsd/dhcpcd/dist/src/script.h
U src/external/bsd/dhcpcd/dist/src/auth.h
U src/external/bsd/dhcpcd/dist/src/dhcp.h
U src/external/bsd/dhcpcd/dist/src/ipv4.h
U src/external/bsd/dhcpcd/dist/src/bpf.h
U src/external/bsd/dhcpcd/dist/src/arp.h
U src/external/bsd/dhcpcd/dist/src/ipv4ll.h
U src/external/bsd/dhcpcd/dist/src/ipv6.h
U src/external/bsd/dhcpcd/dist/src/ipv6nd.h
U src/external/bsd/dhcpcd/dist/src/dhcp6.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd-embedded.h
U src/external/bsd/dhcpcd/dist/src/dev.h
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in
C src/external/bsd/dhcpcd/dist/src/dhcpcd.8.in
U src/external/bsd/dhcpcd/dist/src/dhcpcd.conf
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.in
U src/external/bsd/dhcpcd/dist/hooks/dhcpcd-run-hooks.8.in
U src/external/bsd/dhcpcd/dist/hooks/01-test
U src/external/bsd/dhcpcd/dist/hooks/02-dump
U src/external/bsd/dhcpcd/dist/hooks/10-wpa_supplicant
U src/external/bsd/dhcpcd/dist/hooks/15-timezone
U src/external/bsd/dhcpcd/dist/hooks/20-resolv.conf
U src/external/bsd/dhcpcd/dist/hooks/29-lookup-hostname
U src/external/bsd/dhcpcd/dist/hooks/30-hostname
U src/external/bsd/dhcpcd/dist/hooks/50-ntp.conf
U src/external/bsd/dhcpcd/dist/hooks/50-ypbind.in

7 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jROY:yesterday -jROY src/external/bsd/dhcpcd/dist



Re: Leak Sanitizer - how to suppress leaks

2019-09-15 Thread Roy Marples

On 15/09/2019 21:02, Marc Balmer wrote:

Doesn‘t exit clear all resources on posix systems?


Don't assume that exit would ever be called.
Code used in some RTOS, such as RTEMS, everything runs as a thread and 
thus cannot call exit.
In this case, at the natural programs exit, resources need to be cleaned 
up manually, as exit is the equivalent of shutdown.


Roy


Re: CVS import: src/external/bsd/openresolv/dist

2019-09-13 Thread Roy Marples

On 13/09/2019 13:18, Roy Marples wrote:
I've done this for dhcpcd. openresolv doesn't get many releases so I 
might re-import it soon to trim.


I've totally done this.

Roy


CVS commit: src/external/bsd/dhcpcd

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 13:39:13 UTC 2019

Modified Files:
src/external/bsd/dhcpcd: NetBSD-upgrade

Log Message:
wpa -> dhcpcd


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/dhcpcd/NetBSD-upgrade

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

Modified files:

Index: src/external/bsd/dhcpcd/NetBSD-upgrade
diff -u src/external/bsd/dhcpcd/NetBSD-upgrade:1.1 src/external/bsd/dhcpcd/NetBSD-upgrade:1.2
--- src/external/bsd/dhcpcd/NetBSD-upgrade:1.1	Fri Sep 13 12:13:18 2019
+++ src/external/bsd/dhcpcd/NetBSD-upgrade	Fri Sep 13 13:39:13 2019
@@ -1,4 +1,4 @@
-$NetBSD: NetBSD-upgrade,v 1.1 2019/09/13 12:13:18 roy Exp $
+$NetBSD: NetBSD-upgrade,v 1.2 2019/09/13 13:39:13 roy Exp $
 
 dhcpcd releases can be found at https://roy.marples.name/downloads/dhcpcd/
 
@@ -8,9 +8,9 @@ For the import there is a handy autoamat
 	./configure
 	make import-src
 	cd /tmp/dhcpcd-X.Y.Z
-	cvs import src/external/bsd/wpa/dist ROY dhcpcd-X-Y-Z
+	cvs import src/external/bsd/dhcpcd/dist ROY dhcpcd-X_Y_Z
 
-To make local changes to wpa, simply patch and commit
+To make local changes to dhcpcd, simply patch and commit
 to the main branch (aka HEAD).  Never make local changes on the
 vendor (ROY) branch.
 



CVS commit: src/external/bsd/dhcpcd

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 13:39:13 UTC 2019

Modified Files:
src/external/bsd/dhcpcd: NetBSD-upgrade

Log Message:
wpa -> dhcpcd


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/dhcpcd/NetBSD-upgrade

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



CVS commit: src/external/bsd/openresolv

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 13:38:27 UTC 2019

Added Files:
src/external/bsd/openresolv: NetBSD-upgrade

Log Message:
Add an upgrading note


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/openresolv/NetBSD-upgrade

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

Added files:

Index: src/external/bsd/openresolv/NetBSD-upgrade
diff -u /dev/null src/external/bsd/openresolv/NetBSD-upgrade:1.1
--- /dev/null	Fri Sep 13 13:38:27 2019
+++ src/external/bsd/openresolv/NetBSD-upgrade	Fri Sep 13 13:38:27 2019
@@ -0,0 +1,19 @@
+$NetBSD: NetBSD-upgrade,v 1.1 2019/09/13 13:38:27 roy Exp $
+
+openresolv releases can be found at:
+	https://roy.marples.name/downloads/openresolv/
+
+For the import there is a handy autoamated approach
+	tar -xf openresolv-X.Y.Z.tar.xz
+	cd openresolv-X.Y.Z
+	./configure
+	make import-src
+	cd /tmp/openresolv-X.Y.Z
+	cvs import src/external/bsd/openresolv/dist ROY openresolv-X_Y_Z
+
+To make local changes to openresolv, simply patch and commit
+to the main branch (aka HEAD).  Never make local changes on the
+vendor (ROY) branch.
+
+All local changes should be submitted to Roy Marples for inclusion in
+the next vendor release.



CVS commit: src/external/bsd/openresolv

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 13:38:27 UTC 2019

Added Files:
src/external/bsd/openresolv: NetBSD-upgrade

Log Message:
Add an upgrading note


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/openresolv/NetBSD-upgrade

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



CVS commit: src/external/bsd/openresolv/dist

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 13:35:06 UTC 2019

Removed Files:
src/external/bsd/openresolv/dist: .gitignore GNUmakefile Makefile
config-null.mk configure

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r0 src/external/bsd/openresolv/dist/.gitignore \
src/external/bsd/openresolv/dist/configure
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/openresolv/dist/GNUmakefile \
src/external/bsd/openresolv/dist/config-null.mk
cvs rdiff -u -r1.3 -r0 src/external/bsd/openresolv/dist/Makefile

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



CVS commit: src/external/bsd/openresolv/dist

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 13:35:06 UTC 2019

Removed Files:
src/external/bsd/openresolv/dist: .gitignore GNUmakefile Makefile
config-null.mk configure

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r0 src/external/bsd/openresolv/dist/.gitignore \
src/external/bsd/openresolv/dist/configure
cvs rdiff -u -r1.1.1.1 -r0 src/external/bsd/openresolv/dist/GNUmakefile \
src/external/bsd/openresolv/dist/config-null.mk
cvs rdiff -u -r1.3 -r0 src/external/bsd/openresolv/dist/Makefile

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



CVS import: src/external/bsd/openresolv/dist

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 13:33:34 UTC 2019

Update of /cvsroot/src/external/bsd/openresolv/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv28106

Log Message:
Reimport openresolv-3.9.2 using import-src target to remove build glue

Status:

Vendor Tag: ROY
Release Tags:   openresolv-3_9_2a

U src/external/bsd/openresolv/dist/LICENSE
U src/external/bsd/openresolv/dist/README.md
U src/external/bsd/openresolv/dist/resolvconf.in
U src/external/bsd/openresolv/dist/resolvconf.8.in
U src/external/bsd/openresolv/dist/resolvconf.conf.5.in
U src/external/bsd/openresolv/dist/libc.in
U src/external/bsd/openresolv/dist/dnsmasq.in
U src/external/bsd/openresolv/dist/named.in
U src/external/bsd/openresolv/dist/pdnsd.in
U src/external/bsd/openresolv/dist/pdns_recursor.in
U src/external/bsd/openresolv/dist/unbound.in
U src/external/bsd/openresolv/dist/resolvconf.conf

No conflicts created by this import



CVS import: src/external/bsd/openresolv/dist

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 13:33:34 UTC 2019

Update of /cvsroot/src/external/bsd/openresolv/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv28106

Log Message:
Reimport openresolv-3.9.2 using import-src target to remove build glue

Status:

Vendor Tag: ROY
Release Tags:   openresolv-3_9_2a

U src/external/bsd/openresolv/dist/LICENSE
U src/external/bsd/openresolv/dist/README.md
U src/external/bsd/openresolv/dist/resolvconf.in
U src/external/bsd/openresolv/dist/resolvconf.8.in
U src/external/bsd/openresolv/dist/resolvconf.conf.5.in
U src/external/bsd/openresolv/dist/libc.in
U src/external/bsd/openresolv/dist/dnsmasq.in
U src/external/bsd/openresolv/dist/named.in
U src/external/bsd/openresolv/dist/pdnsd.in
U src/external/bsd/openresolv/dist/pdns_recursor.in
U src/external/bsd/openresolv/dist/unbound.in
U src/external/bsd/openresolv/dist/resolvconf.conf

No conflicts created by this import



Re: CVS import: src/external/bsd/openresolv/dist

2019-09-13 Thread Roy Marples

On 11/09/2019 16:43, Kamil Rytarowski wrote:

On 08.09.2019 22:46, Roy Marples wrote:

Module Name:src
Committed By:   roy
Date:   Sun Sep  8 20:46:17 UTC 2019

Update of /cvsroot/src/external/bsd/openresolv/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv12058

Log Message:
Import openresolv-3.9.2 with the following changes:
   *  dnsmasq: clear cache after updating servers via dbus
   *  pdns_recursor: Fix global forwards (thus now installed by default)
   *  man: layout and misc fixes

Status:

Vendor Tag: roy
Release Tags:   openresolv-3-9-2

U src/external/bsd/openresolv/dist/.gitignore



Could we please drop .gitignore from the import? And if possible add a
generic rule on the
CVS server to stop tacking .gitingore.


I used to have a special import target which trimmed the source to what 
was needed and added RCSID tags  but it was unreliable.

After I saw others just do full source imports, IO went the same way.

But now I've added a new import-src target which hopefully does a much 
better job now of just importing what's needed. I've also added upgrade 
instructions explaining this.


I've done this for dhcpcd. openresolv doesn't get many releases so I 
might re-import it soon to trim.


Roy


CVS commit: src/external/bsd/dhcpcd

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 12:13:18 UTC 2019

Added Files:
src/external/bsd/dhcpcd: NetBSD-upgrade

Log Message:
Add a note about how to import now.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcpcd/NetBSD-upgrade

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

Added files:

Index: src/external/bsd/dhcpcd/NetBSD-upgrade
diff -u /dev/null src/external/bsd/dhcpcd/NetBSD-upgrade:1.1
--- /dev/null	Fri Sep 13 12:13:18 2019
+++ src/external/bsd/dhcpcd/NetBSD-upgrade	Fri Sep 13 12:13:18 2019
@@ -0,0 +1,18 @@
+$NetBSD: NetBSD-upgrade,v 1.1 2019/09/13 12:13:18 roy Exp $
+
+dhcpcd releases can be found at https://roy.marples.name/downloads/dhcpcd/
+
+For the import there is a handy autoamated approach
+	tar -xf dhcpcd-X.Y.Z.tar.xz
+	cd dhcpcd-X.Y.Z
+	./configure
+	make import-src
+	cd /tmp/dhcpcd-X.Y.Z
+	cvs import src/external/bsd/wpa/dist ROY dhcpcd-X-Y-Z
+
+To make local changes to wpa, simply patch and commit
+to the main branch (aka HEAD).  Never make local changes on the
+vendor (ROY) branch.
+
+All local changes should be submitted to Roy Marples for inclusion in
+the next vendor release.



CVS commit: src/external/bsd/dhcpcd

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 12:13:18 UTC 2019

Added Files:
src/external/bsd/dhcpcd: NetBSD-upgrade

Log Message:
Add a note about how to import now.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/dhcpcd/NetBSD-upgrade

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



CVS commit: src/doc

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 12:00:10 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note new dhcpcd import.


To generate a diff of this commit:
cvs rdiff -u -r1.1647 -r1.1648 src/doc/3RDPARTY
cvs rdiff -u -r1.2581 -r1.2582 src/doc/CHANGES

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



CVS commit: src/doc

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 12:00:10 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note new dhcpcd import.


To generate a diff of this commit:
cvs rdiff -u -r1.1647 -r1.1648 src/doc/3RDPARTY
cvs rdiff -u -r1.2581 -r1.2582 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1647 src/doc/3RDPARTY:1.1648
--- src/doc/3RDPARTY:1.1647	Sun Sep  8 20:57:16 2019
+++ src/doc/3RDPARTY	Fri Sep 13 12:00:10 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1647 2019/09/08 20:57:16 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1648 2019/09/13 12:00:10 roy Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -341,12 +341,12 @@ Notes:
 Use the dhcp2netbsd script.
 
 Package:	dhcpcd
-Version:	8.0.4
-Current Vers:	8.0.4
+Version:	8.0.6
+Current Vers:	8.0.6
 Maintainer:	roy
 Archive Site:	ftp://roy.marples.name/pub/dhcpcd/
 Home Page:	http://roy.marples.name/projects/dhcpcd/
-Date:		2019-09-04
+Date:		2019-09-13
 Mailing List: 	dhcpcd-disc...@marples.name
 License:	BSD (2-clause)
 Location:	external/bsd/dhcpcd/dist

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2581 src/doc/CHANGES:1.2582
--- src/doc/CHANGES:1.2581	Fri Sep 13 02:23:31 2019
+++ src/doc/CHANGES	Fri Sep 13 12:00:10 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2581 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2582 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -40,3 +40,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	bind: Import version 9.14.5. [christos 20190905]
 	resolvconf(8): Import openresolv-3.9.2 [roy 20190908]
 	boot(8): multiboot 2 support, Xen can now boot from EFI [manu 20190913]
+	dhcpcd(8): Import dhcpcd-8.0.6 [roy 20190913]



CVS commit: src/external/bsd/dhcpcd/sbin/dhcpcd

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 11:58:32 UTC 2019

Modified Files:
src/external/bsd/dhcpcd/sbin/dhcpcd: Makefile

Log Message:
No longer any need to build the dhcpcd embedded configuration files


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile

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



CVS commit: src/external/bsd/dhcpcd/sbin/dhcpcd

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 11:58:32 UTC 2019

Modified Files:
src/external/bsd/dhcpcd/sbin/dhcpcd: Makefile

Log Message:
No longer any need to build the dhcpcd embedded configuration files


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile

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

Modified files:

Index: src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile
diff -u src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.48 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.49
--- src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile:1.48	Fri Jul 26 10:49:06 2019
+++ src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile	Fri Sep 13 11:58:32 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.48 2019/07/26 10:49:06 roy Exp $
+# $NetBSD: Makefile,v 1.49 2019/09/13 11:58:32 roy Exp $
 #
 
 WARNS?=		6
@@ -13,18 +13,13 @@ SRCS+=		if.c if-options.c route.c sa.c s
 SRCS+=		dhcp-common.c dhcpcd-embedded.c
 SRCS+=		if-bsd.c
 
-# Need to generate this for dependencies
-DPSRCS+=	dhcpcd-embedded.h dhcpcd-embedded.c
-
 CPPFLAGS+=	-DHAVE_CONFIG_H -D_OPENBSD_SOURCE
 
 USE_INET?=	yes
 
 .if defined(SMALLPROG)
 CPPFLAGS+=	-DSMALL
-DHCPCD_DEFS=	dhcpcd-definitions-small.conf
 .else
-DHCPCD_DEFS=	dhcpcd-definitions.conf
 CPPFLAGS+=	-DAUTH
 SRCS+=		auth.c
 .endif
@@ -50,7 +45,7 @@ CPPFLAGS+=	-DDHCP6
 SRCS+=		dhcp6.c
 .endif
 
-CPPFLAGS+=	-I${SRCDIR}/include -I${DIST}/src -I${.OBJDIR}
+CPPFLAGS+=	-I${SRCDIR}/include -I${DIST}/src
 
 DPADD+=		${LIBUTIL}
 LDADD+=		-lutil
@@ -64,14 +59,6 @@ FILESMODE_dhcpcd.conf=		644	# -rw-r--r--
 MAN=			dhcpcd.conf.5 dhcpcd.8 
 CLEANFILES=		dhcpcd.conf.5 dhcpcd.8 
 
-dhcpcd-embedded.h:	genembedh ${DHCPCD_DEFS} dhcpcd-embedded.h.in
-	${HOST_SH} ${.ALLSRC} $^ > $@
-
-dhcpcd-embedded.c:	genembedc ${DHCPCD_DEFS} dhcpcd-embedded.c.in
-	${HOST_SH} ${.ALLSRC} $^ > $@
-
-CLEANFILES+=		dhcpcd-embedded.c dhcpcd-embedded.h
-
 .for f in dhcpcd.conf.5 dhcpcd.8
 ${f}:	${f}.in
 	${TOOL_SED} ${SED_SYS} ${DIST}/src/${f}.in > $@



CVS commit: src/external/bsd/dhcpcd/dist/src

2019-09-13 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Sep 13 11:54:03 UTC 2019

Modified Files:
src/external/bsd/dhcpcd/dist/src: dhcp.c

Log Message:
Sync


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/external/bsd/dhcpcd/dist/src/dhcp.c

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

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/dhcp.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp.c:1.26 src/external/bsd/dhcpcd/dist/src/dhcp.c:1.27
--- src/external/bsd/dhcpcd/dist/src/dhcp.c:1.26	Fri Sep 13 11:01:50 2019
+++ src/external/bsd/dhcpcd/dist/src/dhcp.c	Fri Sep 13 11:54:03 2019
@@ -3264,7 +3264,13 @@ valid_udp_packet(void *packet, size_t pl
 	if (from != NULL)
 		from->s_addr = ip->ip_src.s_addr;
 
+	/* Check we have the IP header */
 	ip_hlen = (size_t)ip->ip_hl * 4;
+	if (ip_hlen > plen) {
+		errno = ENOBUFS;
+		return -1;
+	}
+
 	if (in_cksum(ip, ip_hlen, NULL) != 0) {
 		errno = EINVAL;
 		return -1;



  1   2   3   4   >