Re: svn commit: r228514 - head/sys/net80211

2011-12-15 Thread Bernhard Schmidt
On Thu, Dec 15, 2011 at 01:52, Adrian Chadd adr...@freebsd.org wrote:
 Author: adrian
 Date: Thu Dec 15 00:52:30 2011
 New Revision: 228514
 URL: http://svn.freebsd.org/changeset/base/228514

 Log:
  Modify the ACL code slightly to support a few nifty things:

  * Call it before sending probe responses, so the ACL code has the
    chance to reject sending them.

  * Pass the whole frame to the ACL code now, rather than just the
    destination MAC - that way the ACL module can look at the frame
    contents to determine what the response should be.

  This is part of some uncommitted work to support band steering.

  Sponsored by: Hobnob, Inc.

 Modified:
  head/sys/net80211/ieee80211_acl.c
  head/sys/net80211/ieee80211_hostap.c
  head/sys/net80211/ieee80211_mesh.c
  head/sys/net80211/ieee80211_proto.h

 Modified: head/sys/net80211/ieee80211_acl.c
 ==
 --- head/sys/net80211/ieee80211_acl.c   Wed Dec 14 23:57:47 2011        
 (r228513)
 +++ head/sys/net80211/ieee80211_acl.c   Thu Dec 15 00:52:30 2011        
 (r228514)
 @@ -152,7 +152,8 @@ _acl_free(struct aclstate *as, struct ac
  }

  static int
 -acl_check(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
 +acl_check(struct ieee80211vap *vap, const struct ieee80211_frame *wh,
 +    const uint8_t mac[IEEE80211_ADDR_LEN])
  {

Why didn't you remove the mac argument? It is assign from wh-i_addr2
anyways, seems rather too redundant to me.

-- 
Bernhard
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r228509 - in head: share/man/man9 sys/kern sys/sys

2011-12-15 Thread Kostik Belousov
 + switch (rv) {
 + case KERN_INVALID_ADDRESS:
 + case KERN_NO_SPACE:
 + return (ENOMEM);
 + case KERN_PROTECTION_FAILURE:
 + return (EACCES);
 + default:
 + return (EINVAL);
 + }

You can replace this fragment with the call to vm_mmap_to_errno().


pgp1uUD1pDFAy.pgp
Description: PGP signature


Re: svn commit: r228514 - head/sys/net80211

2011-12-15 Thread Adrian Chadd
On 15 December 2011 00:02, Bernhard Schmidt bschm...@freebsd.org wrote:

 Why didn't you remove the mac argument? It is assign from wh-i_addr2
 anyways, seems rather too redundant to me.

Because the semantics for that right now are check that MAC, so it's
the callers responsibility to determine which MAC in the header is the
relevant one to check against.

They're all addr2 though, and I haven't yet thought of a reason it
could be addr1 or addr3 (or addr4, for that matter); I just decided to
leave it this way so the semantics of the caller dictates which MAC
in the frame is the relevant one to check against as-is.

If you think that's me being a bit overly anal about it, then sure,
please go ahead and turf it. :)

Personally, I'd like to add an enum field (and then remove the MAC) -
the enum field would indicate to acl_check() _which_ ACL is being
checked - ie, probe request, association request, and any other frame
check request. That way it's precisely clear what the ACL check is
for. But again, that's just me being overly picky. :)

So in short: if you're happy removing it, remove it. :)


Adrian
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r228514 - head/sys/net80211

2011-12-15 Thread Bernhard Schmidt
On Thu, Dec 15, 2011 at 10:35, Adrian Chadd adr...@freebsd.org wrote:
 On 15 December 2011 00:02, Bernhard Schmidt bschm...@freebsd.org wrote:

 Why didn't you remove the mac argument? It is assign from wh-i_addr2
 anyways, seems rather too redundant to me.

 Because the semantics for that right now are check that MAC, so it's
 the callers responsibility to determine which MAC in the header is the
 relevant one to check against.

 They're all addr2 though, and I haven't yet thought of a reason it
 could be addr1 or addr3 (or addr4, for that matter); I just decided to
 leave it this way so the semantics of the caller dictates which MAC
 in the frame is the relevant one to check against as-is.

And no one else has found a reason to do so in the last 7 years that
code exists :)

 If you think that's me being a bit overly anal about it, then sure,
 please go ahead and turf it. :)

 Personally, I'd like to add an enum field (and then remove the MAC) -
 the enum field would indicate to acl_check() _which_ ACL is being
 checked - ie, probe request, association request, and any other frame
 check request. That way it's precisely clear what the ACL check is
 for. But again, that's just me being overly picky. :)

Well, no. The ACL stuff was designed to have one module for each
usage and not one for everything. Following your example you would
have one for assoc frames/probe frames (whatever the desired behavior
is), .. and the already existing one for macs. Well, just this piece isn't
that optimal yet:

/* XXX just one for now */
static  const struct ieee80211_aclator *acl = NULL;

So, my point is, I'd like to keep the functionality of the wlan_acl(4) module
as it is, matching wh-i_addr2 with the list of given macs only. If you (or
someone) else have some different functionality in mind, add a new acl
module which replaces the current one using ieee80211_aclator_register()
and do whatever you want in there.

 So in short: if you're happy removing it, remove it. :)

I agree on passing the frame as an argument to iac_check() and obtain
the mac from there, that definitely is required for more advanced
ACLs. Passing both tough, is imho not required and redundant, so, yes
I think I'm going to remove it.

-- 
Bernhard
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228527 - head/sys/conf

2011-12-15 Thread Gleb Smirnoff
Author: glebius
Date: Thu Dec 15 11:15:23 2011
New Revision: 228527
URL: http://svn.freebsd.org/changeset/base/228527

Log:
  Add RADIX_MPATH to LINT.

Modified:
  head/sys/conf/NOTES

Modified: head/sys/conf/NOTES
==
--- head/sys/conf/NOTES Thu Dec 15 06:29:13 2011(r228526)
+++ head/sys/conf/NOTES Thu Dec 15 11:15:23 2011(r228527)
@@ -916,6 +916,8 @@ device  lagg
 # for sockets with the SO_DEBUG option set, which can then be examined
 # using the trpt(8) utility.
 #
+# RADIX_MPATH provides support for multiple forwarding tables.
+#
 optionsMROUTING# Multicast routing
 optionsIPFIREWALL  #firewall
 optionsIPFIREWALL_VERBOSE  #enable logging to syslogd(8)
@@ -930,6 +932,7 @@ options IPFILTER_LOOKUP #ipfilter pool
 optionsIPFILTER_DEFAULT_BLOCK  #block all packets by default
 optionsIPSTEALTH   #support for stealth forwarding
 optionsTCPDEBUG
+optionsRADIX_MPATH
 
 # The MBUF_STRESS_TEST option enables options which create
 # various random failures / extreme cases related to mbuf
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228528 - head/lib/libc/stdlib

2011-12-15 Thread David Chisnall
Author: theraven
Date: Thu Dec 15 11:16:41 2011
New Revision: 228528
URL: http://svn.freebsd.org/changeset/base/228528

Log:
  Small style(9) improvements.
  
  Approved by:  dim (mentor)

Modified:
  head/lib/libc/stdlib/quick_exit.c

Modified: head/lib/libc/stdlib/quick_exit.c
==
--- head/lib/libc/stdlib/quick_exit.c   Thu Dec 15 11:15:23 2011
(r228527)
+++ head/lib/libc/stdlib/quick_exit.c   Thu Dec 15 11:16:41 2011
(r228528)
@@ -51,10 +51,12 @@ static struct quick_exit_handler *handle
 int
 at_quick_exit(void (*func)(void))
 {
-   struct quick_exit_handler *h = malloc(sizeof(struct 
quick_exit_handler));
+   struct quick_exit_handler *h;
+   
+   h = malloc(sizeof(*h));
 
if (NULL == h)
-   return 1;
+   return (1);
h-cleanup = func;
pthread_mutex_lock(atexit_mutex);
h-next = handlers;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228529 - head/sys/sys

2011-12-15 Thread David Chisnall
Author: theraven
Date: Thu Dec 15 11:21:56 2011
New Revision: 228529
URL: http://svn.freebsd.org/changeset/base/228529

Log:
  Add a pointless and superfluous GNUism that people at a certain large data
  aggregation and advertising company seem to believe is standard.
  
  Approved by:  dim (mentor)

Modified:
  head/sys/sys/stdint.h

Modified: head/sys/sys/stdint.h
==
--- head/sys/sys/stdint.h   Thu Dec 15 11:16:41 2011(r228528)
+++ head/sys/sys/stdint.h   Thu Dec 15 11:21:56 2011(r228529)
@@ -64,4 +64,11 @@ typedef  __uintmax_t uintmax_t;
 #define_UINTMAX_T_DECLARED
 #endif
 
+/* GNU and Darwin define this and people seem to think it's portable */
+#if defined(UINTPTR_MAX)  defined(UINT64_MAX)  (UINTPTR_MAX == UINT64_MAX)
+#define__WORDSIZE  64
+#else
+#define__WORDSIZE  32
+#endif
+
 #endif /* !_SYS_STDINT_H_ */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228530 - in head/sys/arm: arm include

2011-12-15 Thread Rafal Jaworowski
Author: raj
Date: Thu Dec 15 12:14:15 2011
New Revision: 228530
URL: http://svn.freebsd.org/changeset/base/228530

Log:
  ARM pmap fixes:
  
  - Write Buffers have to be drained after write to Page Table even if caches
are in write-through mode.
  
  - Make sure to sync PTE in pmap_zero_page_generic().
  
  Submitted by: Michal Mazur
  Reviewed by:  cognet
  Obtained from:Semihalf
  MFC after:1 month

Modified:
  head/sys/arm/arm/pmap.c
  head/sys/arm/include/pmap.h

Modified: head/sys/arm/arm/pmap.c
==
--- head/sys/arm/arm/pmap.c Thu Dec 15 11:21:56 2011(r228529)
+++ head/sys/arm/arm/pmap.c Thu Dec 15 12:14:15 2011(r228530)
@@ -4039,6 +4039,7 @@ pmap_zero_page_generic(vm_paddr_t phys, 
 * order to work without corruption when write-allocate is enabled.
 */
*cdst_pte = L2_S_PROTO | phys | L2_S_PROT(PTE_KERNEL, VM_PROT_WRITE);
+   PTE_SYNC(cdst_pte);
cpu_tlb_flushD_SE(cdstp);
cpu_cpwait();
if (off || size != PAGE_SIZE)

Modified: head/sys/arm/include/pmap.h
==
--- head/sys/arm/include/pmap.h Thu Dec 15 11:21:56 2011(r228529)
+++ head/sys/arm/include/pmap.h Thu Dec 15 12:14:15 2011(r228530)
@@ -382,7 +382,8 @@ do {
\
if (PMAP_NEEDS_PTE_SYNC) {  \
cpu_dcache_wb_range((vm_offset_t)(pte), sizeof(pt_entry_t));\
cpu_l2cache_wb_range((vm_offset_t)(pte), sizeof(pt_entry_t));\
-   }\
+   } else  \
+   cpu_drain_writebuf();   \
 } while (/*CONSTCOND*/0)
 
 #definePTE_SYNC_RANGE(pte, cnt)
\
@@ -392,7 +393,8 @@ do {
\
(cnt)  2); /* * sizeof(pt_entry_t) */ \
cpu_l2cache_wb_range((vm_offset_t)(pte),\
(cnt)  2); /* * sizeof(pt_entry_t) */ \
-   }   \
+   } else  \
+   cpu_drain_writebuf();   \
 } while (/*CONSTCOND*/0)
 
 extern pt_entry_t  pte_l1_s_cache_mode;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2011-12-15 Thread Ed Schouten
Hello Bruce,

After reading through your email, I think it's best to fix things using
the following patch. Essentially it does the following:

- It makes sure __alignof() is always present, by defining it as a macro
  for GCC  2.95.
- All the C1X macros can now be implemented using the ones we already
  had (__dead2, etc). This means we don't need to repeat all the
  compiler version specific checks.
- While there, add struct __hack to the _Static_assert, as it always
  requires a semicolon.

Thanks for your feedback.

