Re: dhcpcd fix for netinet6/nd6.h r1.72

2017-08-10 Thread Stuart Henderson
On 2017/08/10 08:36, Florian Obser wrote:
> On Wed, Aug 09, 2017 at 09:34:58PM +0100, Stuart Henderson wrote:
> > On 2017/08/09 13:07, Jeremie Courreges-Anglas wrote:
> > > On Wed, Aug 09 2017, Florian Obser  wrote:
> > > > I just noticed that dhcpcd looks at flags in struct nd_ifinfo which I
> > > > removed in r1.72, this fixes the build.
> > > > Sorry about that.
> > > >
> > > > OK?
> > > 
> > > ok, but:
> > > - you may want sthen@ to take a look (maintainer)
> > > - please bump REVISION, 'cause in _if_checkipv6 this code would trigger
> > >   using an old package:
> > 
> > +1
> > 
> > Would you mind sending it upstream too? https://dev.marples.name/ is
> > probably the best option.
> 
> I was going to, that's why I came up with that particular diff, it looked
> like it could be fed upstream.
> Now I looked and version 7 currently in development / beta shuffled quite
> a lot of code around and I'm in some ifdef hell :( not sure if I can make
> this work.
> 
> If it were more than one port I would even consider bringing the flags
> member back and always have it 0.

Here's the ports diff for 7.0.0-rc1 with ifdefs in what I think are the
right place for this (it still works ok in my setup, but it's just a very
simple pppoe DHCPv6-PD config).

I'm grepping for other uses of ndi now (I think we should probably bump
REVISION on anything that uses it anyway due to the struct change).

Index: Makefile
===
RCS file: /cvs/ports/net/dhcpcd/Makefile,v
retrieving revision 1.24
diff -u -p -r1.24 Makefile
--- Makefile10 Aug 2017 06:58:39 -  1.24
+++ Makefile10 Aug 2017 09:06:44 -
@@ -1,9 +1,9 @@
-# $OpenBSD: Makefile,v 1.24 2017/08/10 06:58:39 florian Exp $
+# $OpenBSD: Makefile,v 1.22 2017/04/21 16:41:20 sthen Exp $
 
 COMMENT=   DHCPv4/IPv4LL/IPv6RS/DHCPv6 quad stack client
 
-DISTNAME=  dhcpcd-6.11.5
-REVISION=  2
+DISTNAME=  dhcpcd-7.0.0-rc1
+PKGNAME=   ${DISTNAME:S/-rc/rc/}
 
 CATEGORIES=net
 EXTRACT_SUFX=  .tar.xz
Index: distinfo
===
RCS file: /cvs/ports/net/dhcpcd/distinfo,v
retrieving revision 1.14
diff -u -p -r1.14 distinfo
--- distinfo11 Oct 2016 13:56:02 -  1.14
+++ distinfo10 Aug 2017 09:06:44 -
@@ -1,2 +1,2 @@
-SHA256 (dhcpcd-6.11.5.tar.xz) = b5Z03H4n6TbMeHF1QEphcWGGdez7aQOrmIextmqH1p4=
-SIZE (dhcpcd-6.11.5.tar.xz) = 198080
+SHA256 (dhcpcd-7.0.0-rc1.tar.xz) = jUE0WW8cimR9lCkf6g7W852tZIpIIkcrSB3+SEB7HNM=
+SIZE (dhcpcd-7.0.0-rc1.tar.xz) = 204496
Index: patches/patch-dhcpcd_conf
===
RCS file: patches/patch-dhcpcd_conf
diff -N patches/patch-dhcpcd_conf
--- patches/patch-dhcpcd_conf   8 Sep 2015 19:10:19 -   1.3
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,15 +0,0 @@
-$OpenBSD: patch-dhcpcd_conf,v 1.3 2015/09/08 19:10:19 sthen Exp $
-
-Disable NTP by default.
-
 dhcpcd.conf.orig   Fri Sep  4 13:41:18 2015
