Re: svn commit: r292955 - head/lib/libmd

2015-12-30 Thread Allan Jude
On 2015-12-30 23:10, Bruce Evans wrote:
> On Thu, 31 Dec 2015, Bruce Evans wrote:
> 
>>
>> wc /proc/0/* works.  md5 works like wc using a hack to avoid calling this
>> broken function.  E.g.,
>>
>>for i in $(ls /proc/0/*); do echo -n "$i: "; md5 <$i; done  # gives
>>
>> /proc/0/cmdline: 3c5896b1ac441f4998f052e2126e8d20
>> /proc/0/ctl: d41d8cd98f00b204e9800998ecf8427e
>> /proc/0/etype: 674441960ca1ba2de08ad4e50c9fde98
>> /proc/0/rlimit: 67d6ad67b412e1bceb7cb508a3492197
>> /proc/0/status: 3ccc3067b97c3232ea2dbcb64c458fd4
> 
> Further examples:
> 
> md5 # on terminal input
> 
> works correctly by not using MDXFileChunk().
> 
> md5 /dev/stdin # on the same terminal input
> 
> produces the d41d8cd98f00b204e9800998ecf8427e garbage using
> MDXFileChunk().  truss shows that lseek() is broken too -- MDXFileChunk()
> tries it and it succeeds on the unseekable file /dev/stdin.  Bugs in this
> area are common.  E.g., lseek() on named pipes was broken so that it
> succeeded, by rearranging the plumbing use fileops more or less and not
> attaching lseek right.
> 
> cat | md5 # on the same terminal input
> 
> works correctly by not using MDXFileChunk().
> 
> cat | md5 /dev/stdin # on the same terminal input
> 
> doesn't work correctly, but it fails better than without the pipe.  Now
> a seek error occurs and is reported as "md5: /dev/stdin: Illegal seek"
> (I can't see where it is reported).  Then md5 exits.  Then cat waits to
> read input.  Then cat fails to write output and is killed by SIGPIPE.
> So md5 handled the seek error in a fail-safe though incorrect way.  One
> correct way is to fall back to the working code, but it is better to
> just use that without an lseek check.
> 
> It is a bug that [l]stat() on /dev/stdin sees the device file and not the
> actual stdin file.  md5 can't work around this except by not using stat().
> 
> Bruce
> 

It seems these problems also slow things down, a lot:

# time md5 /media/md5test/bigdata
MD5 (/media/md5test/bigdata) = 6afad0bf5d8318093e943229be05be67
4.310u 3.476s 0:07.79 99.8% 20+167k 0+0io 0pf+0w
# time env LD_PRELOAD=/usr/obj/media/svn/md5/head/tmp/lib/libmd.so
/usr/obj/media/svn/md5/head/sbin/md5/md5 /media/md5test/bigdata
MD5 (/media/md5test/bigdata) = 6afad0bf5d8318093e943229be05be67
4.133u 0.354s 0:04.49 99.7% 20+167k 1+0io 0pf+0w

(file is fully cached in ZFS ARC, dd reads it at 11GB/s)

Will investigate more tomorrow.

char *
MDXFile(const char *filename, char *buf)
{
unsigned char buffer[16*1024];
MDX_CTX ctx;
int f, i;

MDXInit(&ctx);
f = open(filename, O_RDONLY);
if (f < 0)
return 0;
i = 0;
while (1) {
i = read(f, buffer, sizeof(buffer));
if (i <= 0)
break;
MDXUpdate(&ctx, buffer, i);
}

close(f);
return (MDXEnd(&ctx, buf));
}


-- 
Allan Jude



signature.asc
Description: OpenPGP digital signature


svn commit: r292981 - head/usr.sbin/bhyve

2015-12-30 Thread Marcelo Araujo
Author: araujo
Date: Thu Dec 31 07:08:21 2015
New Revision: 292981
URL: https://svnweb.freebsd.org/changeset/base/292981

Log:
  Clean up unused-but-set-variable spotted by gcc-4.9.
  
  Reviewed by:  grehan
  Approved by:  rodrigc (mentor)
  Differential Revision:https://reviews.freebsd.org/D4734

Modified:
  head/usr.sbin/bhyve/bhyverun.c

Modified: head/usr.sbin/bhyve/bhyverun.c
==
--- head/usr.sbin/bhyve/bhyverun.c  Thu Dec 31 07:03:41 2015
(r292980)
+++ head/usr.sbin/bhyve/bhyverun.c  Thu Dec 31 07:08:21 2015
(r292981)
@@ -310,14 +310,13 @@ static int
 vmexit_inout(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu)
 {
int error;
-   int bytes, port, in, out, string;
+   int bytes, port, in, out;
int vcpu;
 
vcpu = *pvcpu;
 
port = vme->u.inout.port;
bytes = vme->u.inout.bytes;
-   string = vme->u.inout.string;
in = vme->u.inout.in;
out = !in;
 
@@ -620,8 +619,6 @@ vm_loop(struct vmctx *ctx, int vcpu, uin
if (error != 0)
break;
 
-   prevcpu = vcpu;
-
exitcode = vmexit[vcpu].exitcode;
if (exitcode >= VM_EXITCODE_MAX || handler[exitcode] == NULL) {
fprintf(stderr, "vm_loop: unexpected exitcode 0x%x\n",
@@ -629,7 +626,7 @@ vm_loop(struct vmctx *ctx, int vcpu, uin
exit(1);
}
 
-rc = (*handler[exitcode])(ctx, &vmexit[vcpu], &vcpu);
+   rc = (*handler[exitcode])(ctx, &vmexit[vcpu], &vcpu);
 
switch (rc) {
case VMEXIT_CONTINUE:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292980 - head/sys/net

2015-12-30 Thread Marcelo Araujo
Author: araujo
Date: Thu Dec 31 07:03:41 2015
New Revision: 292980
URL: https://svnweb.freebsd.org/changeset/base/292980

Log:
  Clean up unused-but-set-variable spotted by gcc4.9.
  
  Reviewed by:  ngie
  Approved by:  rodrigc (mentor)
  Differential Revision:https://reviews.freebsd.org/D4719

Modified:
  head/sys/net/if_gif.c

Modified: head/sys/net/if_gif.c
==
--- head/sys/net/if_gif.c   Thu Dec 31 06:01:07 2015(r292979)
+++ head/sys/net/if_gif.c   Thu Dec 31 07:03:41 2015(r292980)
@@ -529,7 +529,6 @@ gif_input(struct mbuf *m, struct ifnet *
struct gif_softc *sc;
struct ether_header *eh;
struct ifnet *oldifp;
-   uint32_t gif_options;
int isr, n, af;
 
if (ifp == NULL) {
@@ -538,7 +537,6 @@ gif_input(struct mbuf *m, struct ifnet *
return;
}
sc = ifp->if_softc;
-   gif_options = sc->gif_options;
m->m_pkthdr.rcvif = ifp;
m_clrprotoflags(m);
switch (proto) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292978 - in head/sys: dev/cxgb/ulp/tom dev/cxgbe/tom net netinet netinet6 ofed/drivers/infiniband/ulp/ipoib

2015-12-30 Thread Alexander V. Chernikov
Author: melifaro
Date: Thu Dec 31 05:03:27 2015
New Revision: 292978
URL: https://svnweb.freebsd.org/changeset/base/292978

Log:
  Implement interface link header precomputation API.
  
  Add if_requestencap() interface method which is capable of calculating
various link headers for given interface. Right now there is support
for INET/INET6/ARP llheader calculation (IFENCAP_LL type request).
Other types are planned to support more complex calculation
(L2 multipath lagg nexthops, tunnel encap nexthops, etc..).
  
  Reshape 'struct route' to be able to pass additional data (with is length)
to prepend to mbuf.
  
  These two changes permits routing code to pass pre-calculated nexthop data
(like L2 header for route w/gateway) down to the stack eliminating the
need for other lookups. It also brings us closer to more complex scenarios
like transparently handling MPLS nexthops and tunnel interfaces.
Last, but not least, it removes layering violation introduced by flowtable
code (ro_lle) and simplifies handling of existing if_output consumers.
  
  ARP/ND changes:
  Make arp/ndp stack pre-calculate link header upon installing/updating lle
record. Interface link address change are handled by re-calculating
headers for all lles based on if_lladdr event. After these changes,
arpresolve()/nd6_resolve() returns full pre-calculated header for
supported interfaces thus simplifying if_output().
  Move these lookups to separate ether_resolve_addr() function which ether
returs error or fully-prepared link header. Add resolve_addr()
compat versions to return link addresses instead of pre-calculated data.
  
  BPF changes:
  Raw bpf writes occupied _two_ cases: AF_UNSPEC and pseudo_AF_HDRCMPLT.
  Despite the naming, both of there have ther header "complete". The only
difference is that interface source mac has to be filled by OS for
AF_UNSPEC (controlled via BIOCGHDRCMPLT). This logic has to stay inside
BPF and not pollute if_output() routines. Convert BPF to pass prepend data
via new 'struct route' mechanism. Note that it does not change
non-optimized if_output(): ro_prepend handling is purely optional.
  Side note: hackish pseudo_AF_HDRCMPLT is supported for ethernet and FDDI.
It is not needed for ethernet anymore. The only remaining FDDI user is
dev/pdq mostly untouched since 2007. FDDI support was eliminated from
OpenBSD in 2013 (sys/net/if_fddisubr.c rev 1.65).
  
  Flowtable changes:
Flowtable violates layering by saving (and not correctly managing)
rtes/lles. Instead of passing lle pointer, pass pointer to pre-calculated
header data from that lle.
  
  Differential Revision:https://reviews.freebsd.org/D4102

Modified:
  head/sys/dev/cxgb/ulp/tom/cxgb_l2t.c
  head/sys/dev/cxgbe/tom/t4_tom_l2t.c
  head/sys/net/bpf.c
  head/sys/net/flowtable.c
  head/sys/net/if.c
  head/sys/net/if_ethersubr.c
  head/sys/net/if_llatbl.c
  head/sys/net/if_llatbl.h
  head/sys/net/if_var.h
  head/sys/net/route.h
  head/sys/netinet/if_ether.c
  head/sys/netinet/if_ether.h
  head/sys/netinet/in.c
  head/sys/netinet/ip_output.c
  head/sys/netinet/toecore.c
  head/sys/netinet6/icmp6.c
  head/sys/netinet6/in6.c
  head/sys/netinet6/in6.h
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6.h
  head/sys/netinet6/nd6_nbr.c
  head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c

Modified: head/sys/dev/cxgb/ulp/tom/cxgb_l2t.c
==
--- head/sys/dev/cxgb/ulp/tom/cxgb_l2t.cThu Dec 31 04:14:05 2015
(r292977)
+++ head/sys/dev/cxgb/ulp/tom/cxgb_l2t.cThu Dec 31 05:03:27 2015
(r292978)
@@ -215,7 +215,7 @@ resolve_entry(struct adapter *sc, struct
struct tom_data *td = sc->tom_softc;
struct toedev *tod = &td->tod;
struct sockaddr_in sin = {0};
-   uint8_t dmac[ETHER_ADDR_LEN];
+   uint8_t dmac[ETHER_HDR_LEN];
uint16_t vtag = EVL_VLID_MASK;
int rc;
 

Modified: head/sys/dev/cxgbe/tom/t4_tom_l2t.c
==
--- head/sys/dev/cxgbe/tom/t4_tom_l2t.c Thu Dec 31 04:14:05 2015
(r292977)
+++ head/sys/dev/cxgbe/tom/t4_tom_l2t.c Thu Dec 31 05:03:27 2015
(r292978)
@@ -233,7 +233,7 @@ resolve_entry(struct adapter *sc, struct
struct sockaddr_in sin = {0};
struct sockaddr_in6 sin6 = {0};
struct sockaddr *sa;
-   uint8_t dmac[ETHER_ADDR_LEN];
+   uint8_t dmac[ETHER_HDR_LEN];
uint16_t vtag = VLAN_NONE;
int rc;
 

Modified: head/sys/net/bpf.c
==
--- head/sys/net/bpf.c  Thu Dec 31 04:14:05 2015(r292977)
+++ head/sys/net/bpf.c  Thu Dec 31 05:03:27 2015(r292978)
@@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #ifdef BPF_JITTER
@@ -76,6 +77,7 @@ __

Re: svn commit: r292955 - head/lib/libmd

2015-12-30 Thread Bruce Evans

On Thu, 31 Dec 2015, Bruce Evans wrote:



wc /proc/0/* works.  md5 works like wc using a hack to avoid calling this
broken function.  E.g.,

   for i in $(ls /proc/0/*); do echo -n "$i: "; md5 <$i; done  # gives

/proc/0/cmdline: 3c5896b1ac441f4998f052e2126e8d20
/proc/0/ctl: d41d8cd98f00b204e9800998ecf8427e
/proc/0/etype: 674441960ca1ba2de08ad4e50c9fde98
/proc/0/rlimit: 67d6ad67b412e1bceb7cb508a3492197
/proc/0/status: 3ccc3067b97c3232ea2dbcb64c458fd4


Further examples:

md5 # on terminal input

works correctly by not using MDXFileChunk().

md5 /dev/stdin # on the same terminal input

produces the d41d8cd98f00b204e9800998ecf8427e garbage using
MDXFileChunk().  truss shows that lseek() is broken too -- MDXFileChunk()
tries it and it succeeds on the unseekable file /dev/stdin.  Bugs in this
area are common.  E.g., lseek() on named pipes was broken so that it
succeeded, by rearranging the plumbing use fileops more or less and not
attaching lseek right.

cat | md5 # on the same terminal input

works correctly by not using MDXFileChunk().

cat | md5 /dev/stdin # on the same terminal input

doesn't work correctly, but it fails better than without the pipe.  Now
a seek error occurs and is reported as "md5: /dev/stdin: Illegal seek"
(I can't see where it is reported).  Then md5 exits.  Then cat waits to
read input.  Then cat fails to write output and is killed by SIGPIPE.
So md5 handled the seek error in a fail-safe though incorrect way.  One
correct way is to fall back to the working code, but it is better to
just use that without an lseek check.

It is a bug that [l]stat() on /dev/stdin sees the device file and not the
actual stdin file.  md5 can't work around this except by not using stat().

Bruce
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r292955 - head/lib/libmd

2015-12-30 Thread Bruce Evans

On Wed, 30 Dec 2015, Jonathan T. Looney wrote:


Log:
 Fix a file descriptor leak in mdXhl.c (which is used by numerous hashing
 algorithms.


This code had amazingly low quality and is still especially broken near
the main leak fixed.


Modified: head/lib/libmd/mdXhl.c
==
--- head/lib/libmd/mdXhl.c  Wed Dec 30 17:36:34 2015(r292954)
+++ head/lib/libmd/mdXhl.c  Wed Dec 30 18:04:50 2015(r292955)
@@ -59,14 +59,18 @@ MDXFileChunk(const char *filename, char
f = open(filename, O_RDONLY);
if (f < 0)
return 0;
-   if (fstat(f, &stbuf) < 0)
-   return 0;
+   if (fstat(f, &stbuf) < 0) {
+   i = -1;
+   goto error;
+   }
if (ofs > stbuf.st_size)
ofs = stbuf.st_size;


st_size is only valid for regular files.  The first bug is using it
here.  Usually it is 0 when it is invalid.  This code sets the offset
to 0 then.  I think this is just to avoid a false negative in the buggy
seek test.


if ((len == 0) || (len > stbuf.st_size - ofs))
len = stbuf.st_size - ofs;


Style bugs (extra parentheses) and second use of the invalid st_size.


-   if (lseek(f, ofs, SEEK_SET) < 0)
-   return 0;
+   if (lseek(f, ofs, SEEK_SET) < 0) {
+   i = -1;
+   goto error;
+   }


md5 is very broken by using this function for non-seekable files.  The
main case of a non-seekable file is a pipe.  This case works for at
least md5(1) by not using this function -- it uses MDFilter() which
uses stdio's fread() which works.
  (stdio knows better than to use st_size, but it naively trusts
  st_blksize and uses it to give a pessimized small block size for read()
  called from fread().  This code handles buffer sizing and allocation
  worse using its low quality methods:
  - its buffer used to have size BUFSIZ.  This size is not usable for
anything except possibly buffering keyboard input and stderr.  It
is mainly part of the broken setbuf() API.  Its value is 1024,
perhaps to avoid changing this API.  1024 large enough for more
uses in 1980.
  - its buffer now has size 16*1024 (spelled with a style bug like that).
This sometimes matches and sometimes exceeds the size used by stdio.
stdio at least attempts to choose the best size, but is defeated by
stat() putting useless sizes in st_blksize.
  - it also tries to pessimize the i/o by asking for a misaligned buffer.
Its buffer is just a local char[] variable.  Compilers usally mostly
foil this attempt by aligning large variables on the stack.

Misaligned usr buffers should only pessimize the i/o, but last time
I looked they cause DMA errors in ahci.  This breaks bsdlabel(8).
bsdlabel ask for a misaligned buffer and gets it at least when
statically linked because its buffer is a global char [] variable
and the neither the compiler nor the linker gives more alignment
than requested.

The DMA error would break md5 (or just cat) similarly if the buffer
were misaligend.  But the main bug here breaks md5 on disks without
trying any i/o.

Back to the main bug.  This seek test detects some cases of non-regular
files.  These files indeed cannot be handled by this code.  But the error
handling is broken -- it is just to set errno and return 0 (EOF).  0
means no error and errno is no set.  So all non-seekable files are
treated as empty regular files.  E.g., md5 /proc/0/* gives:

md5: /proc/0/ctl: Permission denied
MD5 (/proc/0/cmdline) = d41d8cd98f00b204e9800998ecf8427e
MD5 (/proc/0/etype) = d41d8cd98f00b204e9800998ecf8427e
MD5 (/proc/0/rlimit) = d41d8cd98f00b204e9800998ecf8427e
MD5 (/proc/0/status) = d41d8cd98f00b204e9800998ecf8427e

(/proc gives my favourite examples of irregular regular files.  It
doesn't work to use S_ISREG(&stbuf) to determine if st_size can be
trusted, since too many irregular files claim to be regular: e.g.,
file /proc/0/* gives:

/proc/0/cmdline: empty
/proc/0/ctl: empty
/proc/0/etype:   empty
/proc/0/rlimit:  empty
/proc/0/status:  empty

wc /proc/0/* works.  md5 works like wc using a hack to avoid calling this
broken function.  E.g.,

for i in $(ls /proc/0/*); do echo -n "$i: "; md5 <$i; done  # gives

/proc/0/cmdline: 3c5896b1ac441f4998f052e2126e8d20
/proc/0/ctl: d41d8cd98f00b204e9800998ecf8427e
/proc/0/etype: 674441960ca1ba2de08ad4e50c9fde98
/proc/0/rlimit: 67d6ad67b412e1bceb7cb508a3492197
/proc/0/status: 3ccc3067b97c3232ea2dbcb64c458fd4


n = len;
i = 0;
while (n > 0) {


Disk device files are seekable, so the lseek test doesn't result in
mishandling them.  Instead, they are treated as empty files since
their st_size is 0.  E.g., md5 /dev/ad* gives:

MD5 (/dev/ad0) = d41d8cd98f00b204e9800998ecf8427e
MD5 (/dev/ad0s1) = d41d8cd98f00b204e9800998ecf8427e
MD5 (/dev/ad0s2) = d41d8cd98f00b204e9800998ecf8427e
MD5 (/de

Re: svn commit: r292969 - head/sys/xen/xenbus

2015-12-30 Thread Marcelo Araujo
2015-12-31 11:20 GMT+08:00 NGie Cooper :

>
> > On Dec 30, 2015, at 17:54, Marcelo Araujo  wrote:
> >
> > Author: araujo
> > Date: Thu Dec 31 01:54:07 2015
> > New Revision: 292969
> > URL: https://svnweb.freebsd.org/changeset/base/292969
> >
> > Log:
> >  Clean up unused-but-set-variable spotted by gcc-4.9.
> >
> >  Reviewed by: royger
> >  Approved by: rodrigc (mentor)
> >  Differential Revision:   https://reviews.freebsd.org/D4733
>
> Hi Marcelo!
> Do you plan on MFCing these changes (MFC after: XXX)?
> Thanks!
> -NGie
>
>
Hi Ngie,

I didn't make any plan to MFC these changes, because I saw in the latest
weeks you are doing all of this job. Thanks for that!

But, yes, I can do the MFC in case you don't want do it by yourself as you
have been doing. Just let me know and I will schedule it to be MFC after
couple weeks.


Best,
-- 

-- 
Marcelo Araujo(__)ara...@freebsd.org
\\\'',)http://www.FreeBSD.org    \/  \ ^
Power To Server. .\. /_)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r292969 - head/sys/xen/xenbus

2015-12-30 Thread NGie Cooper

> On Dec 30, 2015, at 17:54, Marcelo Araujo  wrote:
> 
> Author: araujo
> Date: Thu Dec 31 01:54:07 2015
> New Revision: 292969
> URL: https://svnweb.freebsd.org/changeset/base/292969
> 
> Log:
>  Clean up unused-but-set-variable spotted by gcc-4.9.
> 
>  Reviewed by: royger
>  Approved by: rodrigc (mentor)
>  Differential Revision:   https://reviews.freebsd.org/D4733

Hi Marcelo!
Do you plan on MFCing these changes (MFC after: XXX)?
Thanks!
-NGie

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292972 - head/sys/net

2015-12-30 Thread Marcelo Araujo
Author: araujo
Date: Thu Dec 31 02:01:20 2015
New Revision: 292972
URL: https://svnweb.freebsd.org/changeset/base/292972

Log:
  Wrap using #ifdef 'notyet' those variables and statements not yet
  implemented to lower the compiler warnings.
  
  It fix the case of unused-but-set-variable spotted by gcc4.9.
  
  Reviewed by:  ngie, ae
  Approved by:  bapt (mentor)
  Differential Revision:https://reviews.freebsd.org/D4720

Modified:
  head/sys/net/if_gre.c

Modified: head/sys/net/if_gre.c
==
--- head/sys/net/if_gre.c   Thu Dec 31 01:57:55 2015(r292971)
+++ head/sys/net/if_gre.c   Thu Dec 31 02:01:20 2015(r292972)
@@ -682,7 +682,10 @@ gre_input(struct mbuf **mp, int *offp, i
struct grehdr *gh;
struct ifnet *ifp;
struct mbuf *m;
-   uint32_t *opts, key;
+   uint32_t *opts;
+#ifdef notyet
+   uint32_t key;
+#endif
uint16_t flags;
int hlen, isr, af;
 
@@ -715,17 +718,28 @@ gre_input(struct mbuf **mp, int *offp, i
opts++;
}
if (flags & GRE_FLAGS_KP) {
+#ifdef notyet
+/* 
+ * XXX: The current implementation uses the key only for outgoing
+ * packets. But we can check the key value here, or even in the
+ * encapcheck function.
+ */
key = ntohl(*opts);
+#endif
hlen += sizeof(uint32_t);
opts++;
+}
+#ifdef notyet
} else
key = 0;
-   /*
+
if (sc->gre_key != 0 && (key != sc->gre_key || key != 0))
goto drop;
-   */
+#endif
if (flags & GRE_FLAGS_SP) {
-   /* seq = ntohl(*opts); */
+#ifdef notyet
+   seq = ntohl(*opts);
+#endif
hlen += sizeof(uint32_t);
}
switch (ntohs(gh->gre_proto)) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292971 - head/usr.sbin/camdd

2015-12-30 Thread Marcelo Araujo
Author: araujo
Date: Thu Dec 31 01:57:55 2015
New Revision: 292971
URL: https://svnweb.freebsd.org/changeset/base/292971

Log:
  Clean up unused-but-set-variable spotted by gcc-4.9.
  
  Approved by:  bapt (mentor)
  Differential Revision:https://reviews.freebsd.org/D4736

Modified:
  head/usr.sbin/camdd/camdd.c

Modified: head/usr.sbin/camdd/camdd.c
==
--- head/usr.sbin/camdd/camdd.c Thu Dec 31 01:55:51 2015(r292970)
+++ head/usr.sbin/camdd/camdd.c Thu Dec 31 01:57:55 2015(r292971)
@@ -1276,7 +1276,6 @@ camdd_probe_pass(struct cam_device *cam_
struct camdd_dev_pass *pass_dev;
struct kevent ke;
int scsi_dev_type;
-   int retval;
 
dev = NULL;
 
@@ -1336,7 +1335,6 @@ camdd_probe_pass(struct cam_device *cam_
 
if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr);
-   retval = 1;
goto bailout;
}
 
@@ -1371,11 +1369,8 @@ camdd_probe_pass(struct cam_device *cam_
 
if (cam_send_ccb(cam_dev, ccb) < 0) {
warn("error sending READ CAPACITY (16) command");
-
cam_error_print(cam_dev, ccb, CAM_ESF_ALL,
CAM_EPF_ALL, stderr);
-
-   retval = 1;
goto bailout;
}
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292970 - head/usr.sbin/bhyve

2015-12-30 Thread Marcelo Araujo
Author: araujo
Date: Thu Dec 31 01:55:51 2015
New Revision: 292970
URL: https://svnweb.freebsd.org/changeset/base/292970

Log:
  Clean up unused-but-set-variable spotted by gcc-4.9.
  
  Reviewed by:  grehan
  Approved by:  bapt (mentor)
  Differential Revision:https://reviews.freebsd.org/D4735

Modified:
  head/usr.sbin/bhyve/pci_emul.c

Modified: head/usr.sbin/bhyve/pci_emul.c
==
--- head/usr.sbin/bhyve/pci_emul.c  Thu Dec 31 01:54:07 2015
(r292969)
+++ head/usr.sbin/bhyve/pci_emul.c  Thu Dec 31 01:55:51 2015
(r292970)
@@ -863,10 +863,9 @@ msixcap_cfgwrite(struct pci_devinst *pi,
 int bytes, uint32_t val)
 {
uint16_t msgctrl, rwmask;
-   int off, table_bar;
+   int off;

off = offset - capoff;
-   table_bar = pi->pi_msix.table_bar;
/* Message Control Register */
if (off == 2 && bytes == 2) {
rwmask = PCIM_MSIXCTRL_MSIX_ENABLE | 
PCIM_MSIXCTRL_FUNCTION_MASK;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292969 - head/sys/xen/xenbus

2015-12-30 Thread Marcelo Araujo
Author: araujo
Date: Thu Dec 31 01:54:07 2015
New Revision: 292969
URL: https://svnweb.freebsd.org/changeset/base/292969

Log:
  Clean up unused-but-set-variable spotted by gcc-4.9.
  
  Reviewed by:  royger
  Approved by:  rodrigc (mentor)
  Differential Revision:https://reviews.freebsd.org/D4733

Modified:
  head/sys/xen/xenbus/xenbusb.c

Modified: head/sys/xen/xenbus/xenbusb.c
==
--- head/sys/xen/xenbus/xenbusb.c   Thu Dec 31 01:26:43 2015
(r292968)
+++ head/sys/xen/xenbus/xenbusb.c   Thu Dec 31 01:54:07 2015
(r292969)
@@ -561,7 +561,6 @@ xenbusb_devices_changed(struct xs_watch 
struct xenbusb_softc *xbs;
device_t dev;
char *node;
-   char *bus;
char *type;
char *id;
char *p;
@@ -580,7 +579,6 @@ xenbusb_devices_changed(struct xs_watch 
p = strchr(node, '/');
if (p == NULL)
goto out;
-   bus = node;
*p = 0;
type = p + 1;
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r292440 - in head/sys: kern sys

2015-12-30 Thread Oliver Pinter
On 12/18/15, Mateusz Guzik  wrote:
> Author: mjg
> Date: Fri Dec 18 16:33:15 2015
> New Revision: 292440
> URL: https://svnweb.freebsd.org/changeset/base/292440
>
> Log:
>   proc: fix a race which could result in dereference of bad p_pgrp pointer
> on fork
>
>   During fork p_starcopy - p_endcopy area of a process is populated with
> bcopy
>   with only proc lock held. Another forking thread can find such a process
> and
>   proceed to access p_pgrp included in said area.
>
>   Fix the problem by moving the field outside. It is being properly
> assigned
>   later.
>
>   Reviewed by:kib
>   Diagnosed by:   kib
>   Tested by:  Fabian Keil 
>   MFC after:  10 days

Hi mjg@!

Just an MFC reminder and question: This patch is still needs on 10-STABLE?

>
> Modified:
>   head/sys/kern/kern_proc.c
>   head/sys/sys/proc.h
>
> Modified: head/sys/kern/kern_proc.c
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r292966 - head/sys/sys

2015-12-30 Thread Oliver Pinter
On 12/31/15, Allan Jude  wrote:
> Author: allanjude
> Date: Wed Dec 30 23:27:24 2015
> New Revision: 292966
> URL: https://svnweb.freebsd.org/changeset/base/292966
>
> Log:
>   Bump __FreeBSD_version because r292782 removes sys/crypto/sha2.h
>
>   Submitted by:   Oliver Pinter 
>
> Modified:
>   head/sys/sys/param.h
>
> Modified: head/sys/sys/param.h
> ==
> --- head/sys/sys/param.h  Wed Dec 30 23:25:45 2015(r292965)
> +++ head/sys/sys/param.h  Wed Dec 30 23:27:24 2015(r292966)
> @@ -58,7 +58,7 @@
>   *   in the range 5 to 9.
>   */
>  #undef __FreeBSD_version
> -#define __FreeBSD_version 1100092/* Master, propagated to newvers */
> +#define __FreeBSD_version 1100093/* Master, propagated to newvers */
>
>  /*
>   * __FreeBSD_kernel__ indicates that this system uses the kernel of
> FreeBSD,

Cool! Thank you!

> ___
> svn-src-head@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292966 - head/sys/sys

2015-12-30 Thread Allan Jude
Author: allanjude
Date: Wed Dec 30 23:27:24 2015
New Revision: 292966
URL: https://svnweb.freebsd.org/changeset/base/292966

Log:
  Bump __FreeBSD_version because r292782 removes sys/crypto/sha2.h
  
  Submitted by: Oliver Pinter 

Modified:
  head/sys/sys/param.h

Modified: head/sys/sys/param.h
==
--- head/sys/sys/param.hWed Dec 30 23:25:45 2015(r292965)
+++ head/sys/sys/param.hWed Dec 30 23:27:24 2015(r292966)
@@ -58,7 +58,7 @@
  * in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1100092  /* Master, propagated to newvers */
+#define __FreeBSD_version 1100093  /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292964 - head/contrib/binutils/bfd

2015-12-30 Thread Ian Lepore
Author: ian
Date: Wed Dec 30 23:04:08 2015
New Revision: 292964
URL: https://svnweb.freebsd.org/changeset/base/292964

Log:
  Add the MOVT/MOVW types to the list of relocs which do not generate .plt
  entries.  This fixes the segfaults in arm userland code compiled with
  -march= or -mcpu= values that allow the compiler to generate movw/movt
  sequences to load 32-bit constants.

Modified:
  head/contrib/binutils/bfd/elf32-arm.c

Modified: head/contrib/binutils/bfd/elf32-arm.c
==
--- head/contrib/binutils/bfd/elf32-arm.c   Wed Dec 30 22:43:07 2015
(r292963)
+++ head/contrib/binutils/bfd/elf32-arm.c   Wed Dec 30 23:04:08 2015
(r292964)
@@ -7720,12 +7720,26 @@ elf32_arm_check_relocs (bfd *abfd, struc
   refers to is in a different object.  We can't tell for
   sure yet, because something later might force the
   symbol local.  */
-   if (r_type != R_ARM_ABS32
-&& r_type != R_ARM_REL32
-&& r_type != R_ARM_ABS32_NOI
-&& r_type != R_ARM_REL32_NOI
-&& r_type != R_ARM_ABS12)
- h->needs_plt = 1;
+   switch (r_type)
+ {
+   case R_ARM_ABS12:
+   case R_ARM_ABS32:
+   case R_ARM_ABS32_NOI:
+   case R_ARM_REL32:
+   case R_ARM_REL32_NOI:
+   case R_ARM_MOVW_ABS_NC:
+   case R_ARM_MOVT_ABS:
+   case R_ARM_MOVW_PREL_NC:
+   case R_ARM_MOVT_PREL:
+   case R_ARM_THM_MOVW_ABS_NC:
+   case R_ARM_THM_MOVT_ABS:
+   case R_ARM_THM_MOVW_PREL_NC:
+   case R_ARM_THM_MOVT_PREL:
+ break;
+   default:
+ h->needs_plt = 1;
+ break;
+ }
 
/* If we create a PLT entry, this relocation will reference
   it, even if it's an ABS32 relocation.  */
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292963 - in head/sys: crypto opencrypto

2015-12-30 Thread Allan Jude
Author: allanjude
Date: Wed Dec 30 22:43:07 2015
New Revision: 292963
URL: https://svnweb.freebsd.org/changeset/base/292963

Log:
  Break up opencrypto/xform.c so it can be reused piecemeal
  
  Keep xform.c as a meta-file including the broken out bits
  existing code that includes xform.c continues to work as normal
  
  Individual algorithms can now be reused elsewhere, including outside
  of the kernel
  
  Reviewed by:  bapt (previous version), gnn, delphij
  Approved by:  secteam
  MFC after:1 week
  Sponsored by: ScaleEngine Inc.
  Differential Revision:https://reviews.freebsd.org/D4674

Added:
  head/sys/opencrypto/xform_aes_icm.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_aes_xts.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_auth.h
 - copied, changed from r292837, head/sys/opencrypto/xform.h
  head/sys/opencrypto/xform_blf.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_cast5.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_cml.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_comp.h
 - copied, changed from r292837, head/sys/opencrypto/xform.h
  head/sys/opencrypto/xform_deflate.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_des1.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_des3.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_enc.h
 - copied, changed from r292837, head/sys/opencrypto/xform.h
  head/sys/opencrypto/xform_gmac.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_md5.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_null.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_rijndael.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_rmd160.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_sha1.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_sha2.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_skipjack.c
 - copied, changed from r292238, head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform_userland.h   (contents, props changed)
Modified:
  head/sys/crypto/sha1.h
  head/sys/opencrypto/skipjack.h
  head/sys/opencrypto/xform.c
  head/sys/opencrypto/xform.h

Modified: head/sys/crypto/sha1.h
==
--- head/sys/crypto/sha1.h  Wed Dec 30 20:15:29 2015(r292962)
+++ head/sys/crypto/sha1.h  Wed Dec 30 22:43:07 2015(r292963)
@@ -53,6 +53,7 @@ struct sha1_ctxt {
} m;
u_int8_tcount;
 };
+typedef struct sha1_ctxt SHA1_CTX;
 
 #ifdef _KERNEL
 extern void sha1_init(struct sha1_ctxt *);
@@ -61,7 +62,6 @@ extern void sha1_loop(struct sha1_ctxt *
 extern void sha1_result(struct sha1_ctxt *, caddr_t);
 
 /* compatibilty with other SHA1 source codes */
-typedef struct sha1_ctxt SHA1_CTX;
 #define SHA1Init(x)sha1_init((x))
 #define SHA1Update(x, y, z)sha1_loop((x), (y), (z))
 #define SHA1Final(x, y)sha1_result((y), (x))

Modified: head/sys/opencrypto/skipjack.h
==
--- head/sys/opencrypto/skipjack.h  Wed Dec 30 20:15:29 2015
(r292962)
+++ head/sys/opencrypto/skipjack.h  Wed Dec 30 22:43:07 2015
(r292963)
@@ -14,6 +14,11 @@
  * 29 May 1998
 */
 
+#ifndef _SKIPJACK_H_
+#define _SKIPJACK_H_
+
 extern void skipjack_forwards(u_int8_t *plain, u_int8_t *cipher, u_int8_t 
**key);
 extern void skipjack_backwards(u_int8_t *cipher, u_int8_t *plain, u_int8_t 
**key);
 extern void subkey_table_gen(u_int8_t *key, u_int8_t **key_tables);
+
+#endif

Modified: head/sys/opencrypto/xform.c
==
--- head/sys/opencrypto/xform.c Wed Dec 30 20:15:29 2015(r292962)
+++ head/sys/opencrypto/xform.c Wed Dec 30 22:43:07 2015(r292963)
@@ -75,196 +75,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-static int null_setkey(u_int8_t **, u_int8_t *, int);
-static int des1_setkey(u_int8_t **, u_int8_t *, int);
-static int des3_setkey(u_int8_t **, u_int8_t *, int);
-static int blf_setkey(u_int8_t **, u_int8_t *, int);
-static int cast5_setkey(u_int8_t **, u_int8_t *, int);
-static int skipjack_setkey(u_int8_t **, u_int8_t *, int);
-static int rijndael128_setkey(u_int8_t **, u_int8_t *, int);
-static int aes_icm_setkey(u_int8_t **, u_int8_t *, int);
-static int aes_xts_setkey(u_int8_t **, u_int8_t

Re: svn commit: r289421 - in head/etc: . mtree ntp

2015-12-30 Thread Cy Schubert
In message <1451491490.1369.41.ca...@freebsd.org>, Ian Lepore writes:
> On Wed, 2015-12-30 at 04:50 -0800, Colin Percival wrote:
> > On 10/16/15 07:04, Cy Schubert wrote:
> > >   Add default leap-seconds file. This should help ntp networks get
> > > the
> > >   leap second date correct
> > >   
> > > Added:
> > >   head/etc/ntp/
> > >   head/etc/ntp/Makefile   (contents, props changed)
> > >   head/etc/ntp/leap-seconds   (contents, props changed)
> > 
> > So... is someone going to be keeping this file up to date?  We seem
> > to have
> > the same information in contrib/tzdata/leapseconds (which is being
> > kept up
> > to date -- thank you edwin and delphij!) but having this file in
> > /etc/ntp/
> > being out of date is making ntpd refuse to start.
> > 
> 
> I vaguely remember warning that something like this was likely to
> happen.  Turning on leapfile processing by default without an already
> -in-place mechanism to keep the file up to date was a bad idea.  There
> was some mumbling about a mechanism, but nobody wrote any code.
> 
> Even if the mechanism existed, I think defaulting to using the leapfile
> is wrong.  It's a thing that needs care and feeding or it causes
> problems, and thus it's a thing that should only be enabled by admins
> who know about the care and feeding aspect (an automatic fetch
> mechanism doesn't help much if there are firewalls blocking the fetch,
> for example).

The original idea was to update the file twice a year. Just before 
Christmas des@ suggested an alternative approach of fetching an update 
weekly or monthly because some upstream ntp servers not using the correct 
leap seconds and hosting the file locally would be more reliable. I've cc'd 
you on my last reply to des@ this morning.


-- 
Cheers,
Cy Schubert  or 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292961 - head/sys/fs/nullfs

2015-12-30 Thread Konstantin Belousov
Author: kib
Date: Wed Dec 30 19:49:22 2015
New Revision: 292961
URL: https://svnweb.freebsd.org/changeset/base/292961

Log:
  Force nullfs vnode reclaim after unlinking, to potentially unlink
  lower vnode.  Otherwise, reference to the lower vnode from the upper
  one prevents final unlink.
  
  PR:   178238
  Tested by:pho
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/sys/fs/nullfs/null_vnops.c

Modified: head/sys/fs/nullfs/null_vnops.c
==
--- head/sys/fs/nullfs/null_vnops.c Wed Dec 30 18:57:29 2015
(r292960)
+++ head/sys/fs/nullfs/null_vnops.c Wed Dec 30 19:49:22 2015
(r292961)
@@ -568,14 +568,16 @@ static int
 null_remove(struct vop_remove_args *ap)
 {
int retval, vreleit;
-   struct vnode *lvp;
+   struct vnode *lvp, *vp;
 
-   if (vrefcnt(ap->a_vp) > 1) {
-   lvp = NULLVPTOLOWERVP(ap->a_vp);
+   vp = ap->a_vp;
+   if (vrefcnt(vp) > 1) {
+   lvp = NULLVPTOLOWERVP(vp);
VREF(lvp);
vreleit = 1;
} else
vreleit = 0;
+   VTONULL(vp)->null_flags |= NULLV_DROP;
retval = null_bypass(&ap->a_gen);
if (vreleit != 0)
vrele(lvp);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292960 - head/sys/sparc64/include

2015-12-30 Thread Marius Strobl
Author: marius
Date: Wed Dec 30 18:57:29 2015
New Revision: 292960
URL: https://svnweb.freebsd.org/changeset/base/292960

Log:
  Change the - hopefully - last piece of ktr(9) to use PCPU_GET(cpuid)
  instead of the MD module ID for KTR_CPU.

Modified:
  head/sys/sparc64/include/ktr.h

Modified: head/sys/sparc64/include/ktr.h
==
--- head/sys/sparc64/include/ktr.h  Wed Dec 30 18:52:29 2015
(r292959)
+++ head/sys/sparc64/include/ktr.h  Wed Dec 30 18:57:29 2015
(r292960)
@@ -59,7 +59,7 @@ l2:   add r2, 1, r3 ; \
add r1, r2, r1 ; \
rd  %tick, r2 ; \
stx r2, [r1 + KTR_TIMESTAMP] ; \
-   lduw[PCPU(MID)], r2 ; \
+   lduw[PCPU(CPUID)], r2 ; \
stw r2, [r1 + KTR_CPU] ; \
stw %g0, [r1 + KTR_LINE] ; \
stx %g0, [r1 + KTR_FILE] ; \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r292914 - in head: tests/sys/kern tools/regression/sockets/unix_passfd

2015-12-30 Thread NGie Cooper

> On Dec 30, 2015, at 08:31, Bjoern A. Zeeb  wrote:
> 
>> 
>> On 30 Dec 2015, at 11:15 , Garrett Cooper  wrote:
>> 
>> Author: ngie
>> Date: Wed Dec 30 11:15:07 2015
>> New Revision: 292914
>> URL: https://svnweb.freebsd.org/changeset/base/292914
>> 
>> Log:
>> Integrate tools/regression/sockets/unix_passfd into the FreeBSD test
>> suite as tests/sys/kern/unix_passfd_test
>> 
>> - Convert testcases to ATF
>> - Fix an alignment issues
>> - Mark rights_creds_payload(..) as an expected failure (see PR # 181741)
>> 
>> Based [in part] on the following Differential Revision:
>> https://reviews.freebsd.org/D689
>> 
>> MFC after: 1 week
>> Submitted by: markj
>> Sponsored by: EMC / Isilon Storage Division
> 
> n all gcc platforms this fails:
> 
> /scratch/tmp/bz/head.svn/tests/sys/kern/unix_passfd_test.c: In function 
> 'sendfd':
> /scratch/tmp/bz/head.svn/tests/sys/kern/unix_passfd_test.c:146: warning: 
> declaration of 'sendfd' shadows a global declaration
> /scratch/tmp/bz/head.svn/tests/sys/kern/unix_passfd_test.c:147: warning: 
> shadowed declaration is here
> /scratch/tmp/bz/head.svn/tests/sys/kern/unix_passfd_test.c: In function 
> 'recvfd':
> /scratch/tmp/bz/head.svn/tests/sys/kern/unix_passfd_test.c:195: warning: 
> declaration of 'recvfd' shadows a global declaration
> /scratch/tmp/bz/head.svn/tests/sys/kern/unix_passfd_test.c:196: warning: 
> shadowed declaration is here

Ugh… yeah... I forgot about that (I did this work before in a different 
branch, but it got wiped out).
Thanks for the report! I’ve fixed it in r292957.
-NGie
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

svn commit: r292957 - head/tests/sys/kern

2015-12-30 Thread Garrett Cooper
Author: ngie
Date: Wed Dec 30 18:13:43 2015
New Revision: 292957
URL: https://svnweb.freebsd.org/changeset/base/292957

Log:
  Rename `recvfd` and `sendfd` variables in recvfd/sendfd functions to avoid
  -Wshadow issues with gcc
  
  MFC after: 1 week
  Reported by: bz, jenkins
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/tests/sys/kern/unix_passfd_test.c

Modified: head/tests/sys/kern/unix_passfd_test.c
==
--- head/tests/sys/kern/unix_passfd_test.c  Wed Dec 30 18:08:05 2015
(r292956)
+++ head/tests/sys/kern/unix_passfd_test.c  Wed Dec 30 18:13:43 2015
(r292957)
@@ -109,7 +109,7 @@ samefile(struct stat *sb1, struct stat *
 }
 
 static void
-sendfd_payload(int sockfd, int sendfd, void *payload, size_t paylen)
+sendfd_payload(int sockfd, int send_fd, void *payload, size_t paylen)
 {
struct iovec iovec;
char message[CMSG_SPACE(sizeof(int))];
@@ -133,7 +133,7 @@ sendfd_payload(int sockfd, int sendfd, v
cmsghdr->cmsg_len = CMSG_LEN(sizeof(int));
cmsghdr->cmsg_level = SOL_SOCKET;
cmsghdr->cmsg_type = SCM_RIGHTS;
-   memcpy(CMSG_DATA(cmsghdr), &sendfd, sizeof(int));
+   memcpy(CMSG_DATA(cmsghdr), &send_fd, sizeof(int));
 
len = sendmsg(sockfd, &msghdr, 0);
ATF_REQUIRE_MSG(len != -1, "sendmsg failed: %s", strerror(errno));
@@ -143,15 +143,15 @@ sendfd_payload(int sockfd, int sendfd, v
 }
 
 static void
-sendfd(int sockfd, int sendfd)
+sendfd(int sockfd, int send_fd)
 {
char ch = 0;
 
-   return (sendfd_payload(sockfd, sendfd, &ch, sizeof(ch)));
+   return (sendfd_payload(sockfd, send_fd, &ch, sizeof(ch)));
 }
 
 static void
-recvfd_payload(int sockfd, int *recvfd, void *buf, size_t buflen)
+recvfd_payload(int sockfd, int *recv_fd, void *buf, size_t buflen)
 {
struct cmsghdr *cmsghdr;
char message[CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)) + sizeof(int)];
@@ -178,25 +178,25 @@ recvfd_payload(int sockfd, int *recvfd, 
cmsghdr = CMSG_FIRSTHDR(&msghdr);
ATF_REQUIRE_MSG(cmsghdr != NULL,
"recvmsg: did not receive control message");
-   *recvfd = -1;
+   *recv_fd = -1;
for (; cmsghdr != NULL; cmsghdr = CMSG_NXTHDR(&msghdr, cmsghdr)) {
if (cmsghdr->cmsg_level == SOL_SOCKET &&
cmsghdr->cmsg_type == SCM_RIGHTS &&
cmsghdr->cmsg_len == CMSG_LEN(sizeof(int))) {
-   memcpy(recvfd, CMSG_DATA(cmsghdr), sizeof(int));
-   ATF_REQUIRE(*recvfd != -1);
+   memcpy(recv_fd, CMSG_DATA(cmsghdr), sizeof(int));
+   ATF_REQUIRE(*recv_fd != -1);
}
}
-   ATF_REQUIRE_MSG(*recvfd != -1,
+   ATF_REQUIRE_MSG(*recv_fd != -1,
"recvmsg: did not receive single-fd message");
 }
 
 static void
-recvfd(int sockfd, int *recvfd)
+recvfd(int sockfd, int *recv_fd)
 {
char ch = 0;
 
-   return (recvfd_payload(sockfd, recvfd, &ch, sizeof(ch)));
+   return (recvfd_payload(sockfd, recv_fd, &ch, sizeof(ch)));
 }
 
 /*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292956 - head/sys/netinet6

2015-12-30 Thread Jonathan T. Looney
Author: jtl
Date: Wed Dec 30 18:08:05 2015
New Revision: 292956
URL: https://svnweb.freebsd.org/changeset/base/292956

Log:
  Add the appropriate case statement for IPV6_BINDMULTI so the option can be
  retrieved with getsockopt().
  
  CID:  1229928
  Differential Revision:https://reviews.freebsd.org/D4737
  Reviewed by:  adrian
  Sponsored by: Juniper Networks

Modified:
  head/sys/netinet6/ip6_output.c

Modified: head/sys/netinet6/ip6_output.c
==
--- head/sys/netinet6/ip6_output.c  Wed Dec 30 18:04:50 2015
(r292955)
+++ head/sys/netinet6/ip6_output.c  Wed Dec 30 18:08:05 2015
(r292956)
@@ -1830,6 +1830,7 @@ do { \
case IPV6_RSSBUCKETID:
case IPV6_RECVRSSBUCKETID:
 #endif
+   case IPV6_BINDMULTI:
switch (optname) {
 
case IPV6_RECVHOPOPTS:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292955 - head/lib/libmd

2015-12-30 Thread Jonathan T. Looney
Author: jtl
Date: Wed Dec 30 18:04:50 2015
New Revision: 292955
URL: https://svnweb.freebsd.org/changeset/base/292955

Log:
  Fix a file descriptor leak in mdXhl.c (which is used by numerous hashing
  algorithms.
  
  CID:  1305669,1305611,1305663,1305603,1305584,1305639,1346865,1305601
  Differential Revision:https://reviews.freebsd.org/D4732
  Reviewed by:  allanjude, delphij
  MFC after:2 weeks
  Sponsored by: Juniper Networks

Modified:
  head/lib/libmd/mdXhl.c

Modified: head/lib/libmd/mdXhl.c
==
--- head/lib/libmd/mdXhl.c  Wed Dec 30 17:36:34 2015(r292954)
+++ head/lib/libmd/mdXhl.c  Wed Dec 30 18:04:50 2015(r292955)
@@ -59,14 +59,18 @@ MDXFileChunk(const char *filename, char 
f = open(filename, O_RDONLY);
if (f < 0)
return 0;
-   if (fstat(f, &stbuf) < 0)
-   return 0;
+   if (fstat(f, &stbuf) < 0) {
+   i = -1;
+   goto error;
+   }
if (ofs > stbuf.st_size)
ofs = stbuf.st_size;
if ((len == 0) || (len > stbuf.st_size - ofs))
len = stbuf.st_size - ofs;
-   if (lseek(f, ofs, SEEK_SET) < 0)
-   return 0;
+   if (lseek(f, ofs, SEEK_SET) < 0) {
+   i = -1;
+   goto error;
+   }
n = len;
i = 0;
while (n > 0) {
@@ -79,6 +83,7 @@ MDXFileChunk(const char *filename, char 
MDXUpdate(&ctx, buffer, i);
n -= i;
} 
+error:
e = errno;
close(f);
errno = e;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292954 - in head/sys/arm64: arm64 include

2015-12-30 Thread Andrew Turner
Author: andrew
Date: Wed Dec 30 17:36:34 2015
New Revision: 292954
URL: https://svnweb.freebsd.org/changeset/base/292954

Log:
  Decode and print the ID_AA64* registers on boot. These registers hold
  information on what the core supports. In most cases these will be
  identical across most CPUs in the SoC, however there may be the case where,
  with a big.LITTLE setup they may differ. In this case we print the
  decoded data on all CPUs.
  
  Reviewed by:  kib
  Sponsored by: ABT Systems Ltd
  Differential Revision:https://reviews.freebsd.org/D4725

Modified:
  head/sys/arm64/arm64/identcpu.c
  head/sys/arm64/arm64/mp_machdep.c
  head/sys/arm64/include/armreg.h
  head/sys/arm64/include/cpu.h

Modified: head/sys/arm64/arm64/identcpu.c
==
--- head/sys/arm64/arm64/identcpu.c Wed Dec 30 17:10:03 2015
(r292953)
+++ head/sys/arm64/arm64/identcpu.c Wed Dec 30 17:36:34 2015
(r292954)
@@ -37,9 +37,12 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
 #include 
 
+static int ident_lock;
+
 char machine[] = "arm64";
 
 SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0,
@@ -56,6 +59,7 @@ SYSCTL_STRING(_hw, HW_MACHINE, machine, 
  * Aff0 - CPU number in Aff1 cluster
  */
 uint64_t __cpu_affinity[MAXCPU];
+static u_int cpu_aff_levels;
 
 struct cpu_desc {
u_int   cpu_impl;
@@ -64,9 +68,32 @@ struct cpu_desc {
u_int   cpu_revision;
const char  *cpu_impl_name;
const char  *cpu_part_name;
+
+   uint64_tmpidr;
+   uint64_tid_aa64afr0;
+   uint64_tid_aa64afr1;
+   uint64_tid_aa64dfr0;
+   uint64_tid_aa64dfr1;
+   uint64_tid_aa64isar0;
+   uint64_tid_aa64isar1;
+   uint64_tid_aa64mmfr0;
+   uint64_tid_aa64mmfr1;
+   uint64_tid_aa64pfr0;
+   uint64_tid_aa64pfr1;
 };
 
 struct cpu_desc cpu_desc[MAXCPU];
+static u_int cpu_print_regs;
+#definePRINT_ID_AA64_AFR0  0x0001
+#definePRINT_ID_AA64_AFR1  0x0002
+#definePRINT_ID_AA64_DFR0  0x0004
+#definePRINT_ID_AA64_DFR1  0x0008
+#definePRINT_ID_AA64_ISAR0 0x0010
+#definePRINT_ID_AA64_ISAR1 0x0020
+#definePRINT_ID_AA64_MMFR0 0x0040
+#definePRINT_ID_AA64_MMFR1 0x0080
+#definePRINT_ID_AA64_PFR0  0x0100
+#definePRINT_ID_AA64_PFR1  0x0200
 
 struct cpu_parts {
u_int   part_id;
@@ -124,7 +151,398 @@ const struct cpu_implementers cpu_implem
CPU_IMPLEMENTER_NONE,
 };
 
-void identify_cpu(void);
+void
+print_cpu_features(u_int cpu)
+{
+   int printed;
+
+   printf("CPU%3d: %s %s r%dp%d", cpu, cpu_desc[cpu].cpu_impl_name,
+   cpu_desc[cpu].cpu_part_name, cpu_desc[cpu].cpu_variant,
+   cpu_desc[cpu].cpu_revision);
+
+   printf(" affinity:");
+   switch(cpu_aff_levels) {
+   default:
+   case 4:
+   printf(" %2d", CPU_AFF3(cpu_desc[cpu].mpidr));
+   /* FALLTHROUGH */
+   case 3:
+   printf(" %2d", CPU_AFF2(cpu_desc[cpu].mpidr));
+   /* FALLTHROUGH */
+   case 2:
+   printf(" %2d", CPU_AFF1(cpu_desc[cpu].mpidr));
+   /* FALLTHROUGH */
+   case 1:
+   case 0: /* On UP this will be zero */
+   printf(" %2d", CPU_AFF0(cpu_desc[cpu].mpidr));
+   break;
+   }
+   printf("\n");
+
+   if (cpu != 0 && cpu_print_regs == 0)
+   return;
+
+#define SEP_STR((printed++) == 0) ? "" : ","
+
+   /* AArch64 Instruction Set Attribute Register 0 */
+   if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_ISAR0) != 0) {
+   printed = 0;
+   printf(" Instruction Set Attributes 0 = <");
+   switch (ID_AA64ISAR0_AES(cpu_desc[cpu].id_aa64isar0)) {
+   case ID_AA64ISAR0_AES_NONE:
+   break;
+   case ID_AA64ISAR0_AES_BASE:
+   printf("%sAES", SEP_STR);
+   break;
+   case ID_AA64ISAR0_AES_PMULL:
+   printf("%sAES+PMULL", SEP_STR);
+   break;
+   default:
+   printf("%sUnknown AES", SEP_STR);
+   break;
+   }
+
+   switch (ID_AA64ISAR0_SHA1(cpu_desc[cpu].id_aa64isar0)) {
+   case ID_AA64ISAR0_SHA1_NONE:
+   break;
+   case ID_AA64ISAR0_SHA1_BASE:
+   printf("%sSHA1", SEP_STR);
+   break;
+   default:
+   printf("%sUnknown SHA1", SEP_STR);
+   break;
+   }
+
+   switch (ID_AA64ISAR0_SHA2(cpu_desc[cpu].id_aa64isar0)) {
+   cas

Re: svn commit: r292782 - in head: lib/libcrypt lib/libmd sbin/gbde sbin/geom/class/eli sbin/md5 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/conf sys/crypto/sha2 sys/dev/random sys/geom/bde sys

2015-12-30 Thread Oliver Pinter
On 12/27/15, Allan Jude  wrote:
> Author: allanjude
> Date: Sun Dec 27 17:33:59 2015
> New Revision: 292782
> URL: https://svnweb.freebsd.org/changeset/base/292782
>
> Log:
>   Replace sys/crypto/sha2/sha2.c with lib/libmd/sha512c.c
>
>   cperciva's libmd implementation is 5-30% faster
>
>   The same was done for SHA256 previously in r263218
>
>   cperciva's implementation was lacking SHA-384 which I implemented,
> validated against OpenSSL and the NIST documentation
>
>   Extend sbin/md5 to create sha384(1)
>
>   Chase dependancies on sys/crypto/sha2/sha2.{c,h} and replace them with
> sha512{c.c,.h}
>
>   Reviewed by:cperciva, des, delphij
>   Approved by:secteam, bapt (mentor)
>   MFC after:  2 weeks
>   Sponsored by:   ScaleEngine Inc.
>   Differential Revision:  https://reviews.freebsd.org/D3929
>
> Added:
>   head/sys/crypto/sha2/sha384.h   (contents, props changed)
>   head/sys/crypto/sha2/sha512.h
>  - copied, changed from r292757, head/lib/libmd/sha512.h
>   head/sys/crypto/sha2/sha512c.c
>  - copied, changed from r289398, head/lib/libmd/sha512c.c
> Deleted:
>   head/lib/libmd/sha512.h
>   head/lib/libmd/sha512c.c
>   head/sys/crypto/sha2/sha2.c
>   head/sys/crypto/sha2/sha2.h
> Modified:
>   head/lib/libcrypt/Makefile
>   head/lib/libmd/Makefile
>   head/lib/libmd/sha512.3
>   head/lib/libmd/shadriver.c
>   head/sbin/gbde/Makefile
>   head/sbin/gbde/gbde.c
>   head/sbin/geom/class/eli/Makefile
>   head/sbin/md5/Makefile
>   head/sbin/md5/md5.1
>   head/sbin/md5/md5.c
>   head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c
>   head/sys/conf/files
>   head/sys/crypto/sha2/sha256.h
>   head/sys/dev/random/build.sh
>   head/sys/dev/random/fortuna.c
>   head/sys/dev/random/hash.c
>   head/sys/dev/random/other_algorithm.c
>   head/sys/dev/random/randomdev.c
>   head/sys/dev/random/unit_test.c
>   head/sys/dev/random/yarrow.c
>   head/sys/geom/bde/g_bde.c
>   head/sys/geom/bde/g_bde_crypt.c
>   head/sys/geom/bde/g_bde_lock.c
>   head/sys/geom/bde/g_bde_work.c
>   head/sys/geom/eli/g_eli.h
>   head/sys/modules/crypto/Makefile
>   head/sys/modules/geom/geom_bde/Makefile
>   head/sys/modules/zfs/Makefile
>   head/sys/netinet/sctp_os_bsd.h
>   head/sys/opencrypto/xform.h
>
> Modified: head/lib/libcrypt/Makefile
>

Hi Allan!

Could you please bump __FreeBSD_version after this change? This breaks
the building of some external module, whose use the crypto/sha2/sha2.h
file.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292953 - head/sys/netinet6

2015-12-30 Thread Bjoern A. Zeeb
Author: bz
Date: Wed Dec 30 17:10:03 2015
New Revision: 292953
URL: https://svnweb.freebsd.org/changeset/base/292953

Log:
  This code is not in modules that need KPI stability so no need to use
  the wrapper functions as used in r252511.  We can directly use the
  locking macros.
  
  Reviewed by:  jtl, rwatson
  MFC after:2 weeks
  Differential Revision:https://reviews.freebsd.org/D4731

Modified:
  head/sys/netinet6/in6.c

Modified: head/sys/netinet6/in6.c
==
--- head/sys/netinet6/in6.c Wed Dec 30 16:42:09 2015(r292952)
+++ head/sys/netinet6/in6.c Wed Dec 30 17:10:03 2015(r292953)
@@ -1552,7 +1552,7 @@ in6ifa_llaonifp(struct ifnet *ifp)
 
if (ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED)
return (NULL);
-   if_addr_rlock(ifp);
+   IF_ADDR_RLOCK(ifp);
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
if (ifa->ifa_addr->sa_family != AF_INET6)
continue;
@@ -1562,7 +1562,7 @@ in6ifa_llaonifp(struct ifnet *ifp)
IN6_IS_ADDR_MC_NODELOCAL(&sin6->sin6_addr))
break;
}
-   if_addr_runlock(ifp);
+   IF_ADDR_RUNLOCK(ifp);
 
return ((struct in6_ifaddr *)ifa);
 }
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r292914 - in head: tests/sys/kern tools/regression/sockets/unix_passfd

2015-12-30 Thread Bjoern A. Zeeb

> On 30 Dec 2015, at 11:15 , Garrett Cooper  wrote:
> 
> Author: ngie
> Date: Wed Dec 30 11:15:07 2015
> New Revision: 292914
> URL: https://svnweb.freebsd.org/changeset/base/292914
> 
> Log:
>  Integrate tools/regression/sockets/unix_passfd into the FreeBSD test
>  suite as tests/sys/kern/unix_passfd_test
> 
>  - Convert testcases to ATF
>  - Fix an alignment issues
>  - Mark rights_creds_payload(..) as an expected failure (see PR # 181741)
> 
>  Based [in part] on the following Differential Revision:
>  https://reviews.freebsd.org/D689
> 
>  MFC after: 1 week
>  Submitted by: markj
>  Sponsored by: EMC / Isilon Storage Division

n all gcc platforms this fails:

/scratch/tmp/bz/head.svn/tests/sys/kern/unix_passfd_test.c: In function 
'sendfd':
/scratch/tmp/bz/head.svn/tests/sys/kern/unix_passfd_test.c:146: warning: 
declaration of 'sendfd' shadows a global declaration
/scratch/tmp/bz/head.svn/tests/sys/kern/unix_passfd_test.c:147: warning: 
shadowed declaration is here
/scratch/tmp/bz/head.svn/tests/sys/kern/unix_passfd_test.c: In function 
'recvfd':
/scratch/tmp/bz/head.svn/tests/sys/kern/unix_passfd_test.c:195: warning: 
declaration of 'recvfd' shadows a global declaration
/scratch/tmp/bz/head.svn/tests/sys/kern/unix_passfd_test.c:196: warning: 
shadowed declaration is here

___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292950 - in head: contrib/llvm/patches contrib/llvm/tools/clang/tools/driver usr.bin/clang/clang

2015-12-30 Thread Dimitry Andric
Author: dim
Date: Wed Dec 30 16:14:30 2015
New Revision: 292950
URL: https://svnweb.freebsd.org/changeset/base/292950

Log:
  Drop the clang patch which adds recognition of 'CC' suffixes as aliases
  for --driver-mode=g++, since this was never upstreamed.  For backwards
  compatibility, add a wrapper shell script.
  
  MFC after:1 week

Added:
  head/usr.bin/clang/clang/CC.sh   (contents, props changed)
Deleted:
  head/contrib/llvm/patches/patch-02-add-CC-aliases.diff
Modified:
  head/contrib/llvm/tools/clang/tools/driver/driver.cpp
  head/usr.bin/clang/clang/Makefile

Modified: head/contrib/llvm/tools/clang/tools/driver/driver.cpp
==
--- head/contrib/llvm/tools/clang/tools/driver/driver.cpp   Wed Dec 30 
15:01:47 2015(r292949)
+++ head/contrib/llvm/tools/clang/tools/driver/driver.cpp   Wed Dec 30 
16:14:30 2015(r292950)
@@ -214,13 +214,11 @@ static const DriverSuffix *FindDriverSuf
   {"clang", nullptr},
   {"clang++", "--driver-mode=g++"},
   {"clang-c++", "--driver-mode=g++"},
-  {"clang-CC", "--driver-mode=g++"},
   {"clang-cc", nullptr},
   {"clang-cpp", "--driver-mode=cpp"},
   {"clang-g++", "--driver-mode=g++"},
   {"clang-gcc", nullptr},
   {"clang-cl", "--driver-mode=cl"},
-  {"CC", "--driver-mode=g++"},
   {"cc", nullptr},
   {"cpp", "--driver-mode=cpp"},
   {"cl", "--driver-mode=cl"},

Added: head/usr.bin/clang/clang/CC.sh
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/clang/clang/CC.sh  Wed Dec 30 16:14:30 2015
(r292950)
@@ -0,0 +1,4 @@
+#!/bin/sh
+# $FreeBSD$
+# This file is in the public domain.
+exec /usr/bin/c++ "$@"

Modified: head/usr.bin/clang/clang/Makefile
==
--- head/usr.bin/clang/clang/Makefile   Wed Dec 30 15:01:47 2015
(r292949)
+++ head/usr.bin/clang/clang/Makefile   Wed Dec 30 16:14:30 2015
(r292950)
@@ -18,9 +18,11 @@ LINKS=   ${BINDIR}/clang ${BINDIR}/clang++
 MLINKS=clang.1 clang++.1 \
clang.1 clang-cpp.1
 .if ${MK_CLANG_IS_CC} != "no"
+SCRIPTS=CC.sh
+SCRIPTSNAME=CC
+
 LINKS+=${BINDIR}/clang ${BINDIR}/cc \
${BINDIR}/clang ${BINDIR}/c++ \
-   ${BINDIR}/clang ${BINDIR}/CC \
${BINDIR}/clang ${BINDIR}/cpp
 MLINKS+= clang.1 cc.1 \
clang.1 c++.1 \
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r289421 - in head/etc: . mtree ntp

2015-12-30 Thread Ian Lepore
On Wed, 2015-12-30 at 04:50 -0800, Colin Percival wrote:
> On 10/16/15 07:04, Cy Schubert wrote:
> >   Add default leap-seconds file. This should help ntp networks get
> > the
> >   leap second date correct
> >   
> > Added:
> >   head/etc/ntp/
> >   head/etc/ntp/Makefile   (contents, props changed)
> >   head/etc/ntp/leap-seconds   (contents, props changed)
> 
> So... is someone going to be keeping this file up to date?  We seem
> to have
> the same information in contrib/tzdata/leapseconds (which is being
> kept up
> to date -- thank you edwin and delphij!) but having this file in
> /etc/ntp/
> being out of date is making ntpd refuse to start.
> 

I vaguely remember warning that something like this was likely to
happen.  Turning on leapfile processing by default without an already
-in-place mechanism to keep the file up to date was a bad idea.  There
was some mumbling about a mechanism, but nobody wrote any code.

Even if the mechanism existed, I think defaulting to using the leapfile
is wrong.  It's a thing that needs care and feeding or it causes
problems, and thus it's a thing that should only be enabled by admins
who know about the care and feeding aspect (an automatic fetch
mechanism doesn't help much if there are firewalls blocking the fetch,
for example).

-- Ian
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292949 - head/sys/dev/mlx5/mlx5_en

2015-12-30 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Dec 30 15:01:47 2015
New Revision: 292949
URL: https://svnweb.freebsd.org/changeset/base/292949

Log:
  Add support for modifying coalescing parameters runtime.
  
  MFC after:1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_en/en.h
  head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c

Modified: head/sys/dev/mlx5/mlx5_en/en.h
==
--- head/sys/dev/mlx5/mlx5_en/en.h  Wed Dec 30 14:58:55 2015
(r292948)
+++ head/sys/dev/mlx5/mlx5_en/en.h  Wed Dec 30 15:01:47 2015
(r292949)
@@ -787,5 +787,6 @@ voidmlx5e_create_stats(struct sysctl_ct
 struct sysctl_oid_list *, const char *,
 const char **, unsigned, u64 *);
 void   mlx5e_send_nop(struct mlx5e_sq *, u32, bool);
+intmlx5e_refresh_channel_params(struct mlx5e_priv *);
 
 #endif /* _MLX5_EN_H_ */

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Dec 30 14:58:55 2015
(r292948)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Dec 30 15:01:47 2015
(r292949)
@@ -69,12 +69,49 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG
} else {
error = 0;
}
-
/* check if device is gone */
if (priv->gone) {
error = ENXIO;
goto done;
}
+   /* import RX coal time */
+   if (priv->params_ethtool.rx_coalesce_usecs < 1)
+   priv->params_ethtool.rx_coalesce_usecs = 0;
+   else if (priv->params_ethtool.rx_coalesce_usecs >
+   MLX5E_FLD_MAX(cqc, cq_period)) {
+   priv->params_ethtool.rx_coalesce_usecs =
+   MLX5E_FLD_MAX(cqc, cq_period);
+   }
+   priv->params.rx_cq_moderation_usec = 
priv->params_ethtool.rx_coalesce_usecs;
+
+   /* import RX coal pkts */
+   if (priv->params_ethtool.rx_coalesce_pkts < 1)
+   priv->params_ethtool.rx_coalesce_pkts = 0;
+   else if (priv->params_ethtool.rx_coalesce_pkts >
+   MLX5E_FLD_MAX(cqc, cq_max_count)) {
+   priv->params_ethtool.rx_coalesce_pkts =
+   MLX5E_FLD_MAX(cqc, cq_max_count);
+   }
+   priv->params.rx_cq_moderation_pkts = 
priv->params_ethtool.rx_coalesce_pkts;
+
+   /* import TX coal time */
+   if (priv->params_ethtool.tx_coalesce_usecs < 1)
+   priv->params_ethtool.tx_coalesce_usecs = 0;
+   else if (priv->params_ethtool.tx_coalesce_usecs >
+   MLX5E_FLD_MAX(cqc, cq_period)) {
+   priv->params_ethtool.tx_coalesce_usecs =
+   MLX5E_FLD_MAX(cqc, cq_period);
+   }
+   priv->params.tx_cq_moderation_usec = 
priv->params_ethtool.tx_coalesce_usecs;
+
+   /* import TX coal pkts */
+   if (priv->params_ethtool.tx_coalesce_pkts < 1)
+   priv->params_ethtool.tx_coalesce_pkts = 0;
+   else if (priv->params_ethtool.tx_coalesce_pkts >
+   MLX5E_FLD_MAX(cqc, cq_max_count)) {
+   priv->params_ethtool.tx_coalesce_pkts = MLX5E_FLD_MAX(cqc, 
cq_max_count);
+   }
+   priv->params.tx_cq_moderation_pkts = 
priv->params_ethtool.tx_coalesce_pkts;
 
if (&priv->params_ethtool.arg[arg2] == 
&priv->params_ethtool.rx_pauseframe_control ||
&priv->params_ethtool.arg[arg2] == 
&priv->params_ethtool.tx_pauseframe_control) {
@@ -92,9 +129,19 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG
}
 
was_opened = test_bit(MLX5E_STATE_OPENED, &priv->state);
-   if (was_opened)
-   mlx5e_close_locked(priv->ifp);
+   if (was_opened) {
+   u64 *xarg = priv->params_ethtool.arg + arg2;
 
+   if (xarg == &priv->params_ethtool.tx_coalesce_pkts ||
+   xarg == &priv->params_ethtool.rx_coalesce_pkts ||
+   xarg == &priv->params_ethtool.tx_coalesce_usecs ||
+   xarg == &priv->params_ethtool.rx_coalesce_usecs) {
+   /* avoid downing and upping the network interface */
+   error = mlx5e_refresh_channel_params(priv);
+   goto done;
+   }
+   mlx5e_close_locked(priv->ifp);
+   }
/* import TX queue size */
if (priv->params_ethtool.tx_queue_size <
(1 << MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)) {
@@ -145,45 +192,6 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG
priv->params_ethtool.tx_coalesce_mode = 1;
priv->params.tx_cq_moderation_mode = 
priv->params_ethtool.tx_coalesce_mode;
 
-   /* import RX coal time */
-   if (priv->params_ethtool.rx_coalesce_usecs < 1)
-   priv->params_ethtool.rx_coalesce_usecs = 0;
-   else if (priv->params_ethtool.rx_coalesce_usecs >
-   MLX5E_FLD_MAX(cqc, cq_perio

svn commit: r292948 - head/sys/dev/mlx5/mlx5_en

2015-12-30 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Dec 30 14:58:55 2015
New Revision: 292948
URL: https://svnweb.freebsd.org/changeset/base/292948

Log:
  Allow I2C to read address 0x51 as well as address 0x50.
  
  MFC after:1 week
  Submitted by: Shahar Klein 
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cWed Dec 30 14:57:42 2015
(r292947)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cWed Dec 30 14:58:55 2015
(r292948)
@@ -2298,6 +2298,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long co
int size_read = 0;
int module_num;
int max_mtu;
+   uint8_t read_addr;
 
priv = ifp->if_softc;
 
@@ -2484,11 +2485,21 @@ out:
}
 
/*
-* Note that we ignore i2c.addr here. The driver hardcodes
-* the address to 0x50, while standard expects it to be 0xA0.
+* Currently 0XA0 and 0xA2 are the only addresses permitted.
+* The internal conversion is as follows:
 */
+   if (i2c.dev_addr == 0xA0)
+   read_addr = MLX5E_I2C_ADDR_LOW;
+   else if (i2c.dev_addr == 0xA2)
+   read_addr = MLX5E_I2C_ADDR_HIGH;
+   else {
+   if_printf(ifp, "Query eeprom failed, "
+   "Invalid Address: %X\n", i2c.dev_addr);
+   error = EINVAL;
+   goto err_i2c;
+   }
error = mlx5_query_eeprom(priv->mdev,
-   MLX5E_I2C_ADDR_LOW, MLX5E_EEPROM_LOW_PAGE,
+   read_addr, MLX5E_EEPROM_LOW_PAGE,
(uint32_t)i2c.offset, (uint32_t)i2c.len, module_num,
(uint32_t *)i2c.data, &size_read);
if (error) {
@@ -2499,7 +2510,7 @@ out:
 
if (i2c.len > MLX5_EEPROM_MAX_BYTES) {
error = mlx5_query_eeprom(priv->mdev,
-   MLX5E_I2C_ADDR_LOW, MLX5E_EEPROM_LOW_PAGE,
+   read_addr, MLX5E_EEPROM_LOW_PAGE,
(uint32_t)(i2c.offset + size_read),
(uint32_t)(i2c.len - size_read), module_num,
(uint32_t *)(i2c.data + size_read), &size_read);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292947 - head/sbin/reboot

2015-12-30 Thread Steven Hartland
Author: smh
Date: Wed Dec 30 14:57:42 2015
New Revision: 292947
URL: https://svnweb.freebsd.org/changeset/base/292947

Log:
  Fix use of uninitialised Nflag
  
  Initialise Nflag to 0 preventing use of uninitialised value.
  
  Reported by:  uqs
  MFC after:1 week
  X-MFC-With:   r292266
  Sponsored by: Multiplay
  Differential Revision:https://reviews.freebsd.org/D4449

Modified:
  head/sbin/reboot/reboot.c

Modified: head/sbin/reboot/reboot.c
==
--- head/sbin/reboot/reboot.c   Wed Dec 30 14:54:08 2015(r292946)
+++ head/sbin/reboot/reboot.c   Wed Dec 30 14:57:42 2015(r292947)
@@ -76,7 +76,7 @@ main(int argc, char *argv[])
howto = RB_HALT;
} else
howto = 0;
-   lflag = nflag = qflag = 0;
+   lflag = nflag = qflag = Nflag = 0;
while ((ch = getopt(argc, argv, "dk:lNnpqr")) != -1)
switch(ch) {
case 'd':
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292946 - head/sys/dev/mlx5/mlx5_en

2015-12-30 Thread Hans Petter Selasky
Author: hselasky
Date: Wed Dec 30 14:54:08 2015
New Revision: 292946
URL: https://svnweb.freebsd.org/changeset/base/292946

Log:
  10G ER/LR should present itself as LR.
  
  MFC after:1 week
  Submitted by: Shahar Klein 
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_en/en.h
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c

Modified: head/sys/dev/mlx5/mlx5_en/en.h
==
--- head/sys/dev/mlx5/mlx5_en/en.h  Wed Dec 30 14:06:01 2015
(r292945)
+++ head/sys/dev/mlx5/mlx5_en/en.h  Wed Dec 30 14:54:08 2015
(r292946)
@@ -698,7 +698,7 @@ enum mlx5e_link_mode {
MLX5E_56GBASE_R4 = 8,
MLX5E_10GBASE_CR = 12,
MLX5E_10GBASE_SR = 13,
-   MLX5E_10GBASE_ER = 14,
+   MLX5E_10GBASE_LR = 14,
MLX5E_40GBASE_SR4 = 15,
MLX5E_40GBASE_LR4 = 16,
MLX5E_100GBASE_CR4 = 20,

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cWed Dec 30 14:06:01 2015
(r292945)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.cWed Dec 30 14:54:08 2015
(r292946)
@@ -106,8 +106,8 @@ static const struct {
.subtype = IFM_10G_SR,
.baudrate = IF_Gbps(10ULL),
},
-   [MLX5E_10GBASE_ER] = {
-   .subtype = IFM_10G_ER,
+   [MLX5E_10GBASE_LR] = {
+   .subtype = IFM_10G_LR,
.baudrate = IF_Gbps(10ULL),
},
[MLX5E_40GBASE_SR4] = {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292943 - in head/sys: kern sparc64/include sparc64/sparc64

2015-12-30 Thread Marius Strobl
Author: marius
Date: Wed Dec 30 13:49:20 2015
New Revision: 292943
URL: https://svnweb.freebsd.org/changeset/base/292943

Log:
  - (Ab)use udivx for dividing the u_int pc_cpuid when implementing
CPU_ISSET(), CPU_SET etc. in sparc64 asm. This approach has the
benefit of not clobbering %y, allowing to revert r222827 and
partially r222828.
  - In r222828, CATR() already was changed to use the equivalent of
PCPU_GET(cpuid) instead of the MD module ID for KTR_CPU, so
belatedly also catch up with the C side of ktr(9). Originally,
in r203838 CATR() was moved away from directly reading the
module ID or equivalent as that became impractical with other
CPU types than USI/II supported. With r222828 in place, per-CPU
data generally is set up soon enough, though, that employing
PCPU things in ktr(9) also for use during early stages works.
  - Unfortunately, an exception to the latter is the ktr(9) use
in pmap_bootstrap(), which actually is run so early that even
checking for bootverbose being set via the loader doesn't work.
Consequently, replace the ktr(9) use in pmap_bootstrap() with
OF_printf(9) and put it under #ifdef DIAGNOSTIC instead.
  
  MFC after:3 days

Modified:
  head/sys/kern/kern_ktr.c
  head/sys/sparc64/include/ktr.h
  head/sys/sparc64/sparc64/exception.S
  head/sys/sparc64/sparc64/mp_exception.S
  head/sys/sparc64/sparc64/pmap.c
  head/sys/sparc64/sparc64/swtch.S

Modified: head/sys/kern/kern_ktr.c
==
--- head/sys/kern/kern_ktr.cWed Dec 30 13:34:49 2015(r292942)
+++ head/sys/kern/kern_ktr.cWed Dec 30 13:49:20 2015(r292943)
@@ -55,9 +55,6 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#ifdef __sparc64__
-#include 
-#endif
 
 #ifdef DDB
 #include 

Modified: head/sys/sparc64/include/ktr.h
==
--- head/sys/sparc64/include/ktr.h  Wed Dec 30 13:34:49 2015
(r292942)
+++ head/sys/sparc64/include/ktr.h  Wed Dec 30 13:49:20 2015
(r292943)
@@ -34,14 +34,10 @@
 
 #include 
 
-#ifndef LOCORE
-
-#defineKTR_CPU PCPU_GET(mid)
-
-#else
+#ifdef LOCORE
 
 /*
- * XXX could really use another register...
+ * XXX could really use another register ...
  */
 #defineATR(desc, r1, r2, r3, l1, l2) \
.sect   .rodata ; \
@@ -70,9 +66,6 @@ l2:   add r2, 1, r3 ; \
SET(l1 ## b, r3, r2) ; \
stx r2, [r1 + KTR_DESC]
 
-/*
- * NB: this clobbers %y.
- */
 #define CATR(mask, desc, r1, r2, r3, l1, l2, l3) \
setxmask, r3, r1 ; \
setxktr_mask, r3, r2 ; \
@@ -82,16 +75,14 @@ l2: add r2, 1, r3 ; \
 nop ; \
lduw[PCPU(CPUID)], r2 ; \
mov _NCPUBITS, r3 ; \
-   mov %g0, %y ; \
-   udivr2, r3, r2 ; \
+   udivx   r2, r3, r2 ; \
srl r2, 0, r2 ; \
sllxr2, PTR_SHIFT, r2 ; \
SET(ktr_cpumask, r3, r1) ; \
ldx [r1 + r2], r1 ; \
lduw[PCPU(CPUID)], r2 ; \
mov _NCPUBITS, r3 ; \
-   mov %g0, %y ; \
-   udivr2, r3, r2 ; \
+   udivx   r2, r3, r2 ; \
srl r2, 0, r2 ; \
smulr2, r3, r3 ; \
lduw[PCPU(CPUID)], r2 ; \

Modified: head/sys/sparc64/sparc64/exception.S
==
--- head/sys/sparc64/sparc64/exception.SWed Dec 30 13:34:49 2015
(r292942)
+++ head/sys/sparc64/sparc64/exception.SWed Dec 30 13:49:20 2015
(r292943)
@@ -2628,9 +2628,9 @@ ENTRY(tl0_ret)
andn%l4, TSTATE_CWP_MASK, %g2
 
/*
-* Save %y in an alternate global.
+* Restore %y.  Could also be below if we had more alternate globals.
 */
-   mov %l5, %g4
+   wr  %l5, 0, %y
 
/*
 * Setup %wstate for return.  We need to restore the user window state
@@ -2675,8 +2675,8 @@ tl0_ret_fill:
 * Fixup %tstate so the saved %cwp points to the current window and
 * restore it.
 */
-   rdpr%cwp, %g1
-   wrpr%g2, %g1, %tstate
+   rdpr%cwp, %g4
+   wrpr%g2, %g4, %tstate
 
/*
 * Restore the user window state.  The transition bit was set above
@@ -2686,25 +2686,20 @@ tl0_ret_fill:
 
 #if KTR_COMPILE & KTR_TRAP
CATR(KTR_TRAP, "tl0_ret: td=%#lx pil=%#lx pc=%#lx npc=%#lx sp=%#lx"
-   , %g1, %g2, %g3, 7, 8, 9)
-   ldx [PCPU(CURTHREAD)], %g2
-   stx %g2, [%g1 + KTR_PARM1]
-   rdpr%pil, %g2
-   stx %g2, [%g1 + KTR_PARM2]
-   rdpr%tpc, %g2
-   stx %g2, [%g1 + KTR_PARM3]
-   rdpr%tnpc, %g2
-   stx %g2, [%g1 + KTR_PARM4]
-   stx %sp, [%g1 + KTR_PARM5]
+   , %g2, %g3, %g4, 7, 8, 9)
+   ldx [PCPU(CURTHREAD)], %g3
+   stx %g3, [%g2 + KTR_PARM1]
+   rdpr%pil, %g3
+  

Re: svn commit: r289421 - in head/etc: . mtree ntp

2015-12-30 Thread Colin Percival
On 10/16/15 07:04, Cy Schubert wrote:
>   Add default leap-seconds file. This should help ntp networks get the
>   leap second date correct
>   
> Added:
>   head/etc/ntp/
>   head/etc/ntp/Makefile   (contents, props changed)
>   head/etc/ntp/leap-seconds   (contents, props changed)

So... is someone going to be keeping this file up to date?  We seem to have
the same information in contrib/tzdata/leapseconds (which is being kept up
to date -- thank you edwin and delphij!) but having this file in /etc/ntp/
being out of date is making ntpd refuse to start.

-- 
Colin Percival
Security Officer Emeritus, FreeBSD | The power to serve
Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r292914 - in head: tests/sys/kern tools/regression/sockets/unix_passfd

2015-12-30 Thread Garrett Cooper
Author: ngie
Date: Wed Dec 30 11:15:07 2015
New Revision: 292914
URL: https://svnweb.freebsd.org/changeset/base/292914

Log:
  Integrate tools/regression/sockets/unix_passfd into the FreeBSD test
  suite as tests/sys/kern/unix_passfd_test
  
  - Convert testcases to ATF
  - Fix an alignment issues
  - Mark rights_creds_payload(..) as an expected failure (see PR # 181741)
  
  Based [in part] on the following Differential Revision:
  https://reviews.freebsd.org/D689
  
  MFC after: 1 week
  Submitted by: markj
  Sponsored by: EMC / Isilon Storage Division

Added:
  head/tests/sys/kern/unix_passfd_test.c
 - copied, changed from r292913, 
head/tools/regression/sockets/unix_passfd/unix_passfd.c
Deleted:
  head/tools/regression/sockets/unix_passfd/
Modified:
  head/tests/sys/kern/Makefile

Modified: head/tests/sys/kern/Makefile
==
--- head/tests/sys/kern/MakefileWed Dec 30 10:23:25 2015
(r292913)
+++ head/tests/sys/kern/MakefileWed Dec 30 11:15:07 2015
(r292914)
@@ -8,6 +8,7 @@ ATF_TESTS_C+=   kern_copyin
 ATF_TESTS_C+=  kern_descrip_test
 ATF_TESTS_C+=  ptrace_test
 ATF_TESTS_C+=  unix_seqpacket_test
+ATF_TESTS_C+=  unix_passfd_test
 TEST_METADATA.unix_seqpacket_test+=timeout="15"
 
 LIBADD.ptrace_test+=   pthread

Copied and modified: head/tests/sys/kern/unix_passfd_test.c (from r292913, 
head/tools/regression/sockets/unix_passfd/unix_passfd.c)
==
--- head/tools/regression/sockets/unix_passfd/unix_passfd.c Wed Dec 30 
10:23:25 2015(r292913, copy source)
+++ head/tests/sys/kern/unix_passfd_test.c  Wed Dec 30 11:15:07 2015
(r292914)
@@ -33,7 +33,7 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -41,6 +41,8 @@
 #include 
 #include 
 
+#include 
+
 /*
  * UNIX domain sockets allow file descriptors to be passed via "ancillary
  * data", or control messages.  This regression test is intended to exercise
@@ -51,11 +53,11 @@
  */
 
 static void
-domainsocketpair(const char *test, int *fdp)
+domainsocketpair(int *fdp)
 {
 
-   if (socketpair(PF_UNIX, SOCK_STREAM, 0, fdp) < 0)
-   err(-1, "%s: socketpair(PF_UNIX, SOCK_STREAM)", test);
+   ATF_REQUIRE_MSG(socketpair(PF_UNIX, SOCK_STREAM, 0, fdp) != -1,
+   "socketpair(PF_UNIX, SOCK_STREAM) failed: %s", strerror(errno));
 }
 
 static void
@@ -67,51 +69,47 @@ closesocketpair(int *fdp)
 }
 
 static void
-devnull(const char *test, int *fdp)
+devnull(int *fdp)
 {
int fd;
 
fd = open("/dev/null", O_RDONLY);
-   if (fd < 0)
-   err(-1, "%s: open(/dev/null)", test);
+   ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
*fdp = fd;
 }
 
 static void
-tempfile(const char *test, int *fdp)
+tempfile(int *fdp)
 {
char path[PATH_MAX];
int fd;
 
-   snprintf(path, PATH_MAX, "/tmp/unix_passfd.XXX");
+   snprintf(path, PATH_MAX, "%s/unix_passfd.XXX",
+   getenv("TMPDIR") == NULL ? "/tmp" : getenv("TMPDIR"));
fd = mkstemp(path);
-   if (fd < 0)
-   err(-1, "%s: mkstemp(%s)", test, path);
+   ATF_REQUIRE_MSG(fd != -1, "mkstemp(%s) failed", path);
(void)unlink(path);
*fdp = fd;
 }
 
 static void
-dofstat(const char *test, int fd, struct stat *sb)
+dofstat(int fd, struct stat *sb)
 {
 
-   if (fstat(fd, sb) < 0)
-   err(-1, "%s: fstat", test);
+   ATF_REQUIRE_MSG(fstat(fd, sb) == 0,
+   "fstat failed: %s", strerror(errno));
 }
 
 static void
-samefile(const char *test, struct stat *sb1, struct stat *sb2)
+samefile(struct stat *sb1, struct stat *sb2)
 {
 
-   if (sb1->st_dev != sb2->st_dev)
-   errx(-1, "%s: samefile: different device", test);
-   if (sb1->st_ino != sb2->st_ino)
-   errx(-1, "%s: samefile: different inode", test);
+   ATF_REQUIRE_MSG(sb1->st_dev == sb2->st_dev, "different device");
+   ATF_REQUIRE_MSG(sb1->st_ino == sb2->st_ino, "different inode");
 }
 
 static void
-sendfd_payload(const char *test, int sockfd, int sendfd,
-void *payload, size_t paylen)
+sendfd_payload(int sockfd, int sendfd, void *payload, size_t paylen)
 {
struct iovec iovec;
char message[CMSG_SPACE(sizeof(int))];
@@ -131,30 +129,29 @@ sendfd_payload(const char *test, int soc
msghdr.msg_iov = &iovec;
msghdr.msg_iovlen = 1;
 
-   cmsghdr = (struct cmsghdr *)message;
+   cmsghdr = (struct cmsghdr *)(void*)message;
cmsghdr->cmsg_len = CMSG_LEN(sizeof(int));
cmsghdr->cmsg_level = SOL_SOCKET;
cmsghdr->cmsg_type = SCM_RIGHTS;
-   *(int *)CMSG_DATA(cmsghdr) = sendfd;
+   memcpy(CMSG_DATA(cmsghdr), &sendfd, sizeof(int));
 
len = sendmsg(sockfd, &msghdr, 0);
-   if (len < 0)
-   err(-1, "%s: sendmsg", test

svn commit: r292911 - head

2015-12-30 Thread Dimitry Andric
Author: dim
Date: Wed Dec 30 09:15:02 2015
New Revision: 292911
URL: https://svnweb.freebsd.org/changeset/base/292911

Log:
  Add some more obsolete files, left over from the clang 3.7.0 -> 3.7.1
  upgrade.
  
  Noticed by:   Nikolai Lifanov , jtl

Modified:
  head/ObsoleteFiles.inc

Modified: head/ObsoleteFiles.inc
==
--- head/ObsoleteFiles.inc  Wed Dec 30 09:02:03 2015(r292910)
+++ head/ObsoleteFiles.inc  Wed Dec 30 09:15:02 2015(r292911)
@@ -105,6 +105,8 @@ OLD_FILES+=usr/lib/clang/3.7.0/include/x
 OLD_FILES+=usr/lib/clang/3.7.0/include/xtestintrin.h
 OLD_DIRS+=usr/lib/clang/3.7.0/include
 OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.asan-i386.a
+OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.asan-preinit-i386.a
+OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.asan-preinit-x86_64.a
 OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.asan-x86_64.a
 OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.asan_cxx-i386.a
 OLD_FILES+=usr/lib/clang/3.7.0/lib/freebsd/libclang_rt.asan_cxx-x86_64.a
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"