| Index: sys/sys/cdefs.h
| ===
| --- sys/sys/cdefs.h   (revision 228504)
| +++ sys/sys/cdefs.h   (working copy)
| @@ -230,27 +230,24 @@
|  #elif defined(__STDC_VERSION__)  __STDC_VERSION__  201000L
|  /* Do nothing.  They are language keywords. */
|  #else
| -/* Not supported.  Implement them manually. */
| -#ifdef __GNUC__
| -#define  _Alignas(e) __attribute__((__aligned__(e)))
| -#define  _Alignof(e) __alignof__(e)
| -#define  _Noreturn   __attribute__((__noreturn__))
| +/* Not supported.  Implement them using our versions. */
| +#define  _Alignas(e) __aligned(e)
| +#define  _Alignof(e) __alignof(e)
| +#define  _Noreturn   __dead2
|  #define  _Thread_local   __thread
| -#else
| -#define  _Alignas(e)
| -#define  _Alignof(e) __offsetof(struct { char __a; e __b; }, 
__b)
| -#define  _Noreturn
| -#define  _Thread_local
| -#endif
|  #ifdef __COUNTER__
|  #define  _Static_assert(e, s)__Static_assert(e, __COUNTER__)
|  #define  __Static_assert(e, c)   ___Static_assert(e, c)
|  #define  ___Static_assert(e, c)  typedef char __assert ## c[(e) ? 1 : -1]
|  #else
| -#define  _Static_assert(e, s)
| +#define  _Static_assert(e, s)struct __hack
|  #endif
|  #endif
|  
| +#if !__GNUC_PREREQ__(2, 95)
| +#define  __alignof(x)__offsetof(struct { char __a; e __b; }, __b)
| +#endif
| +
|  #if __GNUC_PREREQ__(2, 96)
|  #define  __malloc_like   __attribute__((__malloc__))
|  #define  __pure  __attribute__((__pure__))

-- 
 Ed Schouten e...@80386.nl
 WWW: http://80386.nl/


pgpddYUnehIaL.pgp
Description: PGP signature


svn commit: r228531 - head/lib/libc/net

2011-12-15 Thread Michael Tuexen
Author: tuexen
Date: Thu Dec 15 12:35:03 2011
New Revision: 228531
URL: http://svn.freebsd.org/changeset/base/228531

Log:
  Fix a bug where sctp_sendmdg() uses uninitialized memory.
  
  MFC after: 3 days.

Modified:
  head/lib/libc/net/sctp_sys_calls.c

Modified: head/lib/libc/net/sctp_sys_calls.c
==
--- head/lib/libc/net/sctp_sys_calls.c  Thu Dec 15 12:14:15 2011
(r228530)
+++ head/lib/libc/net/sctp_sys_calls.c  Thu Dec 15 12:35:03 2011
(r228531)
@@ -563,6 +563,7 @@ sctp_sendmsg(int s,
 #ifdef SYS_sctp_generic_sendmsg
struct sctp_sndrcvinfo sinfo;
 
+   memset(sinfo, 0, sizeof(struct sctp_sndrcvinfo));
sinfo.sinfo_ppid = ppid;
sinfo.sinfo_flags = flags;
sinfo.sinfo_stream = stream_no;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228532 - head/sys/net

2011-12-15 Thread Gleb Smirnoff
Author: glebius
Date: Thu Dec 15 12:49:10 2011
New Revision: 228532
URL: http://svn.freebsd.org/changeset/base/228532

Log:
  Simplify rtrequest(RTM_ADD): ifa can't be NULL after rt_getifa_fib().

Modified:
  head/sys/net/route.c

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cThu Dec 15 12:35:03 2011(r228531)
+++ head/sys/net/route.cThu Dec 15 12:49:10 2011(r228532)
@@ -1128,8 +1128,7 @@ rtrequest1_fib(int req, struct rt_addrin
ifa = info-rti_ifa;
rt = uma_zalloc(V_rtzone, M_NOWAIT | M_ZERO);
if (rt == NULL) {
-   if (ifa != NULL)
-   ifa_free(ifa);
+   ifa_free(ifa);
senderr(ENOBUFS);
}
RT_LOCK_INIT(rt);
@@ -1142,8 +1141,7 @@ rtrequest1_fib(int req, struct rt_addrin
RT_LOCK(rt);
if ((error = rt_setgate(rt, dst, gateway)) != 0) {
RT_LOCK_DESTROY(rt);
-   if (ifa != NULL)
-   ifa_free(ifa);
+   ifa_free(ifa);
uma_zfree(V_rtzone, rt);
senderr(error);
}
@@ -1174,9 +1172,7 @@ rtrequest1_fib(int req, struct rt_addrin
/* do not permit exactly the same dst/mask/gw pair */
if (rn_mpath_capable(rnh) 
rt_mpath_conflict(rnh, rt, netmask)) {
-   if (rt-rt_ifa) {
-   ifa_free(rt-rt_ifa);
-   }
+   ifa_free(rt-rt_ifa);
Free(rt_key(rt));
RT_LOCK_DESTROY(rt);
uma_zfree(V_rtzone, rt);
@@ -1241,8 +1237,7 @@ rtrequest1_fib(int req, struct rt_addrin
 * then un-make it (this should be a function)
 */
if (rn == NULL) {
-   if (rt-rt_ifa)
-   ifa_free(rt-rt_ifa);
+   ifa_free(rt-rt_ifa);
Free(rt_key(rt));
RT_LOCK_DESTROY(rt);
uma_zfree(V_rtzone, rt);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2011-12-15 Thread Bruce Evans

On Thu, 15 Dec 2011, Ed Schouten wrote:


Hello Bruce,

After reading through your email, I think it's best to fix things using
the following patch. Essentially it does the following:

- It makes sure __alignof() is always present, by defining it as a macro
 for GCC  2.95.


I tested this with a KR compiler.  It worked (since it is similar to
the fallback for offsetof() which always worked) after fixing 2 bugs
that prevented the fallback working with any compiler.


From your patch (quoted below):



| +#if !__GNUC_PREREQ__(2, 95)
| +#define  __alignof(x)__offsetof(struct { char __a; e __b; }, __b)
| +#endif


The 2 bugs are:
1. Even __offsetof() is broken in the fallback case (that's all cases
   where it uses a struct like the above and doesn't use a gccish builtin).
   This is because __offsetof() uses size_t, but size_t is not necessarily
   in declared.  offsetof() in stddef.h, etc. works because size_t is
   necessarily declared there.  BTW, the ifdef for __offsetof in
   stddef.h is bogus since sys/cdefs.h is always included so
   __offsetof is always defined.

   __size_t could be used, but that would give lots of pollution for
   cdefs.h, and the file that declares __size_t, namely
   machine/types.h is broken in fallback cases:
   - recently broken for KR since it now uses signed instead of __signed
   - broken for longer for KR and C90 since it uses long long.  In working
 versions, the __int64_t declarations were hacked for 32-bit machines
 on to make them compile (but not work).  Non-hacked versions should
 simply not declare the 64-bit types if the compiler doesn't support
 them.
2. The macro parameter x is now mispelled, so it is never used, and the
   non-misspelled macro parameter e gives a syntax error when it is
   used in the macro body.

Test program:

% #include sys/cdefs.h
% 
% typedef	unsigned size_t;	/* XXX */
% 
% #define	__alignof(e)	__offsetof(struct { char __a; e __b; }, __b)
% 
% int c = __alignof(char);

% int s = __alignof(short);
% int i = __alignof(int);
% int l = __alignof(long);
% int f = __alignof(float);
% int d = __alignof(double);

Fixes:
1. Just a hack to make __offsetof() work.  I don't know a good way to
   declare __size_t.  Of course, size_t should not be used.
2. Change the spelling back to e.  I prefer x, but all the other
   definitions use e.


- All the C1X macros can now be implemented using the ones we already
 had (__dead2, etc). This means we don't need to repeat all the
 compiler version specific checks.
- While there, add struct __hack to the _Static_assert, as it always
 requires a semicolon.


Good.


| Index: sys/sys/cdefs.h
| ===
| --- sys/sys/cdefs.h   (revision 228504)
| +++ sys/sys/cdefs.h   (working copy)
| @@ -230,27 +230,24 @@
|  #elif defined(__STDC_VERSION__)  __STDC_VERSION__  201000L
|  /* Do nothing.  They are language keywords. */
|  #else
| -/* Not supported.  Implement them manually. */
| -#ifdef __GNUC__
| -#define  _Alignas(e) __attribute__((__aligned__(e)))
| -#define  _Alignof(e) __alignof__(e)
| -#define  _Noreturn   __attribute__((__noreturn__))
| +/* Not supported.  Implement them using our versions. */


It may be worth emphasizing that in some cases, our version doesn't
exist, and that this is intentional (we omit the definition when none
is possible, and this results in __aligned() sometimes not being defined
and __thread never being defined).


| +#define  _Alignas(e) __aligned(e)
| +#define  _Alignof(e) __alignof(e)


I prefer to always spell the parameter as x.  Most older macros in this
file, and CTASSERT() in another file, spell their parameters (x, y, ...).


| +#define  _Noreturn   __dead2
|  #define  _Thread_local   __thread
| -#else
| -#define  _Alignas(e)
| -#define  _Alignof(e) __offsetof(struct { char __a; e __b; }, 
__b)
| -#define  _Noreturn
| -#define  _Thread_local
| -#endif
|  #ifdef __COUNTER__
|  #define  _Static_assert(e, s)__Static_assert(e, __COUNTER__)
|  #define  __Static_assert(e, c)   ___Static_assert(e, c)
|  #define  ___Static_assert(e, c)  typedef char __assert ## c[(e) ? 1 : -1]
|  #else
| -#define  _Static_assert(e, s)
| +#define  _Static_assert(e, s)struct __hack


CTASSERT() has regressed for compilers that don't support __COUNTER__,
since it uses this.  Previously:
- CTASSERT() never worked for KR compilers, since it uses C90 token pasting
- CTASSERT() worked for all C90 and later compilers.


|  #endif
|  #endif
|
| +#if !__GNUC_PREREQ__(2, 95)
| +#define  __alignof(x)__offsetof(struct { char __a; e __b; }, __b)
| +#endif


Needs the spelling fix.


| +
|  #if __GNUC_PREREQ__(2, 96)
|  #define  __malloc_like   __attribute__((__malloc__))
|  #define  __pure  __attribute__((__pure__))


Check the sorting of the new 

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

2011-12-15 Thread Ed Schouten
Hello Bruce,

* Bruce Evans b...@optusnet.com.au, 20111215 15:12:
 The 2 bugs are:
 1. Even __offsetof() is broken in the fallback case (that's all cases
where it uses a struct like the above and doesn't use a gccish builtin).
This is because __offsetof() uses size_t, but size_t is not necessarily
in declared.  offsetof() in stddef.h, etc. works because size_t is
necessarily declared there.  BTW, the ifdef for __offsetof in
stddef.h is bogus since sys/cdefs.h is always included so
__offsetof is always defined.
 
__size_t could be used, but that would give lots of pollution for
cdefs.h, and the file that declares __size_t, namely
machine/types.h is broken in fallback cases:
- recently broken for KR since it now uses signed instead of __signed
- broken for longer for KR and C90 since it uses long long.  In working
  versions, the __int64_t declarations were hacked for 32-bit machines
  on to make them compile (but not work).  Non-hacked versions should
  simply not declare the 64-bit types if the compiler doesn't support
  them.

Well, the dependency is circular, as machine/_types.h depends on
sys/cdefs.h as well, so that's not a real solution.

This is a bit blunt, but maybe we should simply use unsigned long
there, under the assumption that on all architectures we support it is
equal in size, and if not likely big enough to store the result.

 CTASSERT() has regressed for compilers that don't support __COUNTER__,
 since it uses this.  Previously:
 - CTASSERT() never worked for KR compilers, since it uses C90 token pasting
 - CTASSERT() worked for all C90 and later compilers.

Yes. I am considering merging back the __COUNTER__ fix to FreeBSD 9
after it has been released, so it shouldn't be too bad. Basically we
have to make a trade-off:

- Make it possible to use CTASSERT() and _Static_assert() in more places
  throughout the tree (headers), or
- support CTASSERT() and _Static_assert() for non-default compilers that
  are older than GCC 4.3.

I suspect that if people switch to non-default compilers to build
FreeBSD sources, they aren't doing it because they want to use an older
version of GCC.

 Check the sorting of the new macros, especially __alignof().  I think
 the ordering should be mostly on the gcc and standards version, not on
 the order in which the macros were added to cdefs.h.  You sorted the 2.95
 ifdef before a 2.96 ifdef, but this 2.96 ifdef is especially disordered
 according to my rule.  Even if the order is logical instead of historical,
 it makes more sense to define basic macros like __alignof() before using
 them.

I've placed it right above the C1X block now.

%%%
Index: sys/sys/cdefs.h
===
--- sys/sys/cdefs.h (revision 228530)
+++ sys/sys/cdefs.h (working copy)
@@ -218,6 +218,10 @@
 #endif
 #endif
 
+#if !__GNUC_PREREQ__(2, 95)
+#define__alignof(x)__offsetof(struct { char __a; x __b; }, __b)
+#endif
+
 /*
  * Keywords added in C1X.
  */
@@ -230,24 +234,17 @@
 #elif defined(__STDC_VERSION__)  __STDC_VERSION__  201000L
 /* Do nothing.  They are language keywords. */
 #else
-/* Not supported.  Implement them manually. */
-#ifdef __GNUC__
-#define_Alignas(e) __attribute__((__aligned__(e)))
-#define_Alignof(e) __alignof__(e)
-#define_Noreturn   __attribute__((__noreturn__))
+/* Not supported.  Implement them using our versions. */
+#define_Alignas(x) __aligned(x)
+#define_Alignof(x) __alignof(x)
+#define_Noreturn   __dead2
 #define_Thread_local   __thread
-#else
-#define_Alignas(e)
-#define_Alignof(e) __offsetof(struct { char __a; e __b; }, 
__b)
-#define_Noreturn
-#define_Thread_local
-#endif
 #ifdef __COUNTER__
-#define_Static_assert(e, s)__Static_assert(e, __COUNTER__)
-#define__Static_assert(e, c)   ___Static_assert(e, c)
-#define___Static_assert(e, c)  typedef char __assert ## c[(e) ? 1 : -1]
+#define_Static_assert(x, y)__Static_assert(x, __COUNTER__)
+#define__Static_assert(x, y)   ___Static_assert(x, y)
+#define___Static_assert(x, y)  typedef char __assert ## c[(x) ? 1 : -1]
 #else
-#define_Static_assert(e, s)
+#define_Static_assert(x, y)struct __hack
 #endif
 #endif
 
%%%

-- 
 Ed Schouten e...@80386.nl
 WWW: http://80386.nl/


pgpZALRdOvGLm.pgp
Description: PGP signature


Re: svn commit: r228520 - head/sys/nfsserver

2011-12-15 Thread John Baldwin
On Wednesday, December 14, 2011 9:26:54 pm Xin LI wrote:
 Author: delphij
 Date: Thu Dec 15 02:26:53 2011
 New Revision: 228520
 URL: http://svn.freebsd.org/changeset/base/228520
 
 Log:
   Honor NFSv3 commit call (RFC 1813, Section 3.3.21) where when count is 0,
   the full length from offset is being flushed.  Note that for now VOP_FSYNC
   does not support offset and length parameters so we still do the same full
   VOP_FSYNC.  This issue was reported at FreeNAS support site as FreeNAS
   ticket #1096.
   
   Submitted by:   ceckerle ce.freenas eckerle net
   Prodded by: gcooper
   Reviewed by:rmacklem
   MFC after:  2 weeks

This is part of the patch in the PR that had NFS write clustering as well 
(kern/118126).

-- 
John Baldwin
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228533 - head/sys/kern

2011-12-15 Thread John Baldwin
Author: jhb
Date: Thu Dec 15 15:17:19 2011
New Revision: 228533
URL: http://svn.freebsd.org/changeset/base/228533

Log:
  Use vm_mmap_to_errno().
  
  Submitted by: kib

Modified:
  head/sys/kern/uipc_shm.c

Modified: head/sys/kern/uipc_shm.c
==
--- head/sys/kern/uipc_shm.cThu Dec 15 12:49:10 2011(r228532)
+++ head/sys/kern/uipc_shm.cThu Dec 15 15:17:19 2011(r228533)
@@ -81,6 +81,7 @@ __FBSDID($FreeBSD$);
 #include vm/vm.h
 #include vm/vm_param.h
 #include vm/pmap.h
+#include vm/vm_extern.h
 #include vm/vm_map.h
 #include vm/vm_kern.h
 #include vm/vm_object.h
@@ -790,15 +791,7 @@ shm_map(struct file *fp, size_t size, of
shmfd-shm_kmappings--;
VM_OBJECT_UNLOCK(obj);
 
-   switch (rv) {
-   case KERN_INVALID_ADDRESS:
-   case KERN_NO_SPACE:
-   return (ENOMEM);
-   case KERN_PROTECTION_FAILURE:
-   return (EACCES);
-   default:
-   return (EINVAL);
-   }
+   return (vm_mmap_to_errno(rv));
 }
 
 /*
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228534 - stable/8/usr.sbin/mfiutil

2011-12-15 Thread John Baldwin
Author: jhb
Date: Thu Dec 15 16:39:48 2011
New Revision: 228534
URL: http://svn.freebsd.org/changeset/base/228534

Log:
  MFC 225168:
  If a drive is not part of the array (i.e. missing) we need to print the
  new line after the pd state information as well, so move it to the outside
  of the block.

Modified:
  stable/8/usr.sbin/mfiutil/mfi_show.c
Directory Properties:
  stable/8/usr.sbin/mfiutil/   (props changed)

Modified: stable/8/usr.sbin/mfiutil/mfi_show.c
==
--- stable/8/usr.sbin/mfiutil/mfi_show.cThu Dec 15 15:17:19 2011
(r228533)
+++ stable/8/usr.sbin/mfiutil/mfi_show.cThu Dec 15 16:39:48 2011
(r228534)
@@ -335,8 +335,8 @@ show_config(int ac, char **av)
mfi_pdstate(ar-pd[j].fw_state));
else
print_pd(pinfo, -1);
-   printf(\n);
}
+   printf(\n);
}
p += config-array_size;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228535 - head/sys/i386/i386

2011-12-15 Thread Alan Cox
Author: alc
Date: Thu Dec 15 17:54:23 2011
New Revision: 228535
URL: http://svn.freebsd.org/changeset/base/228535

Log:
  Simplify the implementation of the identity mapping in start_all_aps().
  Since mpboot.s enables processor support for PG_PS before enabling
  paging, there is no reason that the identity must use 4 KB page mappings.
  
  Discussed with:   jhb

Modified:
  head/sys/i386/i386/locore.s
  head/sys/i386/i386/mp_machdep.c

Modified: head/sys/i386/i386/locore.s
==
--- head/sys/i386/i386/locore.s Thu Dec 15 16:39:48 2011(r228534)
+++ head/sys/i386/i386/locore.s Thu Dec 15 17:54:23 2011(r228535)
@@ -775,8 +775,7 @@ no_kernend:
  * if we've enabled PSE above, we'll just switch the corresponding kernel
  * PDEs before we turn on paging.
  *
- * XXX: We waste some pages here in the PSE case!  DON'T BLINDLY REMOVE
- * THIS!  SMP needs the page table to be there to map the kernel P==V.
+ * XXX: We waste some pages here in the PSE case!
  */
xorl%eax, %eax
movlR(KERNend),%ecx

Modified: head/sys/i386/i386/mp_machdep.c
==
--- head/sys/i386/i386/mp_machdep.c Thu Dec 15 16:39:48 2011
(r228534)
+++ head/sys/i386/i386/mp_machdep.c Thu Dec 15 17:54:23 2011
(r228535)
@@ -145,9 +145,6 @@ static int bootAP;
 void *bootstacks[MAXCPU];
 static void *dpcpu;
 
-/* Hotwire a 0-4MB V==P mapping */
-extern pt_entry_t *KPTphys;
-
 struct pcb stoppcbs[MAXCPU];
 
 /* Variables needed for SMP tlb shootdown. */
@@ -931,7 +928,6 @@ start_all_aps(void)
 #ifndef PC98
u_char mpbiosreason;
 #endif
-   uintptr_t kptbase;
u_int32_t mpbioswarmvec;
int apic_id, cpu, i;
 
@@ -949,11 +945,8 @@ start_all_aps(void)
 
/* set up temporary P==V mapping for AP boot */
/* XXX this is a hack, we should boot the AP on its own stack/PTD */
-
-   kptbase = (uintptr_t)(void *)KPTphys;
for (i = TMPMAP_START; i  NKPT; i++)
-   PTD[i] = (pd_entry_t)(PG_V | PG_RW |
-   ((kptbase + i * PAGE_SIZE)  PG_FRAME));
+   PTD[i] = PTD[KPTDI + i];
invltlb();
 
/* start each AP */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


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

2011-12-15 Thread David Schultz
On Thu, Dec 15, 2011, Ed Schouten wrote:
 Hello Bruce,
 
 * Bruce Evans b...@optusnet.com.au, 20111215 15:12:
 - recently broken for KR since it now uses signed instead of __signed
 - broken for longer for KR and C90 since it uses long long.  In working
   versions, the __int64_t declarations were hacked for 32-bit machines
   on to make them compile (but not work).  Non-hacked versions should
   simply not declare the 64-bit types if the compiler doesn't support
   them.
 
 Well, the dependency is circular, as machine/_types.h depends on
 sys/cdefs.h as well, so that's not a real solution.
 
 This is a bit blunt, but maybe we should simply use unsigned long
 there, under the assumption that on all architectures we support it is
 equal in size, and if not likely big enough to store the result.
 
  CTASSERT() has regressed for compilers that don't support __COUNTER__,
  since it uses this.  Previously:
  - CTASSERT() never worked for KR compilers, since it uses C90 token pasting
  - CTASSERT() worked for all C90 and later compilers.
 
 Yes. I am considering merging back the __COUNTER__ fix to FreeBSD 9
 after it has been released, so it shouldn't be too bad. Basically we
 have to make a trade-off:
 
 - Make it possible to use CTASSERT() and _Static_assert() in more places
   throughout the tree (headers), or
 - support CTASSERT() and _Static_assert() for non-default compilers that
   are older than GCC 4.3.
 
 I suspect that if people switch to non-default compilers to build
 FreeBSD sources, they aren't doing it because they want to use an older
 version of GCC.

It's useful to have standard headers that don't blow up in C90
mode, but my sense is that we ought to be beyond caring about KR
C compilers.  (FWIW, my first C compiler was a pre-ANSI compiler
from the 80's, and it still supported the features at issue here.)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228536 - in head/lib/libthr/arch: amd64/include i386/include

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Thu Dec 15 19:42:25 2011
New Revision: 228536
URL: http://svn.freebsd.org/changeset/base/228536

Log:
  The TCB_GET32() and TCB_GET64() macros in the i386 and amd64-specific
  versions of pthread_md.h have a special case of dereferencing a null
  pointer.  Clang warns about this with:
  
  In file included from lib/libthr/arch/i386/i386/pthread_md.c:36:
  lib/libthr/arch/i386/include/pthread_md.h:96:10: error: indirection of 
non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference]
  return (TCB_GET32(tcb_self));
  ^~~
  lib/libthr/arch/i386/include/pthread_md.h:73:13: note: expanded from:
  : m (*(u_int *)(__tcb_offset(name;\
 ^~
  lib/libthr/arch/i386/include/pthread_md.h:96:10: note: consider using 
__builtin_trap() or qualifying pointer with 'volatile'
  
  Since this indirection is done relative to the fs or gs segment, to
  retrieve thread-specific data, it is an exception to the rule.
  
  Therefore, add a volatile qualifier to tell the compiler we really want
  to dereference a zero address.
  
  MFC after:1 week

Modified:
  head/lib/libthr/arch/amd64/include/pthread_md.h
  head/lib/libthr/arch/i386/include/pthread_md.h

Modified: head/lib/libthr/arch/amd64/include/pthread_md.h
==
--- head/lib/libthr/arch/amd64/include/pthread_md.h Thu Dec 15 17:54:23 
2011(r228535)
+++ head/lib/libthr/arch/amd64/include/pthread_md.h Thu Dec 15 19:42:25 
2011(r228536)
@@ -71,7 +71,7 @@ struct tcb {
u_long __i; \
__asm __volatile(movq %%fs:%1, %0 \
: =r (__i)\
-   : m (*(u_long *)(__tcb_offset(name;   \
+   : m (*(volatile u_long *)(__tcb_offset(name;  \
__result = (__tcb_type(name))__i;   \
\
__result;   \

Modified: head/lib/libthr/arch/i386/include/pthread_md.h
==
--- head/lib/libthr/arch/i386/include/pthread_md.h  Thu Dec 15 17:54:23 
2011(r228535)
+++ head/lib/libthr/arch/i386/include/pthread_md.h  Thu Dec 15 19:42:25 
2011(r228536)
@@ -70,7 +70,7 @@ struct tcb {
u_int __i;  \
__asm __volatile(movl %%gs:%1, %0 \
: =r (__i)\
-   : m (*(u_int *)(__tcb_offset(name;\
+   : m (*(volatile u_int *)(__tcb_offset(name;   \
__result = (__tcb_type(name))__i;   \
\
__result;   \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228537 - head/lib/libc/resolv

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Thu Dec 15 20:10:12 2011
New Revision: 228537
URL: http://svn.freebsd.org/changeset/base/228537

Log:
  Remove meaningless self-assignment in res_send.c, otherwise clang will
  warn about it.  I guess this was originally done to silence a bogus
  warning by an older version of gcc, but I could not reproduce it with
  any version of gcc that I have access to.
  
  MFC after:1 week

Modified:
  head/lib/libc/resolv/res_send.c

Modified: head/lib/libc/resolv/res_send.c
==
--- head/lib/libc/resolv/res_send.c Thu Dec 15 19:42:25 2011
(r228536)
+++ head/lib/libc/resolv/res_send.c Thu Dec 15 20:10:12 2011
(r228537)
@@ -1102,8 +1102,6 @@ Aerror(const res_state statp, FILE *file
char hbuf[NI_MAXHOST];
char sbuf[NI_MAXSERV];
 
-   alen = alen;
-
if ((statp-options  RES_DEBUG) != 0U) {
if (getnameinfo(address, alen, hbuf, sizeof(hbuf),
sbuf, sizeof(sbuf), niflags)) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228538 - head/lib/libc/rpc

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Thu Dec 15 20:27:36 2011
New Revision: 228538
URL: http://svn.freebsd.org/changeset/base/228538

Log:
  In lib/libc/rpc/crypt_client.c, fix a clang warning about an implicit
  conversion between enum desdir/desmode from include/rpc/des.h, and enum
  desdir/desmode from include/rpcsvc/crypt.x.  These are actually
  different enums, with different value names, but by accident the integer
  representation of the enum values happened to be the same.
  
  MFC after:1 week

Modified:
  head/lib/libc/rpc/crypt_client.c

Modified: head/lib/libc/rpc/crypt_client.c
==
--- head/lib/libc/rpc/crypt_client.cThu Dec 15 20:10:12 2011
(r228537)
+++ head/lib/libc/rpc/crypt_client.cThu Dec 15 20:27:36 2011
(r228538)
@@ -75,8 +75,8 @@ _des_crypt_call(buf, len, dparms)
 
des_crypt_1_arg.desbuf.desbuf_len = len;
des_crypt_1_arg.desbuf.desbuf_val = buf;
-   des_crypt_1_arg.des_dir = dparms-des_dir;
-   des_crypt_1_arg.des_mode = dparms-des_mode;
+   des_crypt_1_arg.des_dir = (dparms-des_dir == ENCRYPT) ? ENCRYPT_DES : 
DECRYPT_DES;
+   des_crypt_1_arg.des_mode = (dparms-des_mode == CBC) ? CBC_DES : 
ECB_DES;
bcopy(dparms-des_ivec, des_crypt_1_arg.des_ivec, 8);
bcopy(dparms-des_key, des_crypt_1_arg.des_key, 8);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228539 - head/sys/fs/ext2fs

2011-12-15 Thread Pedro F. Giffuni
Author: pfg
Date: Thu Dec 15 20:31:18 2011
New Revision: 228539
URL: http://svn.freebsd.org/changeset/base/228539

Log:
  Bring in reallocblk to ext2fs.
  
  The feature has been standard for a while in UFS as a means to reduce
  fragmentation, therefore maintaining consistent performance with
  filesystem aging. This is also very similar to what ext4 calls
  delayed allocation.
  
  In his 2010 GSoC, Zheng Liu ported and benchmarked the missing
  FANCY_REALLOC code to find more consistent performance improvements than
  with the preallocation approach.
  
  PR:   159233
  Author:   Zheng Liu gnehzuil AT SPAMFREE gmail DOT com
  Sponsored by: Google Inc.
  Approved by:  jhb (mentor)
  MFC after:2 weeks

Modified:
  head/sys/fs/ext2fs/ext2_alloc.c
  head/sys/fs/ext2fs/ext2_extern.h
  head/sys/fs/ext2fs/ext2_subr.c
  head/sys/fs/ext2fs/ext2_vfsops.c
  head/sys/fs/ext2fs/ext2fs.h

Modified: head/sys/fs/ext2fs/ext2_alloc.c
==
--- head/sys/fs/ext2fs/ext2_alloc.c Thu Dec 15 20:27:36 2011
(r228538)
+++ head/sys/fs/ext2fs/ext2_alloc.c Thu Dec 15 20:31:18 2011
(r228539)
@@ -42,6 +42,7 @@
 #include sys/vnode.h
 #include sys/stat.h
 #include sys/mount.h
+#include sys/sysctl.h
 #include sys/syslog.h
 #include sys/buf.h
 
@@ -52,6 +53,7 @@
 #include fs/ext2fs/ext2_extern.h
 
 static daddr_t ext2_alloccg(struct inode *, int, daddr_t, int);
+static daddr_t ext2_clusteralloc(struct inode *, int, daddr_t, int);
 static u_long  ext2_dirpref(struct inode *);
 static voidext2_fserr(struct m_ext2fs *, uid_t, char *);
 static u_long  ext2_hashalloc(struct inode *, int, long, int,
@@ -59,9 +61,6 @@ static u_long ext2_hashalloc(struct inod
int));
 static daddr_t ext2_nodealloccg(struct inode *, int, daddr_t, int);
 static daddr_t  ext2_mapsearch(struct m_ext2fs *, char *, daddr_t);
-#ifdef FANCY_REALLOC
-static int ext2_reallocblks(struct vop_reallocblks_args *);
-#endif
 
 /*
  * Allocate a block in the file system.
@@ -113,20 +112,20 @@ ext2_alloc(ip, lbn, bpref, size, cred, b
if (bpref = fs-e2fs-e2fs_bcount)
bpref = 0;
if (bpref == 0)
-cg = ino_to_cg(fs, ip-i_number);
-else
-cg = dtog(fs, bpref);
-bno = (daddr_t)ext2_hashalloc(ip, cg, bpref, fs-e2fs_bsize,
- ext2_alloccg);
-if (bno  0) {
+   cg = ino_to_cg(fs, ip-i_number);
+   else
+   cg = dtog(fs, bpref);
+   bno = (daddr_t)ext2_hashalloc(ip, cg, bpref, fs-e2fs_bsize,
+ ext2_alloccg);
+   if (bno  0) {
/* set next_alloc fields as done in block_getblk */
ip-i_next_alloc_block = lbn;
ip-i_next_alloc_goal = bno;
 
-ip-i_blocks += btodb(fs-e2fs_bsize);
-ip-i_flag |= IN_CHANGE | IN_UPDATE;
-*bnp = bno;
-return (0);
+   ip-i_blocks += btodb(fs-e2fs_bsize);
+   ip-i_flag |= IN_CHANGE | IN_UPDATE;
+   *bnp = bno;
+   return (0);
 }
 nospace:
EXT2_UNLOCK(ump);
@@ -150,7 +149,6 @@ nospace:
  * the previous block allocation will be used.
  */
 
-#ifdef FANCY_REALLOC
 static SYSCTL_NODE(_vfs, OID_AUTO, ext2fs, CTLFLAG_RW, 0, EXT2FS filesystem);
 
 static int doasyncfree = 1;
@@ -159,7 +157,6 @@ SYSCTL_INT(_vfs_ext2fs, OID_AUTO, doasyn
 
 static int doreallocblks = 1;
 SYSCTL_INT(_vfs_ext2fs, OID_AUTO, doreallocblks, CTLFLAG_RW, doreallocblks, 
0, );
-#endif
 
 int
 ext2_reallocblks(ap)
@@ -168,11 +165,6 @@ ext2_reallocblks(ap)
struct cluster_save *a_buflist;
} */ *ap;
 {
-#ifndef FANCY_REALLOC
-/* printf(ext2_reallocblks not implemented\n); */
-return ENOSPC;
-#else
-
struct m_ext2fs *fs;
struct inode *ip;
struct vnode *vp;
@@ -184,14 +176,17 @@ return ENOSPC;
int32_t start_lbn, end_lbn, soff, newblk, blkno;
int i, len, start_lvl, end_lvl, pref, ssize;
 
+   if (doreallocblks == 0)
+ return (ENOSPC);
+
vp = ap-a_vp;
ip = VTOI(vp);
fs = ip-i_e2fs;
ump = ip-i_ump;
-#ifdef UNKLAR
-   if (fs-fs_contigsumsize = 0)
+
+   if (fs-e2fs_contigsumsize = 0)
return (ENOSPC);
-#endif
+
buflist = ap-a_buflist;
len = buflist-bs_nchildren;
start_lbn = buflist-bs_children[0]-b_lblkno;
@@ -228,11 +223,6 @@ return ENOSPC;
soff = idp-in_off;
}
/*
-* Find the preferred location for the cluster.
-*/
-   EXT2_LOCK(ump);
-   pref = ext2_blkpref(ip, start_lbn, soff, sbap, 0);
-   /*
 * If the block range spans two block maps, get the second map.
 */
if (end_lvl == 0 || (idp = end_ap[end_lvl - 1])-in_off + 1 = len) 

svn commit: r228540 - head/lib/libc/stdlib

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Thu Dec 15 20:40:11 2011
New Revision: 228540
URL: http://svn.freebsd.org/changeset/base/228540

Log:
  Since clang does not support the tls_model attribute used in malloc.c
  yet (see LLVM PR 9788), and warns about it, rub it out for now.  When
  clang grows support for this attribute, I will revert this again.
  
  MFC after:1 week

Modified:
  head/lib/libc/stdlib/malloc.c

Modified: head/lib/libc/stdlib/malloc.c
==
--- head/lib/libc/stdlib/malloc.c   Thu Dec 15 20:31:18 2011
(r228539)
+++ head/lib/libc/stdlib/malloc.c   Thu Dec 15 20:40:11 2011
(r228540)
@@ -219,7 +219,11 @@ __FBSDID($FreeBSD$);
 #  define LG_QUANTUM   4
 #  define LG_SIZEOF_PTR2
 #  define CPU_SPINWAIT __asm__ volatile(pause)
-#  define TLS_MODEL__attribute__((tls_model(initial-exec)))
+#  ifdef __clang__
+#define TLS_MODEL  /* clang does not support tls_model yet */
+#  else
+#define TLS_MODEL  __attribute__((tls_model(initial-exec)))
+#  endif
 #endif
 #ifdef __ia64__
 #  define LG_QUANTUM   4
@@ -240,7 +244,11 @@ __FBSDID($FreeBSD$);
 #  define LG_QUANTUM   4
 #  define LG_SIZEOF_PTR3
 #  define CPU_SPINWAIT __asm__ volatile(pause)
-#  define TLS_MODEL__attribute__((tls_model(initial-exec)))
+#  ifdef __clang__
+#define TLS_MODEL  /* clang does not support tls_model yet */
+#  else
+#define TLS_MODEL  __attribute__((tls_model(initial-exec)))
+#  endif
 #endif
 #ifdef __arm__
 #  define LG_QUANTUM   3
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228541 - head/etc/rc.d

2011-12-15 Thread Pawel Jakub Dawidek
Author: pjd
Date: Thu Dec 15 21:06:37 2011
New Revision: 228541
URL: http://svn.freebsd.org/changeset/base/228541

Log:
  - Put one file into one line. This makes keeping local changes and merging
with FreeBSD easier for vendors.
  - For optional files use variables starting with underscore.
  
  Both changes make rc.d/Makefile look similar to sys/modules/Makefile.
  
  Reviewed by:  dim

Modified:
  head/etc/rc.d/Makefile

Modified: head/etc/rc.d/Makefile
==
--- head/etc/rc.d/Makefile  Thu Dec 15 20:40:11 2011(r228540)
+++ head/etc/rc.d/Makefile  Thu Dec 15 21:06:37 2011(r228541)
@@ -2,64 +2,179 @@
 
 .include bsd.own.mk
 
-FILES= DAEMON FILESYSTEMS LOGIN NETWORKING SERVERS \
-   abi accounting addswap adjkerntz amd \
-   apm apmd archdep atm1 atm2 atm3 auditd \
-   bgfsck bluetooth bootparams bridge bsnmpd bthidd \
-   ccd cleanvar cleartmp cron \
-   ddb defaultroute devd devfs dhclient \
-   dmesg dumpon \
+FILES= DAEMON \
+   FILESYSTEMS \
+   LOGIN \
+   NETWORKING \
+   SERVERS \
+   abi \
+   accounting \
+   addswap \
+   adjkerntz \
+   amd \
+   apm \
+   apmd \
+   archdep \
+   atm1 \
+   atm2 \
+   atm3 \
+   auditd \
+   bgfsck \
+   bluetooth \
+   bootparams \
+   bridge \
+   bsnmpd \
+   bthidd \
+   ccd \
+   cleanvar \
+   cleartmp \
+   cron \
+   ddb \
+   defaultroute \
+   devd \
+   devfs \
+   dhclient \
+   dmesg \
+   dumpon \
encswap \
-   faith fsck ftp-proxy ftpd \
-   gbde geli geli2 gptboot gssd \
-   hastd hcsecd \
-   hostapd hostid hostid_save hostname \
-   inetd initrandom \
-   ip6addrctl ipfilter ipfs ipfw ipmon \
-   ipnat ipsec \
+   faith \
+   fsck \
+   ftp-proxy \
+   ftpd \
+   gbde \
+   geli \
+   geli2 \
+   gptboot \
+   gssd \
+   hastd \
+   hcsecd \
+   hostapd \
+   hostid \
+   hostid_save \
+   hostname \
+   inetd \
+   initrandom \
+   ip6addrctl \
+   ipfilter \
+   ipfs \
+   ipfw \
+   ipmon \
+   ipnat \
+   ipsec \
+   ${_ipxrouted} \
jail \
-   kadmind kerberos keyserv kld kldxref kpasswdd \
-   ldconfig local localpkg lockd lpd \
-   mixer motd mountcritlocal mountcritremote mountlate \
-   mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \
-   named natd netif netoptions netwait \
-   newsyslog nfsclient nfscbd nfsd \
-   nfsuserd nisdomain nsswitch ntpd ntpdate \
+   kadmind \
+   kerberos \
+   keyserv \
+   kld \
+   kldxref \
+   kpasswdd \
+   ldconfig \
+   local \
+   localpkg \
+   lockd \
+   lpd \
+   mixer \
+   motd \
+   mountcritlocal \
+   mountcritremote \
+   mountlate \
+   mdconfig \
+   mdconfig2 \
+   mountd \
+   moused \
+   mroute6d \
+   mrouted \
+   msgs \
+   named \
+   natd \
+   netif \
+   netoptions \
+   netwait \
+   newsyslog \
+   nfsclient \
+   nfscbd \
+   nfsd \
+   nfsuserd \
+   nisdomain \
+   ${_nscd} \
+   nsswitch \
+   ntpd \
+   ntpdate \
+   ${_opensm} \
othermta \
-   pf pflog pfsync \
-   powerd power_profile ppp pppoed pwcheck \
+   pf \
+   pflog \
+   pfsync \
+   powerd \
+   power_profile \
+   ppp \
+   pppoed \
+   pwcheck \
quota \
-   random rarpd rctl resolv rfcomm_pppd_server root \
-   route6d routed routing rpcbind rtadvd rtsold rwho \
-   savecore sdpd securelevel sendmail \
-   serial sppp statd static_arp static_ndp stf swap1 \
-   syscons sysctl syslogd \
-   timed tmp \
+   random \
+   rarpd \
+   rctl \
+   resolv \
+   rfcomm_pppd_server \
+   root \
+   route6d \
+   routed \
+   routing \
+   rpcbind \
+   rtadvd \
+   rtsold \
+   rwho \
+   savecore \
+   sdpd \
+   securelevel \
+   sendmail \
+   serial \
+   sppp \
+   ${_sshd} \
+   statd \
+   static_arp \
+   static_ndp \
+   stf \
+   swap1 \
+   syscons \
+   sysctl \
+   syslogd \
+   timed \
+   tmp \
+   ${_ubthidhci} \
ugidfw \
-   var virecover \
-   watchdogd wpa_supplicant \
-   ypbind yppasswdd ypserv \
-   ypset ypupdated ypxfrd \
-   zfs zvol
+   var \
+   virecover \
+   watchdogd \
+   wpa_supplicant \
+   ypbind \
+   yppasswdd \
+   ypserv \
+   ypset \
+   ypupdated \
+   ypxfrd \
+   zfs \
+   zvol
 
 .if ${MK_IPX} != no
-FILES+=ipxrouted
+_ipxrouted=ipxrouted
 .endif
 
 .if ${MK_OFED} != no
-FILES+= opensm
+_opensm= 

Re: svn commit: r228541 - head/etc/rc.d

2011-12-15 Thread Doug Barton
On 12/15/2011 13:06, Pawel Jakub Dawidek wrote:
 Author: pjd
 Date: Thu Dec 15 21:06:37 2011
 New Revision: 228541
 URL: http://svn.freebsd.org/changeset/base/228541
 
 Log:
   - Put one file into one line. This makes keeping local changes and merging
 with FreeBSD easier for vendors.
   - For optional files use variables starting with underscore.

Thanks! I've had this on my to do list for a long time and have never
been able to get to it.


Doug

-- 

[^L]

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

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


svn commit: r228542 - head/sbin/hastd

2011-12-15 Thread Pawel Jakub Dawidek
Author: pjd
Date: Thu Dec 15 22:01:34 2011
New Revision: 228542
URL: http://svn.freebsd.org/changeset/base/228542

Log:
  Remove redundant setting of the error variable.
  
  Found by: Clang Static Analyzer
  MFC after:1 week

Modified:
  head/sbin/hastd/control.c

Modified: head/sbin/hastd/control.c
==
--- head/sbin/hastd/control.c   Thu Dec 15 21:06:37 2011(r228541)
+++ head/sbin/hastd/control.c   Thu Dec 15 22:01:34 2011(r228542)
@@ -312,7 +312,6 @@ control_handle(struct hastd_config *cfg)
cmd = nv_get_uint8(nvin, cmd);
if (cmd == 0) {
pjdlog_error(Control header is missing 'cmd' field.);
-   error = EHAST_INVALID;
goto close;
}
 
@@ -320,7 +319,6 @@ control_handle(struct hastd_config *cfg)
nvout = nv_alloc();
if (nvout == NULL) {
pjdlog_error(Unable to allocate header for control response.);
-   error = EHAST_NOMEMORY;
goto close;
}
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228543 - head/sbin/hastd

2011-12-15 Thread Pawel Jakub Dawidek
Author: pjd
Date: Thu Dec 15 22:03:17 2011
New Revision: 228543
URL: http://svn.freebsd.org/changeset/base/228543

Log:
  Simplify code by changing functions types from int to avoid, as the functions
  always return 0.
  
  Found by: Clang Static Analyzer
  MFC after:1 week

Modified:
  head/sbin/hastd/hast_checksum.c

Modified: head/sbin/hastd/hast_checksum.c
==
--- head/sbin/hastd/hast_checksum.c Thu Dec 15 22:01:34 2011
(r228542)
+++ head/sbin/hastd/hast_checksum.c Thu Dec 15 22:03:17 2011
(r228543)
@@ -48,7 +48,7 @@ __FBSDID($FreeBSD$);
 #defineMAX_HASH_SIZE   4
 #endif
 
-static int
+static void
 hast_crc32_checksum(const unsigned char *data, size_t size,
 unsigned char *hash, size_t *hsizep)
 {
@@ -58,12 +58,10 @@ hast_crc32_checksum(const unsigned char 
/* XXXPJD: Do we have to use htole32() on crc first? */
bcopy(crc, hash, sizeof(crc));
*hsizep = sizeof(crc);
-
-   return (0);
 }
 
 #ifdef HAVE_CRYPTO
-static int
+static void
 hast_sha256_checksum(const unsigned char *data, size_t size,
 unsigned char *hash, size_t *hsizep)
 {
@@ -73,8 +71,6 @@ hast_sha256_checksum(const unsigned char
SHA256_Update(ctx, data, size);
SHA256_Final(hash, ctx);
*hsizep = SHA256_DIGEST_LENGTH;
-
-   return (0);
 }
 #endif /* HAVE_CRYPTO */
 
@@ -99,25 +95,21 @@ checksum_send(const struct hast_resource
 {
unsigned char hash[MAX_HASH_SIZE];
size_t hsize;
-   int ret;
 
switch (res-hr_checksum) {
case HAST_CHECKSUM_NONE:
return (0);
case HAST_CHECKSUM_CRC32:
-   ret = hast_crc32_checksum(*datap, *sizep, hash, hsize);
+   hast_crc32_checksum(*datap, *sizep, hash, hsize);
break;
 #ifdef HAVE_CRYPTO
case HAST_CHECKSUM_SHA256:
-   ret = hast_sha256_checksum(*datap, *sizep, hash, hsize);
+   hast_sha256_checksum(*datap, *sizep, hash, hsize);
break;
 #endif
default:
PJDLOG_ABORT(Invalid checksum: %d., res-hr_checksum);
}
-
-   if (ret != 0)
-   return (ret);
nv_add_string(nv, checksum_name(res-hr_checksum), checksum);
nv_add_uint8_array(nv, hash, hsize, hash);
if (nv_error(nv) != 0) {
@@ -135,7 +127,6 @@ checksum_recv(const struct hast_resource
const unsigned char *rhash;
size_t chsize, rhsize;
const char *algo;
-   int ret;
 
algo = nv_get_string(nv, checksum);
if (algo == NULL)
@@ -146,10 +137,10 @@ checksum_recv(const struct hast_resource
return (-1);/* Hash not found. */
}
if (strcmp(algo, crc32) == 0)
-   ret = hast_crc32_checksum(*datap, *sizep, chash, chsize);
+   hast_crc32_checksum(*datap, *sizep, chash, chsize);
 #ifdef HAVE_CRYPTO
else if (strcmp(algo, sha256) == 0)
-   ret = hast_sha256_checksum(*datap, *sizep, chash, chsize);
+   hast_sha256_checksum(*datap, *sizep, chash, chsize);
 #endif
else {
pjdlog_error(Unknown checksum algorithm '%s'., algo);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228544 - head/sbin/hastd

2011-12-15 Thread Pawel Jakub Dawidek
Author: pjd
Date: Thu Dec 15 22:05:23 2011
New Revision: 228544
URL: http://svn.freebsd.org/changeset/base/228544

Log:
  Remove redundant assignment.
  
  Found by: Clang Static Analyzer
  MFC after:1 week

Modified:
  head/sbin/hastd/secondary.c

Modified: head/sbin/hastd/secondary.c
==
--- head/sbin/hastd/secondary.c Thu Dec 15 22:03:17 2011(r228543)
+++ head/sbin/hastd/secondary.c Thu Dec 15 22:05:23 2011(r228544)
@@ -199,8 +199,6 @@ init_remote(struct hast_resource *res, s
pjdlog_errno(LOG_WARNING, Unable to set connection direction);
 #endif
 
-   map = NULL;
-   mapsize = 0;
nvout = nv_alloc();
nv_add_int64(nvout, (int64_t)res-hr_datasize, datasize);
nv_add_int32(nvout, (int32_t)res-hr_extentsize, extentsize);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228545 - head/lib/libutil

2011-12-15 Thread Baptiste Daroussin
Author: bapt (ports committer)
Date: Thu Dec 15 22:07:36 2011
New Revision: 228545
URL: http://svn.freebsd.org/changeset/base/228545

Log:
  Modify pw_copy:
  - if pw is NULL and oldpw is not NULL then the oldpw is deleted
  - if pw-pw_name != oldpw-pw_name but pw-pw_uid == oldpw-pw_uid
  then it renames the user
  
  add new gr_* functions so now gr_util API is similar to pw_util API,
  this allow to manipulate groups in a safe way.
  
  Reviewed by:  des
  Approved by:  des
  MFC after:1 month

Modified:
  head/lib/libutil/gr_util.c
  head/lib/libutil/libutil.h
  head/lib/libutil/pw_util.c

Modified: head/lib/libutil/gr_util.c
==
--- head/lib/libutil/gr_util.c  Thu Dec 15 22:05:23 2011(r228544)
+++ head/lib/libutil/gr_util.c  Thu Dec 15 22:07:36 2011(r228545)
@@ -28,23 +28,319 @@
 __FBSDID($FreeBSD$);
 
 #include sys/param.h
+#include sys/errno.h
+#include sys/stat.h
 
+#include ctype.h
+#include err.h
+#include fcntl.h
 #include grp.h
 #include inttypes.h
 #include libutil.h
+#include paths.h
 #include stdbool.h
 #include stdio.h
 #include stdlib.h
 #include string.h
+#include unistd.h
 
 struct group_storage {
struct group gr;
char*members[];
 };
 
+static int lockfd = -1;
+static char group_dir[PATH_MAX];
+static char group_file[PATH_MAX];
+static char tempname[PATH_MAX];
+static int initialized;
+
 static const char group_line_format[] = %s:%s:%ju:;
 
 /*
+ * Initialize statics
+ */
+int
+gr_init(const char *dir, const char *group)
+{
+   if (dir == NULL) {
+   strcpy(group_dir, _PATH_ETC);
+   } else {
+   if (strlen(dir) = sizeof(group_dir)) {
+   errno = ENAMETOOLONG;
+   return (-1);
+   }
+   strcpy(group_dir, dir);
+   }
+
+   if (group == NULL) {
+   if (dir == NULL) {
+   strcpy(group_file, _PATH_GROUP);
+   } else if (snprintf(group_file, sizeof(group_file), %s/group,
+   group_dir)  (int)sizeof(group_file)) {
+   errno = ENAMETOOLONG;
+   return (-1);
+   }
+   } else {
+   if (strlen(group) = sizeof(group_file)) {
+   errno = ENAMETOOLONG;
+   return (-1);
+   }
+   strcpy(group_file, group);
+   }
+   initialized = 1;
+   return (0);
+}
+
+/*
+ * Lock the group file
+ */
+int
+gr_lock(void)
+{
+   if (*group_file == '\0')
+   return (-1);
+
+   for (;;) {
+   struct stat st;
+
+   lockfd = open(group_file, O_RDONLY, 0);
+   if (lockfd  0 || fcntl(lockfd, F_SETFD, 1) == -1)
+   err(1, %s, group_file);
+   if (flock(lockfd, LOCK_EX|LOCK_NB) == -1) {
+   if (errno == EWOULDBLOCK) {
+   errx(1, the group file is busy);
+   } else {
+   err(1, could not lock the group file: );
+   }
+   }
+   if (fstat(lockfd, st) == -1)
+   err(1, fstat() failed: );
+   if (st.st_nlink != 0)
+   break;
+   close(lockfd);
+   lockfd = -1;
+   }
+   return (lockfd);
+}
+
+/*
+ * Create and open a presmuably safe temp file for editing group data
+ */
+int
+gr_tmp(int mfd)
+{
+   char buf[8192];
+   ssize_t nr;
+   const char *p;
+   int tfd;
+
+   if (*group_file == '\0')
+   return (-1);
+   if ((p = strrchr(group_file, '/')))
+   ++p;
+   else
+   p = group_file;
+   if (snprintf(tempname, sizeof(tempname), %.*sgroup.XX,
+   (int)(p - group_file), group_file) = (int)sizeof(tempname)) {
+   errno = ENAMETOOLONG;
+   return (-1);
+   }
+   if ((tfd = mkstemp(tempname)) == -1)
+   return (-1);
+   if (mfd != -1) {
+   while ((nr = read(mfd, buf, sizeof(buf)))  0)
+   if (write(tfd, buf, (size_t)nr) != nr)
+   break;
+   if (nr != 0) {
+   unlink(tempname);
+   *tempname = '\0';
+   close(tfd);
+   return (-1);
+   }
+   }
+   return (tfd);
+}
+
+/*
+ * Copy the group file from one descriptor to another, replacing, deleting
+ * or adding a single record on the way.
+ */
+int
+gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr)
+{
+   char buf[8192], *end, *line, *p, *q, *r, t;
+   struct group *fgr;
+   const struct group *sgr;
+   size_t len;
+   int eof, readlen;
+
+   sgr = gr;
+   if (gr == NULL) {
+   line = NULL;

svn commit: r228546 - head/share/mk

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Thu Dec 15 22:08:08 2011
New Revision: 228546
URL: http://svn.freebsd.org/changeset/base/228546

Log:
  Clang has more warnings enabled by default, and when using -Wall, so if WARNS
  is set to low values, some of them have to be disabled explicitly.
  
  MFC after:1 week

Modified:
  head/share/mk/bsd.sys.mk

Modified: head/share/mk/bsd.sys.mk
==
--- head/share/mk/bsd.sys.mkThu Dec 15 22:07:36 2011(r228545)
+++ head/share/mk/bsd.sys.mkThu Dec 15 22:08:08 2011(r228546)
@@ -57,6 +57,19 @@ CWARNFLAGS   +=  -Wchar-subscripts -Winline
 CWARNFLAGS +=  -Wno-uninitialized
 .  endif
 CWARNFLAGS +=  -Wno-pointer-sign
+# Clang has more warnings enabled by default, and when using -Wall, so if WARNS
+# is set to low values, these have to be disabled explicitly.
+.  if ${CC:T:Mclang} == clang
+.   if ${WARNS} = 3
+CWARNFLAGS +=  -Wno-tautological-compare -Wno-unused-value
+.   endif
+.   if ${WARNS} = 2
+CWARNFLAGS +=  -Wno-switch-enum
+.   endif
+.   if ${WARNS} = 1
+CWARNFLAGS +=  -Wno-parentheses
+.   endif
+.  endif
 . endif
 
 . if defined(FORMAT_AUDIT)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228547 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Thu Dec 15 22:10:27 2011
New Revision: 228547
URL: http://svn.freebsd.org/changeset/base/228547

Log:
  Cast away a clang alignment warning in drti.c's fixsymbol() function.
  This code only runs on i386 and amd64, so there should be no problems if
  buf + sec-dofs_offset is not aligned (which is unlikely anyway).
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c   Thu Dec 15 
22:08:08 2011(r228546)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c   Thu Dec 15 
22:10:27 2011(r228547)
@@ -102,7 +102,7 @@ fixsymbol(Elf *e, Elf_Data *data, size_t
int ndx;
 
while (gelf_getsym(data, j++, sym) != NULL) {
-   prb = (dof_probe_t *)(buf + sec-dofs_offset);
+   prb = (dof_probe_t *)(void *)(buf + sec-dofs_offset);
 
for (ndx = nprobes; ndx; ndx--, prb += 1) {
funcname = dofstrtab + prb-dofpr_func;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r228514 - head/sys/net80211

2011-12-15 Thread Adrian Chadd
On 15 December 2011 02:15, Bernhard Schmidt bschm...@freebsd.org wrote:

 So in short: if you're happy removing it, remove it. :)

 I agree on passing the frame as an argument to iac_check() and obtain
 the mac from there, that definitely is required for more advanced
 ACLs. Passing both tough, is imho not required and redundant, so, yes
 I think I'm going to remove it.

Go for it. ;)


Adrian
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228548 - head/cddl/contrib/opensolaris/lib/libdtrace/i386

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Thu Dec 15 22:37:33 2011
New Revision: 228548
URL: http://svn.freebsd.org/changeset/base/228548

Log:
  In cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c, use the
  correct printf format for an unsigned long.
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.cThu Dec 
15 22:10:27 2011(r228547)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.cThu Dec 
15 22:37:33 2011(r228548)
@@ -436,7 +436,7 @@ dt_pid_create_glob_offset_probes(struct 
char name[sizeof (i) * 2 + 1];
 
for (i = 0; i  end; i += size) {
-   (void) snprintf(name, sizeof (name), %x, i);
+   (void) snprintf(name, sizeof (name), %lx, i);
if (gmatch(name, pattern))
ftp-ftps_offs[ftp-ftps_noffs++] = i;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228549 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Thu Dec 15 22:46:04 2011
New Revision: 228549
URL: http://svn.freebsd.org/changeset/base/228549

Log:
  In cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c, use the
  correct printf format for a key_t (aka long).
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cThu Dec 
15 22:37:33 2011(r228548)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.cThu Dec 
15 22:46:04 2011(r228549)
@@ -1106,7 +1106,7 @@ process_obj(dtrace_hdl_t *dtp, const cha
static const char dt_prefix[] = __dtrace;
static const char dt_enabled[] = enabled;
static const char dt_symprefix[] = $dtrace;
-   static const char dt_symfmt[] = %s%d.%s;
+   static const char dt_symfmt[] = %s%ld.%s;
int fd, i, ndx, eprobe, mod = 0;
Elf *elf = NULL;
GElf_Ehdr ehdr;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228550 - head/cddl/contrib/opensolaris/lib/libdtrace/common

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Thu Dec 15 23:06:46 2011
New Revision: 228550
URL: http://svn.freebsd.org/changeset/base/228550

Log:
  In cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c, the
  dt_popc() function assumes that either _ILP32 or _LP64 is defined,
  otherwise it has no suitable implementation.
  
  However, the _ILP32 and _LP64 macros come from isa_defs.h, which is not
  included in this file.  Add the include now, to get the macros defined.
  
  MFC after:1 week

Modified:
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c
==
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.cThu Dec 
15 22:46:04 2011(r228549)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.cThu Dec 
15 23:06:46 2011(r228550)
@@ -27,6 +27,7 @@
 #if defined(sun)
 #include sys/sysmacros.h
 #endif
+#include sys/isa_defs.h
 
 #include strings.h
 #include unistd.h
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228551 - head/share/mk

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Thu Dec 15 23:13:57 2011
New Revision: 228551
URL: http://svn.freebsd.org/changeset/base/228551

Log:
  Disable one more clang warning when WARNS = 3.
  
  MFC after:1 week

Modified:
  head/share/mk/bsd.sys.mk

Modified: head/share/mk/bsd.sys.mk
==
--- head/share/mk/bsd.sys.mkThu Dec 15 23:06:46 2011(r228550)
+++ head/share/mk/bsd.sys.mkThu Dec 15 23:13:57 2011(r228551)
@@ -61,7 +61,8 @@ CWARNFLAGS+=  -Wno-pointer-sign
 # is set to low values, these have to be disabled explicitly.
 .  if ${CC:T:Mclang} == clang
 .   if ${WARNS} = 3
-CWARNFLAGS +=  -Wno-tautological-compare -Wno-unused-value
+CWARNFLAGS +=  -Wno-tautological-compare -Wno-unused-value\
+   -Wno-parentheses-equality
 .   endif
 .   if ${WARNS} = 2
 CWARNFLAGS +=  -Wno-switch-enum
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228552 - head/lib/libipsec

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Thu Dec 15 23:22:24 2011
New Revision: 228552
URL: http://svn.freebsd.org/changeset/base/228552

Log:
  Define YY_NO_INPUT in lib/libipsec/policy_token.l, so lex's input()
  function does not get defined needlessly.
  
  MFC after:1 week

Modified:
  head/lib/libipsec/policy_token.l

Modified: head/lib/libipsec/policy_token.l
==
--- head/lib/libipsec/policy_token.lThu Dec 15 23:13:57 2011
(r228551)
+++ head/lib/libipsec/policy_token.lThu Dec 15 23:22:24 2011
(r228552)
@@ -48,6 +48,7 @@
 
 #include y.tab.h
 #define yylval __libipsecyylval/* XXX */
+#define YY_NO_INPUT
 
 int yylex(void);
 %}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228553 - head/contrib/file

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Thu Dec 15 23:28:17 2011
New Revision: 228553
URL: http://svn.freebsd.org/changeset/base/228553

Log:
  In contrib/file/softmagic.c, fix a potential format string security
  problem.  (This fix has already been applied upstream, but we do not
  have the latest version of file in the tree at the moment.)
  
  MFC after:1 week

Modified:
  head/contrib/file/softmagic.c

Modified: head/contrib/file/softmagic.c
==
--- head/contrib/file/softmagic.c   Thu Dec 15 23:22:24 2011
(r228552)
+++ head/contrib/file/softmagic.c   Thu Dec 15 23:28:17 2011
(r228553)
@@ -1582,7 +1582,7 @@ mget(struct magic_set *ms, const unsigne
 
case FILE_INDIRECT:
if ((ms-flags  (MAGIC_MIME|MAGIC_APPLE)) == 0 
-   file_printf(ms, m-desc) == -1)
+   file_printf(ms, %s, m-desc) == -1)
return -1;
if (nbytes  offset)
return 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r228552 - head/lib/libipsec

2011-12-15 Thread Alexander Best
On Thu Dec 15 11, Dimitry Andric wrote:
 Author: dim
 Date: Thu Dec 15 23:22:24 2011
 New Revision: 228552
 URL: http://svn.freebsd.org/changeset/base/228552
 
 Log:
   Define YY_NO_INPUT in lib/libipsec/policy_token.l, so lex's input()
   function does not get defined needlessly.

could such a minimal change also fix the following cases:

 stage 2.3: build tools
--
cd /usr/obj/usr/subversion-src/sys/ARUNDEL;  
MAKESRCPATH=/usr/subversion-src/sys/dev/aic7xxx/aicasm  make SSP_CFLAGS= 
-DNO_CPU_CFLAGS -DNO_CTF  -f /usr/subversion-src/sys/dev/aic7xxx/aicasm/Makefile
Warning: Object directory not changed from original 
/usr/obj/usr/subversion-src/sys/ARUNDEL
clang -O2 -pipe -nostdinc -I/usr/include -I. 
-I/usr/subversion-src/sys/dev/aic7xxx/aicasm -DSTRIP_FBSDID -std=gnu99 
-Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type 
-Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align 
-Wno-pointer-sign -c /usr/subversion-src/sys/dev/aic7xxx/aicasm/aicasm.c
clang -O2 -pipe -nostdinc -I/usr/include -I. 
-I/usr/subversion-src/sys/dev/aic7xxx/aicasm -DSTRIP_FBSDID -std=gnu99 
-Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type 
-Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align 
-Wno-pointer-sign -c /usr/subversion-src/sys/dev/aic7xxx/aicasm/aicasm_symbol.c
clang -O2 -pipe -nostdinc -I/usr/include -I. 
-I/usr/subversion-src/sys/dev/aic7xxx/aicasm -DSTRIP_FBSDID -std=gnu99 
-Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type 
-Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align 
-Wno-pointer-sign -c aicasm_gram.c
clang -O2 -pipe -nostdinc -I/usr/include -I. 
-I/usr/subversion-src/sys/dev/aic7xxx/aicasm -DSTRIP_FBSDID -std=gnu99 
-Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type 
-Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align 
-Wno-pointer-sign -c aicasm_macro_gram.c
clang -O2 -pipe -nostdinc -I/usr/include -I. 
-I/usr/subversion-src/sys/dev/aic7xxx/aicasm -DSTRIP_FBSDID -std=gnu99 
-Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type 
-Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align 
-Wno-pointer-sign -c aicasm_scan.c
/usr/subversion-src/sys/dev/aic7xxx/aicasm/aicasm_scan.l:843:12: warning: 
function 'input' is not needed and will not be emitted 
[-Wunneeded-internal-declaration]
static int input(void)
   ^
1 warning generated.
lex -t  -Pmm /usr/subversion-src/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l  
aicasm_macro_scan.c
clang -O2 -pipe -nostdinc -I/usr/include -I. 
-I/usr/subversion-src/sys/dev/aic7xxx/aicasm -DSTRIP_FBSDID -std=gnu99 
-Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type 
-Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align 
-Wno-pointer-sign -c aicasm_macro_scan.c
/usr/subversion-src/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l:545:12: warning: 
function 'input' is not needed and will not be emitted 
[-Wunneeded-internal-declaration]
static int input(void)
   ^
1 warning generated.
clang -O2 -pipe -nostdinc -I/usr/include -I. 
-I/usr/subversion-src/sys/dev/aic7xxx/aicasm -DSTRIP_FBSDID -std=gnu99 
-Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter 
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type 
-Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align 
-Wno-pointer-sign  -o aicasm aicasm.o aicasm_symbol.o aicasm_gram.o 
aicasm_macro_gram.o aicasm_scan.o aicasm_macro_scan.o -ll
clang: warning: argument unused during compilation: '-nostdinc'
clang: warning: argument unused during compilation: '-std=gnu99'

?

cheers.
alex

   
   MFC after:  1 week
 
 Modified:
   head/lib/libipsec/policy_token.l
 
 Modified: head/lib/libipsec/policy_token.l
 ==
 --- head/lib/libipsec/policy_token.l  Thu Dec 15 23:13:57 2011
 (r228551)
 +++ head/lib/libipsec/policy_token.l  Thu Dec 15 23:22:24 2011
 (r228552)
 @@ -48,6 +48,7 @@
  
  #include y.tab.h
  #define yylval __libipsecyylval  /* XXX */
 +#define YY_NO_INPUT
  
  int yylex(void);
  %}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228554 - head/sys/contrib/ngatm/netnatm/msg

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Thu Dec 15 23:47:36 2011
New Revision: 228554
URL: http://svn.freebsd.org/changeset/base/228554

Log:
  In sys/contrib/ngatm/netnatm/msg/uni_ie.c, use a more appropriate way to
  tell the compiler some parameters are purposefully unused.
  
  MFC after:1 week

Modified:
  head/sys/contrib/ngatm/netnatm/msg/uni_ie.c

Modified: head/sys/contrib/ngatm/netnatm/msg/uni_ie.c
==
--- head/sys/contrib/ngatm/netnatm/msg/uni_ie.c Thu Dec 15 23:28:17 2011
(r228553)
+++ head/sys/contrib/ngatm/netnatm/msg/uni_ie.c Thu Dec 15 23:47:36 2011
(r228554)
@@ -47,6 +47,8 @@
 #include netnatm/msg/uniprint.h
 #include netnatm/msg/priv.h
 
+#define UNUSED(_p) do { (void)(_p); } while (0)
+
 /*
  * Define internal functions.
  */
@@ -1321,7 +1323,7 @@ check_cause(struct uni_ie_cause *ie, str
return (-1);
}
if (ie-h.present  UNI_CAUSE_PARAM_P) {
-   cx = cx;
+   UNUSED(cx);
}
 
return (0);
@@ -1656,7 +1658,7 @@ DEF_IE_PRINT(itu, callstate)
 
 DEF_IE_CHECK(itu, callstate)
 {
-   cx = cx;
+   UNUSED(cx);
 
switch(ie-state) {
  default:
@@ -1742,7 +1744,7 @@ DEF_IE_PRINT(itu, facility)
 
 DEF_IE_CHECK(itu, facility)
 {
-   cx = cx;
+   UNUSED(cx);
 
if(ie-len  UNI_FACILITY_MAXAPDU)
return -1;
@@ -1811,7 +1813,7 @@ DEF_IE_PRINT(itu, notify)
 
 DEF_IE_CHECK(itu, notify)
 {
-   cx = cx;
+   UNUSED(cx);
 
if(ie-len  UNI_NOTIFY_MAXLEN)
return -1;
@@ -1904,7 +1906,7 @@ DEF_IE_PRINT(net, eetd)
 DEF_IE_CHECK(itu, eetd)
 {
 
-   cx = cx;
+   UNUSED(cx);
 
if (!(ie-h.present  UNI_EETD_CUM_P))
return (-1);
@@ -2298,7 +2300,7 @@ DEF_IE_PRINT(itu, called)
 
 DEF_IE_CHECK(itu, called)
 {
-   cx = cx;
+   UNUSED(cx);
 
if (check_addr(ie-addr))
return (-1);
@@ -2345,7 +2347,7 @@ DEF_IE_PRINT(itu, calledsub)
 
 DEF_IE_CHECK(itu, calledsub)
 {
-   cx = cx;
+   UNUSED(cx);
 
if(check_subaddr(ie-addr))
return -1;
@@ -2396,7 +2398,7 @@ DEF_IE_PRINT(itu, calling)
 
 DEF_IE_CHECK(itu, calling)
 {
-   cx = cx;
+   UNUSED(cx);
 
if(check_addr(ie-addr))
return -1;
@@ -2459,7 +2461,7 @@ DEF_IE_PRINT(itu, callingsub)
 
 DEF_IE_CHECK(itu, callingsub)
 {
-   cx = cx;
+   UNUSED(cx);
 
if(check_subaddr(ie-addr))
return -1;
@@ -2510,7 +2512,7 @@ DEF_IE_PRINT(itu, conned)
 
 DEF_IE_CHECK(itu, conned)
 {
-   cx = cx;
+   UNUSED(cx);
 
if(check_addr(ie-addr))
return -1;
@@ -2573,7 +2575,7 @@ DEF_IE_PRINT(itu, connedsub)
 
 DEF_IE_CHECK(itu, connedsub)
 {
-   cx = cx;
+   UNUSED(cx);
 
if(check_subaddr(ie-addr))
return -1;
@@ -2627,7 +2629,7 @@ DEF_IE_PRINT(itu, epref)
 
 DEF_IE_CHECK(itu, epref)
 {
-   cx = cx;
+   UNUSED(cx);
 
if(ie-epref = (215))
return -1;
@@ -2702,7 +2704,7 @@ DEF_IE_PRINT(itu, epstate)
 
 DEF_IE_CHECK(itu, epstate)
 {
-   cx = cx;
+   UNUSED(cx);
 
switch(ie-state) {
  default:
@@ -2895,7 +2897,7 @@ DEF_IE_PRINT(itu, aal)
 
 DEF_IE_CHECK(itu, aal)
 {
-   cx = cx;
+   UNUSED(cx);
 
if(ie-type == UNI_AAL_0) {
;
@@ -3784,7 +3786,7 @@ DEF_IE_CHECK(itu, mintraffic)
 {
u_int abr;
u_int xbr;
-   cx = cx;
+   UNUSED(cx);
 
abr = ie-h.present  (UNI_MINTRAFFIC_FABR1_P|UNI_MINTRAFFIC_BABR1_P);
xbr = ie-h.present  (UNI_MINTRAFFIC_FPCR0_P|UNI_MINTRAFFIC_BPCR0_P|
@@ -3869,7 +3871,7 @@ DEF_IE_PRINT(net, mdcr)
 
 DEF_IE_CHECK(net, mdcr)
 {
-   cx = cx;
+   UNUSED(cx);
 
if ((ie-origin != UNI_MDCR_ORIGIN_USER 
ie-origin != UNI_MDCR_ORIGIN_NET) ||
@@ -3965,7 +3967,7 @@ DEF_IE_PRINT(itu, connid)
 
 DEF_IE_CHECK(itu, connid)
 {
-   cx = cx;
+   UNUSED(cx);
switch(ie-type) {
  default:
return -1;
@@ -4075,7 +4077,7 @@ DEF_IE_PRINT(net, qos)
 
 DEF_IE_CHECK(itu, qos)
 {
-   cx = cx;
+   UNUSED(cx);
 
switch(ie-fwd) {
  default:
@@ -4096,7 +4098,7 @@ DEF_IE_CHECK(itu, qos)
 
 DEF_IE_CHECK(net, qos)
 {
-   cx = cx;
+   UNUSED(cx);
 
switch(ie-fwd) {
  default:
@@ -4205,7 +4207,7 @@ DEF_IE_PRINT(itu, bhli)
 
 DEF_IE_CHECK(itu, bhli)
 {
-   cx = cx;
+   UNUSED(cx);
 
switch(ie-type) {
  default:
@@ -4357,7 +4359,7 @@ DEF_IE_PRINT(itu, bearer)
 #define QTYPE0(C)  ((UNI_BEARER_##C  8) | (1  16))
 DEF_IE_CHECK(itu, bearer)
 {
-   cx = cx;
+   UNUSED(cx);
 
switch((ie-bclass  8) |
   ((ie-h.present  UNI_BEARER_ATC_P) == 0
@@ -4656,7 +4658,7 @@ DEF_IE_PRINT(itu, blli)
 
 DEF_IE_CHECK(itu, blli)
 {
-   cx = cx;
+   UNUSED(cx);
 /*
if(ie-h.present  UNI_BLLI_L1_P)
  

svn commit: r228555 - head/lib/libipsec

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 00:01:19 2011
New Revision: 228555
URL: http://svn.freebsd.org/changeset/base/228555

Log:
  In lib/libipsec/policy_token.l, use lex's standard %option noinput
  instead of hand-defining the YY_NO_INPUT macro.
  
  MFC after:1 week

Modified:
  head/lib/libipsec/policy_token.l

Modified: head/lib/libipsec/policy_token.l
==
--- head/lib/libipsec/policy_token.lThu Dec 15 23:47:36 2011
(r228554)
+++ head/lib/libipsec/policy_token.lFri Dec 16 00:01:19 2011
(r228555)
@@ -48,13 +48,13 @@
 
 #include y.tab.h
 #define yylval __libipsecyylval/* XXX */
-#define YY_NO_INPUT
 
 int yylex(void);
 %}
 
 %option noyywrap
 %option nounput
+%option noinput
 
 /* common section */
 nl \n
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228556 - head/sys/dev/aic7xxx/aicasm

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 00:04:28 2011
New Revision: 228556
URL: http://svn.freebsd.org/changeset/base/228556

Log:
  Add %option noinput to aicasm_scan.l and aicasm_macro_scan.l, so no
  unneeded input functions will be emitted.
  
  Spotted by:   arundel
  MFC after:1 week

Modified:
  head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l
  head/sys/dev/aic7xxx/aicasm/aicasm_scan.l

Modified: head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l
==
--- head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Fri Dec 16 00:01:19 
2011(r228555)
+++ head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Fri Dec 16 00:04:28 
2011(r228556)
@@ -66,6 +66,8 @@ static char msgbuf[255];
 extern int mmlex(void);
 %}
 
+%option noinput
+
 WORD   [A-Za-z_][-A-Za-z_0-9]*
 SPACE  [ \t]+
 MCARG  [^(), \t]+

Modified: head/sys/dev/aic7xxx/aicasm/aicasm_scan.l
==
--- head/sys/dev/aic7xxx/aicasm/aicasm_scan.l   Fri Dec 16 00:01:19 2011
(r228555)
+++ head/sys/dev/aic7xxx/aicasm/aicasm_scan.l   Fri Dec 16 00:04:28 2011
(r228556)
@@ -72,6 +72,8 @@ extern void mm_switch_to_buffer(YY_BUFFE
 extern void mm_delete_buffer(YY_BUFFER_STATE);
 %}
 
+%option noinput
+
 PATH   ([/]*[-A-Za-z0-9_.])+
 WORD   [A-Za-z_][-A-Za-z_0-9]*
 SPACE  [ \t]+
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228557 - head/lib/libpmc

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 00:13:43 2011
New Revision: 228557
URL: http://svn.freebsd.org/changeset/base/228557

Log:
  In lib/libpmc/libpmc.c, struct pmc_cputype_map's pm_cputype field should
  be of type 'enum pmc_cputype', not 'enum pmc_class'.
  
  MFC after:1 week

Modified:
  head/lib/libpmc/libpmc.c

Modified: head/lib/libpmc/libpmc.c
==
--- head/lib/libpmc/libpmc.cFri Dec 16 00:04:28 2011(r228556)
+++ head/lib/libpmc/libpmc.cFri Dec 16 00:13:43 2011(r228557)
@@ -289,7 +289,7 @@ static const char * pmc_class_names[] = 
 };
 
 struct pmc_cputype_map {
-   enum pmc_class  pm_cputype;
+   enum pmc_cputype pm_cputype;
const char  *pm_name;
 };
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228558 - head/lib/libsm

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 00:39:44 2011
New Revision: 228558
URL: http://svn.freebsd.org/changeset/base/228558

Log:
  Unfortunately, clang gives a warning about sendmail code that cannot be
  turned off yet.  Since this is contrib code, and we don't really care
  about the warnings, just turn make them non-fatal for now.
  
  MFC after:1 week

Modified:
  head/lib/libsm/Makefile

Modified: head/lib/libsm/Makefile
==
--- head/lib/libsm/Makefile Fri Dec 16 00:13:43 2011(r228557)
+++ head/lib/libsm/Makefile Fri Dec 16 00:39:44 2011(r228558)
@@ -18,6 +18,13 @@ CFLAGS+=${SENDMAIL_CFLAGS}
 
 WARNS?=2
 
+.if ${CC:T:Mclang} == clang
+# Unfortunately, clang gives a warning about sendmail code that cannot
+# be turned off yet.  Since this is contrib code, and we don't really
+# care about the warnings, just turn make them non-fatal for now.
+NO_WERROR=
+.endif
+
 LIB=   sm
 
 SRCS+= sm_os.h
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228559 - head/contrib/telnet/libtelnet

2011-12-15 Thread Dimitry Andric
Author: dim
Date: Fri Dec 16 00:48:53 2011
New Revision: 228559
URL: http://svn.freebsd.org/changeset/base/228559

Log:
  In contrib/telnet/libtelnet/sra.c, use the correct number of bytes to
  zero the password buffer.
  
  MFC after:1 week

Modified:
  head/contrib/telnet/libtelnet/sra.c

Modified: head/contrib/telnet/libtelnet/sra.c
==
--- head/contrib/telnet/libtelnet/sra.c Fri Dec 16 00:39:44 2011
(r228558)
+++ head/contrib/telnet/libtelnet/sra.c Fri Dec 16 00:48:53 2011
(r228559)
@@ -303,7 +303,7 @@ sra_reply(Authenticator *ap, unsigned ch
goto enc_user;
}
/* encode password */
-   memset(pass,0,sizeof(pass));
+   memset(pass,0,256);
telnet_gets(Password: ,pass,255,0);
pk_encode(pass,xpass,ck);
/* send it off */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228560 - head/sys/fs/nfsserver

2011-12-15 Thread Rick Macklem
Author: rmacklem
Date: Fri Dec 16 00:58:41 2011
New Revision: 228560
URL: http://svn.freebsd.org/changeset/base/228560

Log:
  Patch the new NFS server in a manner analagous to r228520 for the
  old NFS server, so that it correctly handles a count == 0 argument
  for Commit.
  
  PR:   kern/118126
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cFri Dec 16 00:48:53 2011
(r228559)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cFri Dec 16 00:58:41 2011
(r228560)
@@ -1254,7 +1254,13 @@ nfsvno_fsync(struct vnode *vp, u_int64_t
 {
int error = 0;
 
-   if (cnt  MAX_COMMIT_COUNT) {
+   /*
+* RFC 1813 3.3.21: if count is 0, a flush from offset to the end of
+* file is done.  At this time VOP_FSYNC does not accept offset and
+* byte count parameters so call VOP_FSYNC the whole file for now.
+* The same is true for NFSv4: RFC 3530 Sec. 14.2.3.
+*/
+   if (cnt == 0 || cnt  MAX_COMMIT_COUNT) {
/*
 * Give up and do the whole thing
 */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r228561 - in head: share/man/man4 sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/firmware sys/modules/cxgbe sys/modules/cxgbe/firmware tools/tools/cxgbetool

2011-12-15 Thread Navdeep Parhar
Author: np
Date: Fri Dec 16 02:09:51 2011
New Revision: 228561
URL: http://svn.freebsd.org/changeset/base/228561

Log:
  Many updates to cxgbe(4)
  
  - Device configuration via plain text config file.  Also able to operate
when not attached to the chip as the master driver.
  
  - Generic work request queue that serves as the base for both ctrl and
ofld tx queues.
  
  - Generic interrupt handler routine that can process any event on any
kind of ingress queue (via a dispatch table).
  
  - A couple of new driver ioctls.  cxgbetool can now install a firmware
to the card (loadfw command) and can read the card's memory
(memdump and tcb commands).
  
  - Lots of assorted information within dev.t4nex.X.misc.*  This is
primarily for debugging and won't show up in sysctl -a.
  
  - Code to manage the L2 tables on the chip.
  
  - Updates to cxgbe(4) man page to go with the tunables that have changed.
  
  - Updates to the shared code in common/
  
  - Updates to the driver-firmware interface (now at fw 1.4.16.0)
  
  MFC after:1 month

Added:
  head/sys/dev/cxgbe/firmware/
  head/sys/dev/cxgbe/firmware/t4fw_cfg.txt   (contents, props changed)
  head/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt   (contents, props changed)
  head/sys/dev/cxgbe/firmware/t4fw_interface.h
 - copied, changed from r228535, head/sys/dev/cxgbe/common/t4fw_interface.h
  head/sys/modules/cxgbe/firmware/
  head/sys/modules/cxgbe/firmware/Makefile   (contents, props changed)
Deleted:
  head/sys/dev/cxgbe/common/t4fw_interface.h
Modified:
  head/share/man/man4/cxgbe.4
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/common/common.h
  head/sys/dev/cxgbe/common/t4_hw.c
  head/sys/dev/cxgbe/common/t4_hw.h
  head/sys/dev/cxgbe/offload.h
  head/sys/dev/cxgbe/osdep.h
  head/sys/dev/cxgbe/t4_ioctl.h
  head/sys/dev/cxgbe/t4_l2t.c
  head/sys/dev/cxgbe/t4_l2t.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/t4_sge.c
  head/sys/modules/cxgbe/Makefile
  head/tools/tools/cxgbetool/cxgbetool.c

Modified: head/share/man/man4/cxgbe.4
==
--- head/share/man/man4/cxgbe.4 Fri Dec 16 00:58:41 2011(r228560)
+++ head/share/man/man4/cxgbe.4 Fri Dec 16 02:09:51 2011(r228561)
@@ -99,18 +99,29 @@ Tunables can be set at the
 prompt before booting the kernel or stored in
 .Xr loader.conf 5 .
 .Bl -tag -width indent
-.It Va hw.cxgbe.max_ntxq_10G_port
-The maximum number of tx queues to use for a 10Gb port.
-The default value is 8.
-.It Va hw.cxgbe.max_nrxq_10G_port
-The maximum number of rx queues to use for a 10Gb port.
-The default value is 8.
-.It Va hw.cxgbe.max_ntxq_1G_port
-The maximum number of tx queues to use for a 1Gb port.
-The default value is 2.
-.It Va hw.cxgbe.max_nrxq_1G_port
-The maximum number of rx queues to use for a 1Gb port.
-The default value is 2.
+.It Va hw.cxgbe.ntxq10g
+The number of tx queues to use for a 10Gb port.  The default is 16 or the 
number
+of CPU cores in the system, whichever is less.
+.It Va hw.cxgbe.nrxq10g
+The number of rx queues to use for a 10Gb port.  The default is 8 or the number
+of CPU cores in the system, whichever is less.
+.It Va hw.cxgbe.ntxq1g
+The number of tx queues to use for a 1Gb port.  The default is 4 or the number
+of CPU cores in the system, whichever is less.
+.It Va hw.cxgbe.nrxq1g
+The number of rx queues to use for a 1Gb port.  The default is 2 or the number
+of CPU cores in the system, whichever is less.
+.It Va hw.cxgbe.nofldtxq10g
+The number of TOE tx queues to use for a 10Gb port.  The default is 8 or the
+number of CPU cores in the system, whichever is less.
+.It Va hw.cxgbe.nofldrxq10g
+The number of TOE rx queues to use for a 10Gb port.  The default is 2 or the
+number of CPU cores in the system, whichever is less.
+.It Va hw.cxgbe.nofldtxq1g
+The number of TOE tx queues to use for a 1Gb port.  The default is 2 or the
+number of CPU cores in the system, whichever is less.
+.It Va hw.cxgbe.nofldrxq1g
+The number of TOE rx queues to use for a 1Gb port.  The default is 1.
 .It Va hw.cxgbe.holdoff_timer_idx_10G
 .It Va hw.cxgbe.holdoff_timer_idx_1G
 The timer index value to use to delay interrupts.
@@ -119,6 +130,8 @@ by default (all values are in microsecon
 value from this list.
 The default value is 1 for both 10Gb and 1Gb ports, which means the
 timer value is 5us.
+Different cxgbe interfaces can be assigned different values at any time via the
+dev.cxgbe.X.holdoff_tmr_idx sysctl.
 .It Va hw.cxgbe.holdoff_pktc_idx_10G
 .It Va hw.cxgbe.holdoff_pktc_idx_1G
 The packet-count index value to use to delay interrupts.
@@ -127,6 +140,11 @@ and the index selects a value from this 
 The default value is 2 for both 10Gb and 1Gb ports, which means 16
 packets (or the holdoff timer going off) before an interrupt is
 generated.
+-1 disables packet counting.
+Different cxgbe interfaces can be assigned different values via the
+dev.cxgbe.X.holdoff_pktc_idx sysctl.
+This sysctl works 

Re: svn commit: r223637 - in head: . contrib/pf/authpf contrib/pf/ftp-proxy contrib/pf/man contrib/pf/pfctl contrib/pf/pflogd sbin/pflogd sys/conf sys/contrib/altq/altq sys/contrib/pf/net sys/modules

2011-12-15 Thread Peter Jeremy
On 2011-Jun-28 11:57:25 +, Bjoern A. Zeeb b...@freebsd.org wrote:
Author: bz
Date: Tue Jun 28 11:57:25 2011
New Revision: 223637
URL: http://svn.freebsd.org/changeset/base/223637

Log:
  Update packet filter (pf) code to OpenBSD 4.5.

Further to my mail last Wednesday, I've found nested #ifdef __FreeBSD__
conditionals in pf_ioctl.c as well - it looks like conditional code was
added to support network stack virtualisation without noting that the
code was already protectd by a #ifdef __FreeBSD__.

And cross-checking the $OpenBSD$ tags in the FreeBSD repo against the
OpenBSD CVSweb throws up consistent off-by-one errors - as an example,
src/sys/contrib/pf/net/if_pfsync.h in FreeBSD 9.0 states
$OpenBSD: if_pfsync.h,v 1.35 2008/06/29 08:42:15 mcbride Exp $
but the actual content matches if_pfsync.h v1.36 in OpenBSD CVSweb.
Is it possible that the pf code was checked out of an OpenBSD repo
without the correct $OpenBSD$ tag expansion?

This caused me a degree of confusion whilst trying to correlate the
FreeBSD code with the OpenBSD code to try and update bin/124825

-- 
Peter Jeremy


pgpbc129oOVJn.pgp
Description: PGP signature


Re: svn commit: r223637 - in head: . contrib/pf/authpf contrib/pf/ftp-proxy contrib/pf/man contrib/pf/pfctl contrib/pf/pflogd sbin/pflogd sys/conf sys/contrib/altq/altq sys/contrib/pf/net sys/modules

2011-12-15 Thread Gleb Smirnoff
  Peter,

On Fri, Dec 16, 2011 at 01:58:51PM +1100, Peter Jeremy wrote:
P On 2011-Jun-28 11:57:25 +, Bjoern A. Zeeb b...@freebsd.org wrote:
P Author: bz
P Date: Tue Jun 28 11:57:25 2011
P New Revision: 223637
P URL: http://svn.freebsd.org/changeset/base/223637
P 
P Log:
P   Update packet filter (pf) code to OpenBSD 4.5.
P 
P Further to my mail last Wednesday, I've found nested #ifdef __FreeBSD__
P conditionals in pf_ioctl.c as well - it looks like conditional code was
P added to support network stack virtualisation without noting that the
P code was already protectd by a #ifdef __FreeBSD__.
P 
P And cross-checking the $OpenBSD$ tags in the FreeBSD repo against the
P OpenBSD CVSweb throws up consistent off-by-one errors - as an example,
P src/sys/contrib/pf/net/if_pfsync.h in FreeBSD 9.0 states
P $OpenBSD: if_pfsync.h,v 1.35 2008/06/29 08:42:15 mcbride Exp $
P but the actual content matches if_pfsync.h v1.36 in OpenBSD CVSweb.
P Is it possible that the pf code was checked out of an OpenBSD repo
P without the correct $OpenBSD$ tag expansion?
P 
P This caused me a degree of confusion whilst trying to correlate the
P FreeBSD code with the OpenBSD code to try and update bin/124825

  Particular changes were picked from OpenBSD after the r223637, to
make pfsync(4) function properly. For example:

http://svnweb.freebsd.org/base?view=revisionrevision=226663

-- 
Totus tuus, Glebius.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org