-+++ dhcpcd.confTue Sep  8 21:04:20 2015
-@@ -27,7 +27,7 @@ option rapid_commit
- option domain_name_servers, domain_name, domain_search, host_name
- option classless_static_routes
- # Most distributions have NTP support.
--option ntp_servers
-+#option ntp_servers
- # Respect the network MTU. This is applied to DHCP routes.
- option interface_mtu
- 
Index: patches/patch-if-bsd_c
===
RCS file: patches/patch-if-bsd_c
diff -N patches/patch-if-bsd_c
--- patches/patch-if-bsd_c  10 Aug 2017 06:58:39 -  1.2
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,35 +0,0 @@
-$OpenBSD: patch-if-bsd_c,v 1.2 2017/08/10 06:58:39 florian Exp $
-
-Workaround for our old broken behaviour no longer needed.
-Fixed with netinet6/in6.c r1.202.
-
-netinet6/nd6.h r1.72 removed ND6_IFF_PERFORMNUD
-
-Index: if-bsd.c
 if-bsd.c.orig
-+++ if-bsd.c
-@@ -985,7 +985,7 @@ if_address6(unsigned char cmd, const struct ipv6_addr 
-   }
- #endif
- 
--#if defined(__OpenBSD__)
-+#if 0
-   /* BUT OpenBSD does not reset the address lifetime
-* for subsequent calls...
-* Luckily dhcpcd will remove the lease when it expires so
-@@ -1688,6 +1688,7 @@ ip6_temp_valid_lifetime(__unused const char *ifname)
- }
- #endif
- 
-+#if defined(ND6_IFF_AUTO_LINKLOCAL) || defined(ND6_IFF_PERFORMNUD) || 
defined(ND6_IFF_ACCEPT_RTADV) || defined(ND6_IFF_IFDISABLED)
- #define del_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), (flag), -1)
- #define get_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), (flag),  0)
- #define set_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), (flag),  1)
-@@ -1713,6 +1714,7 @@ if_nd6_flag(int s, const struct interface *ifp, unsign
-   return 0;
-   return ioctl(s, SIOCSIFINFO_FLAGS, );
- }
-+#endif
- 
- static int
- if_raflush(int s)
Index: 

Re: dhcpcd fix for netinet6/nd6.h r1.72

2017-08-10 Thread Florian Obser
On Thu, Aug 10, 2017 at 08:36:01AM +, Florian Obser wrote:
> On Wed, Aug 09, 2017 at 09:34:58PM +0100, Stuart Henderson wrote:
> > On 2017/08/09 13:07, Jeremie Courreges-Anglas wrote:
> > > On Wed, Aug 09 2017, Florian Obser  wrote:
> > > > I just noticed that dhcpcd looks at flags in struct nd_ifinfo which I
> > > > removed in r1.72, this fixes the build.
> > > > Sorry about that.
> > > >
> > > > OK?
> > > 
> > > ok, but:
> > > - you may want sthen@ to take a look (maintainer)
> > > - please bump REVISION, 'cause in _if_checkipv6 this code would trigger
> > >   using an old package:
> > 
> > +1
> > 
> > Would you mind sending it upstream too? https://dev.marples.name/ is
> > probably the best option.
> 
> I was going to, that's why I came up with that particular diff, it looked
> like it could be fed upstream.
> Now I looked and version 7 currently in development / beta shuffled quite
> a lot of code around and I'm in some ifdef hell :( not sure if I can make
> this work.
> 
> If it were more than one port I would even consider bringing the flags
> member back and always have it 0.

https://dev.marples.name/T132

> 
> >  
> > > #ifdef ND6_IFF_PERFORMNUD
> > >   if (set_if_nd6_flag(s, ifp, ND6_IFF_PERFORMNUD) == -1) {
> > >   logger(ifp->ctx, LOG_ERR,
> > >   "%s: set_if_nd6_flag: ND6_IFF_PERFORMNUD: %m",
> > >   ifp->name);
> > >   return -1;
> > >   }
> > > #endif
> > > 
> > > 
> > > > diff --git net/dhcpcd/patches/patch-if-bsd_c 
> > > > net/dhcpcd/patches/patch-if-bsd_c
> > > > index 0046ef8ca11..0b2ed02e562 100644
> > > > --- net/dhcpcd/patches/patch-if-bsd_c
> > > > +++ net/dhcpcd/patches/patch-if-bsd_c
> > > > @@ -3,8 +3,11 @@ $OpenBSD: patch-if-bsd_c,v 1.1 2017/04/21 16:41:20 
> > > > sthen Exp $
> > > >  Workaround for our old broken behaviour no longer needed.
> > > >  Fixed with netinet6/in6.c r1.202.
> > > >  
> > > >  if-bsd.c.orig  Fri Apr 21 13:38:38 2017
> > > > -+++ if-bsd.c   Fri Apr 21 13:39:38 2017
> > > > +netinet6/nd6.h r1.72 removed ND6_IFF_PERFORMNUD
> > > > +
> > > > +Index: if-bsd.c
> > > > +--- if-bsd.c.orig
> > > >  if-bsd.c
> > > >  @@ -985,7 +985,7 @@ if_address6(unsigned char cmd, const struct 
> > > > ipv6_addr 
> > > > }
> > > >   #endif
> > > > @@ -14,3 +17,19 @@ Fixed with netinet6/in6.c r1.202.
> > > > /* BUT OpenBSD does not reset the address lifetime
> > > >  * for subsequent calls...
> > > >  * Luckily dhcpcd will remove the lease when it expires so
> > > > +@@ -1688,6 +1688,7 @@ ip6_temp_valid_lifetime(__unused const char 
> > > > *ifname)
> > > > + }
> > > > + #endif
> > > > + 
> > > > ++#if defined(ND6_IFF_AUTO_LINKLOCAL) || defined(ND6_IFF_PERFORMNUD) || 
> > > > defined(ND6_IFF_ACCEPT_RTADV) || defined(ND6_IFF_IFDISABLED)
> > > > + #define del_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), 
> > > > (flag), -1)
> > > > + #define get_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), 
> > > > (flag),  0)
> > > > + #define set_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), 
> > > > (flag),  1)
> > > > +@@ -1713,6 +1714,7 @@ if_nd6_flag(int s, const struct interface *ifp, 
> > > > unsign
> > > > +   return 0;
> > > > +   return ioctl(s, SIOCSIFINFO_FLAGS, );
> > > > + }
> > > > ++#endif
> > > > + 
> > > > + static int
> > > > + if_raflush(int s)
> > > 
> > > -- 
> > > jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 
> > > E7EE
> > > 
> > 
> 
> -- 
> I'm not entirely sure you are real.
> 

-- 
I'm not entirely sure you are real.



Re: dhcpcd fix for netinet6/nd6.h r1.72

2017-08-10 Thread Florian Obser
On Wed, Aug 09, 2017 at 09:34:58PM +0100, Stuart Henderson wrote:
> On 2017/08/09 13:07, Jeremie Courreges-Anglas wrote:
> > On Wed, Aug 09 2017, Florian Obser  wrote:
> > > I just noticed that dhcpcd looks at flags in struct nd_ifinfo which I
> > > removed in r1.72, this fixes the build.
> > > Sorry about that.
> > >
> > > OK?
> > 
> > ok, but:
> > - you may want sthen@ to take a look (maintainer)
> > - please bump REVISION, 'cause in _if_checkipv6 this code would trigger
> >   using an old package:
> 
> +1
> 
> Would you mind sending it upstream too? https://dev.marples.name/ is
> probably the best option.

I was going to, that's why I came up with that particular diff, it looked
like it could be fed upstream.
Now I looked and version 7 currently in development / beta shuffled quite
a lot of code around and I'm in some ifdef hell :( not sure if I can make
this work.

If it were more than one port I would even consider bringing the flags
member back and always have it 0.

>  
> > #ifdef ND6_IFF_PERFORMNUD
> > if (set_if_nd6_flag(s, ifp, ND6_IFF_PERFORMNUD) == -1) {
> > logger(ifp->ctx, LOG_ERR,
> > "%s: set_if_nd6_flag: ND6_IFF_PERFORMNUD: %m",
> > ifp->name);
> > return -1;
> > }
> > #endif
> > 
> > 
> > > diff --git net/dhcpcd/patches/patch-if-bsd_c 
> > > net/dhcpcd/patches/patch-if-bsd_c
> > > index 0046ef8ca11..0b2ed02e562 100644
> > > --- net/dhcpcd/patches/patch-if-bsd_c
> > > +++ net/dhcpcd/patches/patch-if-bsd_c
> > > @@ -3,8 +3,11 @@ $OpenBSD: patch-if-bsd_c,v 1.1 2017/04/21 16:41:20 sthen 
> > > Exp $
> > >  Workaround for our old broken behaviour no longer needed.
> > >  Fixed with netinet6/in6.c r1.202.
> > >  
> > >  if-bsd.c.origFri Apr 21 13:38:38 2017
> > > -+++ if-bsd.c Fri Apr 21 13:39:38 2017
> > > +netinet6/nd6.h r1.72 removed ND6_IFF_PERFORMNUD
> > > +
> > > +Index: if-bsd.c
> > > +--- if-bsd.c.orig
> > >  if-bsd.c
> > >  @@ -985,7 +985,7 @@ if_address6(unsigned char cmd, const struct 
> > > ipv6_addr 
> > >   }
> > >   #endif
> > > @@ -14,3 +17,19 @@ Fixed with netinet6/in6.c r1.202.
> > >   /* BUT OpenBSD does not reset the address lifetime
> > >* for subsequent calls...
> > >* Luckily dhcpcd will remove the lease when it expires so
> > > +@@ -1688,6 +1688,7 @@ ip6_temp_valid_lifetime(__unused const char 
> > > *ifname)
> > > + }
> > > + #endif
> > > + 
> > > ++#if defined(ND6_IFF_AUTO_LINKLOCAL) || defined(ND6_IFF_PERFORMNUD) || 
> > > defined(ND6_IFF_ACCEPT_RTADV) || defined(ND6_IFF_IFDISABLED)
> > > + #define del_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), 
> > > (flag), -1)
> > > + #define get_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), 
> > > (flag),  0)
> > > + #define set_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), 
> > > (flag),  1)
> > > +@@ -1713,6 +1714,7 @@ if_nd6_flag(int s, const struct interface *ifp, 
> > > unsign
> > > + return 0;
> > > + return ioctl(s, SIOCSIFINFO_FLAGS, );
> > > + }
> > > ++#endif
> > > + 
> > > + static int
> > > + if_raflush(int s)
> > 
> > -- 
> > jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE
> > 
> 

-- 
I'm not entirely sure you are real.



Re: dhcpcd fix for netinet6/nd6.h r1.72

2017-08-09 Thread Stuart Henderson
On 2017/08/09 13:07, Jeremie Courreges-Anglas wrote:
> On Wed, Aug 09 2017, Florian Obser  wrote:
> > I just noticed that dhcpcd looks at flags in struct nd_ifinfo which I
> > removed in r1.72, this fixes the build.
> > Sorry about that.
> >
> > OK?
> 
> ok, but:
> - you may want sthen@ to take a look (maintainer)
> - please bump REVISION, 'cause in _if_checkipv6 this code would trigger
>   using an old package:

+1

Would you mind sending it upstream too? https://dev.marples.name/ is
probably the best option.
 
> #ifdef ND6_IFF_PERFORMNUD
>   if (set_if_nd6_flag(s, ifp, ND6_IFF_PERFORMNUD) == -1) {
>   logger(ifp->ctx, LOG_ERR,
>   "%s: set_if_nd6_flag: ND6_IFF_PERFORMNUD: %m",
>   ifp->name);
>   return -1;
>   }
> #endif
> 
> 
> > diff --git net/dhcpcd/patches/patch-if-bsd_c 
> > net/dhcpcd/patches/patch-if-bsd_c
> > index 0046ef8ca11..0b2ed02e562 100644
> > --- net/dhcpcd/patches/patch-if-bsd_c
> > +++ net/dhcpcd/patches/patch-if-bsd_c
> > @@ -3,8 +3,11 @@ $OpenBSD: patch-if-bsd_c,v 1.1 2017/04/21 16:41:20 sthen 
> > Exp $
> >  Workaround for our old broken behaviour no longer needed.
> >  Fixed with netinet6/in6.c r1.202.
> >  
> >  if-bsd.c.orig  Fri Apr 21 13:38:38 2017
> > -+++ if-bsd.c   Fri Apr 21 13:39:38 2017
> > +netinet6/nd6.h r1.72 removed ND6_IFF_PERFORMNUD
> > +
> > +Index: if-bsd.c
> > +--- if-bsd.c.orig
> >  if-bsd.c
> >  @@ -985,7 +985,7 @@ if_address6(unsigned char cmd, const struct ipv6_addr 
> > }
> >   #endif
> > @@ -14,3 +17,19 @@ Fixed with netinet6/in6.c r1.202.
> > /* BUT OpenBSD does not reset the address lifetime
> >  * for subsequent calls...
> >  * Luckily dhcpcd will remove the lease when it expires so
> > +@@ -1688,6 +1688,7 @@ ip6_temp_valid_lifetime(__unused const char *ifname)
> > + }
> > + #endif
> > + 
> > ++#if defined(ND6_IFF_AUTO_LINKLOCAL) || defined(ND6_IFF_PERFORMNUD) || 
> > defined(ND6_IFF_ACCEPT_RTADV) || defined(ND6_IFF_IFDISABLED)
> > + #define del_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), (flag), 
> > -1)
> > + #define get_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), (flag),  
> > 0)
> > + #define set_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), (flag),  
> > 1)
> > +@@ -1713,6 +1714,7 @@ if_nd6_flag(int s, const struct interface *ifp, 
> > unsign
> > +   return 0;
> > +   return ioctl(s, SIOCSIFINFO_FLAGS, );
> > + }
> > ++#endif
> > + 
> > + static int
> > + if_raflush(int s)
> 
> -- 
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE
> 



Re: dhcpcd fix for netinet6/nd6.h r1.72

2017-08-09 Thread Jeremie Courreges-Anglas
On Wed, Aug 09 2017, Florian Obser  wrote:
> I just noticed that dhcpcd looks at flags in struct nd_ifinfo which I
> removed in r1.72, this fixes the build.
> Sorry about that.
>
> OK?

ok, but:
- you may want sthen@ to take a look (maintainer)
- please bump REVISION, 'cause in _if_checkipv6 this code would trigger
  using an old package:

#ifdef ND6_IFF_PERFORMNUD
if (set_if_nd6_flag(s, ifp, ND6_IFF_PERFORMNUD) == -1) {
logger(ifp->ctx, LOG_ERR,
"%s: set_if_nd6_flag: ND6_IFF_PERFORMNUD: %m",
ifp->name);
return -1;
}
#endif


> diff --git net/dhcpcd/patches/patch-if-bsd_c net/dhcpcd/patches/patch-if-bsd_c
> index 0046ef8ca11..0b2ed02e562 100644
> --- net/dhcpcd/patches/patch-if-bsd_c
> +++ net/dhcpcd/patches/patch-if-bsd_c
> @@ -3,8 +3,11 @@ $OpenBSD: patch-if-bsd_c,v 1.1 2017/04/21 16:41:20 sthen Exp 
> $
>  Workaround for our old broken behaviour no longer needed.
>  Fixed with netinet6/in6.c r1.202.
>  
>  if-bsd.c.origFri Apr 21 13:38:38 2017
> -+++ if-bsd.c Fri Apr 21 13:39:38 2017
> +netinet6/nd6.h r1.72 removed ND6_IFF_PERFORMNUD
> +
> +Index: if-bsd.c
> +--- if-bsd.c.orig
>  if-bsd.c
>  @@ -985,7 +985,7 @@ if_address6(unsigned char cmd, const struct ipv6_addr 
>   }
>   #endif
> @@ -14,3 +17,19 @@ Fixed with netinet6/in6.c r1.202.
>   /* BUT OpenBSD does not reset the address lifetime
>* for subsequent calls...
>* Luckily dhcpcd will remove the lease when it expires so
> +@@ -1688,6 +1688,7 @@ ip6_temp_valid_lifetime(__unused const char *ifname)
> + }
> + #endif
> + 
> ++#if defined(ND6_IFF_AUTO_LINKLOCAL) || defined(ND6_IFF_PERFORMNUD) || 
> defined(ND6_IFF_ACCEPT_RTADV) || defined(ND6_IFF_IFDISABLED)
> + #define del_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), (flag), -1)
> + #define get_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), (flag),  0)
> + #define set_if_nd6_flag(s, ifname, flag) if_nd6_flag((s), (ifp), (flag),  1)
> +@@ -1713,6 +1714,7 @@ if_nd6_flag(int s, const struct interface *ifp, unsign
> + return 0;
> + return ioctl(s, SIOCSIFINFO_FLAGS, );
> + }
> ++#endif
> + 
> + static int
> + if_raflush(int s)

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE