sys/malloc.h in sys/dev/usb

2017-01-08 Thread Michael W. Bombardieri
Hi,

Some usb drivers don't appear to need malloc().
I recently found this for umidi_quirks.c and decided to look further.
The patch was built on i386.

- Michael


Index: if_urtw.c
===
RCS file: /cvs/src/sys/dev/usb/if_urtw.c,v
retrieving revision 1.62
diff -u -p -u -r1.62 if_urtw.c
--- if_urtw.c   13 Apr 2016 11:03:37 -  1.62
+++ if_urtw.c   9 Jan 2017 04:38:49 -
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
Index: ugold.c
===
RCS file: /cvs/src/sys/dev/usb/ugold.c,v
retrieving revision 1.12
diff -u -p -u -r1.12 ugold.c
--- ugold.c 9 Jan 2016 04:14:42 -   1.12
+++ ugold.c 9 Jan 2017 04:38:54 -
@@ -26,7 +26,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
Index: umass.c
===
RCS file: /cvs/src/sys/dev/usb/umass.c,v
retrieving revision 1.73
diff -u -p -u -r1.73 umass.c
--- umass.c 3 Aug 2016 13:44:49 -   1.73
+++ umass.c 9 Jan 2017 04:39:14 -
@@ -130,7 +130,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #undef KASSERT
 #define KASSERT(cond, msg)
Index: uoak_subr.c
===
RCS file: /cvs/src/sys/dev/usb/uoak_subr.c,v
retrieving revision 1.7
diff -u -p -u -r1.7 uoak_subr.c
--- uoak_subr.c 25 May 2015 12:53:12 -  1.7
+++ uoak_subr.c 9 Jan 2017 04:39:14 -
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
Index: usbdi_util.c
===
RCS file: /cvs/src/sys/dev/usb/usbdi_util.c,v
retrieving revision 1.41
diff -u -p -u -r1.41 usbdi_util.c
--- usbdi_util.c14 Mar 2015 03:38:50 -  1.41
+++ usbdi_util.c9 Jan 2017 04:39:14 -
@@ -35,7 +35,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
Index: uthum.c
===
RCS file: /cvs/src/sys/dev/usb/uthum.c,v
retrieving revision 1.31
diff -u -p -u -r1.31 uthum.c
--- uthum.c 19 Mar 2016 11:34:22 -  1.31
+++ uthum.c 9 Jan 2017 04:39:19 -
@@ -21,7 +21,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 



ports build failure, max_align_t

2017-01-08 Thread Stuart Henderson
graphics/ttfautohint

c++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I..   -I../lib  -I../gnulib/src  
-I../gnulib/src  -I/usr/X11R6/include/freetype2   -O2 -pipe -MT info.o -MD -MP 
-MF .deps/info.Tpo -c -o info.o info.cpp
In file included from ../gnulib/src/stdio.h:53:0,
 from info.cpp:15:
../gnulib/src/stddef.h:106:3: error: conflicting declaration 'typedef union 
max_align_t max_align_t'
 } max_align_t;
   ^
In file included from ../gnulib/src/stddef.h:55:0,
 from ../gnulib/src/stdio.h:53,
 from info.cpp:15:
/usr/include/stddef.h:80:3: note: previous declaration as 'typedef struct 
max_align_t max_align_t'
 } max_align_t;
   ^



Re: openbgpd: support for bgp administrative shutdown communication

2017-01-08 Thread Sebastian Benoit
Job Snijders(j...@instituut.net) on 2017.01.08 20:24:19 +0100:
> Dear OpenBSD developers,
> 
> This patch adds support for the "BGP Administrative Shutdown
> Communication" to bgpd(8) and bgpctl(8).

Hi Job and Peter,

thanks, this is nice!

some comments below.
 
> The draft-ietf-idr-shutdown 
> (https://tools.ietf.org/html/draft-ietf-idr-shutdown)
> document specifies a mechanism to transmit a short freeform message
> across the wire as part of an Administrative Shutdown Cease NOTIFICATION
> message. This message serves to inform the neighbor why the BGP session
> was shut down. This is useful to communicate for instance a ticket
> reference, contact person or other information to the neighbor.
> 
> Example usage:
> 
> [job@kiera ~]$ bgpctl show
> NeighborASMsgRcvd  MsgSent  OutQ Up/Down   State/PrfRcvd
> 165.254.255.24  15562  70684  60 0   00:21:16  33653
> 
> [job@kiera ~]$ bgpctl neighbor 165.254.255.24 down "goodbye, we are 
> upgrading to openbsd 6.1"
> request processed
> 
> [job@kiera ~]$ bgpctl show
> NeighborASMsgRcvd  MsgSent  OutQ Up/Down  State/PrfRcvd
> 165.254.255.24  15562  70708 62  0   00:00:08 Idle
> 
> [job@kiera ~]$ bgpctl show neighbor 165.254.255.24 | grep reason
>   BGP state = Idle, marked down with shutdown reason "goodbye, we are 
> upgrading to openbsd 6.1", down for 00:00:17
> 
> On the neighbor's side you'll see the following in syslog:
> 
> Jan  8 19:28:54 shutdown bgpd[50719]: neighbor 165.254.255.26: received 
> notification: Cease, administratively down
> Jan  8 19:28:54 shutdown bgpd[50719]: neighbor 165.254.255.26: received 
> shutdown reason: "goodbye, we are upgrading to openbsd 6.1"
> 
> and this is also visible through bgpctl(8):
> 
> [job@shutdown~]$ bgpctl show neighbor 165.254.255.26 | grep reason
>   Last received shutdown reason: "goodbye, we are upgrading to openbsd 
> 6.1"
> 
> This work has been tested against pmacct and exabgp which also
> support draft-ietf-idr-shutdown.
> 
> The BGP Administrative Shutdown Communication feature for OpenBGPD was
> developed by Peter van Dijk  and Job Snijders 
> .
> 
> Kind regards,
> 
> Job
> 
> 
> Index: usr.sbin/bgpctl/bgpctl.8
> ===
> RCS file: /cvs/src/usr.sbin/bgpctl/bgpctl.8,v
> retrieving revision 1.69
> diff -u -p -r1.69 bgpctl.8
> --- usr.sbin/bgpctl/bgpctl.8  25 May 2016 14:15:59 -  1.69
> +++ usr.sbin/bgpctl/bgpctl.8  8 Jan 2017 17:45:24 -
> @@ -104,8 +104,14 @@ Destroy a previously cloned peer.
>  The peer must be down before calling this function.
>  .Ar peer
>  may be the neighbor's address or description.
> -.It Cm neighbor Ar peer Cm down
> -Take the BGP session to the specified neighbor down.
> +.It Cm neighbor Ar peer Cm down Op Ar reason
> +Take the BGP session to the specified neighbor down. If a
> +.Ar reason
> +is provided, the 
> +.Ar reason
> +is send as Administrative Shutdown Communication to the neighbor. The
> +.Ar reason
> +cannot exceed 128 octets.
>  .Ar peer
>  may be the neighbor's address or description.
>  .It Cm neighbor Ar peer Cm refresh
> Index: usr.sbin/bgpctl/bgpctl.c
> ===
> RCS file: /cvs/src/usr.sbin/bgpctl/bgpctl.c,v
> retrieving revision 1.188
> diff -u -p -r1.188 bgpctl.c
> --- usr.sbin/bgpctl/bgpctl.c  3 Jun 2016 17:36:37 -   1.188
> +++ usr.sbin/bgpctl/bgpctl.c  8 Jan 2017 17:45:24 -
> @@ -159,6 +159,7 @@ main(int argc, char *argv[])
>  
>   memcpy(, >peeraddr, sizeof(neighbor.addr));
>   strlcpy(neighbor.descr, res->peerdesc, sizeof(neighbor.descr));
> + strlcpy(neighbor.shutcomm, res->shutcomm, sizeof(neighbor.shutcomm));
>  
>   if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
>   err(1, "control_init: socket");
> @@ -702,6 +703,13 @@ show_neighbor_msg(struct imsg *imsg, enu
>   inet_ntoa(ina));
>   printf("%s\n", print_auth_method(p->auth.method));
>   printf("  BGP state = %s", statenames[p->state]);
> + if (p->conf.down) {
> + printf(", marked down");
> + if (*(p->conf.shutcomm)) {
> + printf(" with shutdown reason \"%s\"",
> + log_shutcomm(p->conf.shutcomm));
> + }
> + }
>   if (p->stats.last_updown != 0)
>   printf(", %s for %s",
>   p->state == STATE_ESTABLISHED ? "up" : "down",
> @@ -736,6 +744,10 @@ show_neighbor_msg(struct imsg *imsg, enu
>   break;
>   print_neighbor_msgstats(p);
>   printf("\n");
> + if (*(p->stats.last_shutcomm)) {
> + printf("  Last received shutdown reason: \"%s\"\n",
> + 

openbgpd: support for bgp administrative shutdown communication

2017-01-08 Thread Job Snijders
Dear OpenBSD developers,

This patch adds support for the "BGP Administrative Shutdown
Communication" to bgpd(8) and bgpctl(8).

The draft-ietf-idr-shutdown 
(https://tools.ietf.org/html/draft-ietf-idr-shutdown)
document specifies a mechanism to transmit a short freeform message
across the wire as part of an Administrative Shutdown Cease NOTIFICATION
message. This message serves to inform the neighbor why the BGP session
was shut down. This is useful to communicate for instance a ticket
reference, contact person or other information to the neighbor.

Example usage:

[job@kiera ~]$ bgpctl show
NeighborASMsgRcvd  MsgSent  OutQ Up/Down   State/PrfRcvd
165.254.255.24  15562  70684  60 0   00:21:16  33653

[job@kiera ~]$ bgpctl neighbor 165.254.255.24 down "goodbye, we are 
upgrading to openbsd 6.1"
request processed

[job@kiera ~]$ bgpctl show
NeighborASMsgRcvd  MsgSent  OutQ Up/Down  State/PrfRcvd
165.254.255.24  15562  70708 62  0   00:00:08 Idle

[job@kiera ~]$ bgpctl show neighbor 165.254.255.24 | grep reason
  BGP state = Idle, marked down with shutdown reason "goodbye, we are 
upgrading to openbsd 6.1", down for 00:00:17

On the neighbor's side you'll see the following in syslog:

Jan  8 19:28:54 shutdown bgpd[50719]: neighbor 165.254.255.26: received 
notification: Cease, administratively down
Jan  8 19:28:54 shutdown bgpd[50719]: neighbor 165.254.255.26: received 
shutdown reason: "goodbye, we are upgrading to openbsd 6.1"

and this is also visible through bgpctl(8):

[job@shutdown~]$ bgpctl show neighbor 165.254.255.26 | grep reason
  Last received shutdown reason: "goodbye, we are upgrading to openbsd 6.1"

This work has been tested against pmacct and exabgp which also
support draft-ietf-idr-shutdown.

The BGP Administrative Shutdown Communication feature for OpenBGPD was
developed by Peter van Dijk  and Job Snijders 
.

Kind regards,

Job


Index: usr.sbin/bgpctl/bgpctl.8
===
RCS file: /cvs/src/usr.sbin/bgpctl/bgpctl.8,v
retrieving revision 1.69
diff -u -p -r1.69 bgpctl.8
--- usr.sbin/bgpctl/bgpctl.825 May 2016 14:15:59 -  1.69
+++ usr.sbin/bgpctl/bgpctl.88 Jan 2017 17:45:24 -
@@ -104,8 +104,14 @@ Destroy a previously cloned peer.
 The peer must be down before calling this function.
 .Ar peer
 may be the neighbor's address or description.
-.It Cm neighbor Ar peer Cm down
-Take the BGP session to the specified neighbor down.
+.It Cm neighbor Ar peer Cm down Op Ar reason
+Take the BGP session to the specified neighbor down. If a
+.Ar reason
+is provided, the 
+.Ar reason
+is send as Administrative Shutdown Communication to the neighbor. The
+.Ar reason
+cannot exceed 128 octets.
 .Ar peer
 may be the neighbor's address or description.
 .It Cm neighbor Ar peer Cm refresh
Index: usr.sbin/bgpctl/bgpctl.c
===
RCS file: /cvs/src/usr.sbin/bgpctl/bgpctl.c,v
retrieving revision 1.188
diff -u -p -r1.188 bgpctl.c
--- usr.sbin/bgpctl/bgpctl.c3 Jun 2016 17:36:37 -   1.188
+++ usr.sbin/bgpctl/bgpctl.c8 Jan 2017 17:45:24 -
@@ -159,6 +159,7 @@ main(int argc, char *argv[])
 
memcpy(, >peeraddr, sizeof(neighbor.addr));
strlcpy(neighbor.descr, res->peerdesc, sizeof(neighbor.descr));
+   strlcpy(neighbor.shutcomm, res->shutcomm, sizeof(neighbor.shutcomm));
 
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
err(1, "control_init: socket");
@@ -702,6 +703,13 @@ show_neighbor_msg(struct imsg *imsg, enu
inet_ntoa(ina));
printf("%s\n", print_auth_method(p->auth.method));
printf("  BGP state = %s", statenames[p->state]);
+   if (p->conf.down) {
+   printf(", marked down");
+   if (*(p->conf.shutcomm)) {
+   printf(" with shutdown reason \"%s\"",
+   log_shutcomm(p->conf.shutcomm));
+   }
+   }
if (p->stats.last_updown != 0)
printf(", %s for %s",
p->state == STATE_ESTABLISHED ? "up" : "down",
@@ -736,6 +744,10 @@ show_neighbor_msg(struct imsg *imsg, enu
break;
print_neighbor_msgstats(p);
printf("\n");
+   if (*(p->stats.last_shutcomm)) {
+   printf("  Last received shutdown reason: \"%s\"\n",
+   log_shutcomm(p->stats.last_shutcomm));
+   }
if (p->state == STATE_IDLE) {
static const char   *errstr;
 
Index: usr.sbin/bgpctl/parser.c
===
RCS file: /cvs/src/usr.sbin/bgpctl/parser.c,v
retrieving 

openssl.pc version

2017-01-08 Thread Sebastien Marie
Hi,

The "OpenSSL bindings for Rust" checks, using pkg-config, the version of
openssl installed, and target 1.0.1 as minimal version.

Under OpenBSD, /usr/lib/pkgconfig/openssl.pc is generated by
src/lib/libcrypto/generate_pkgconfig.sh, and the "version" is taken from
SHLIB_VERSION_NUMBER in src/lib/libcrypto/opensslv.h , which is "1.0.0"
from ages (Oct-2010).

Does the file should be updated in some way ? I saw LibreSSL -portable
ship a openssl.pc file with different content (Name: LibreSSL / Version:
2.5.0) instead of "Name: OpenSSL" and "Version: 1.0.0" as on OpenBSD.

Thanks.
-- 
Sebastien Marie