Pink Floyd-Led Zeppeling-Alan Parsons Proyect - Discografía y Pendrive de Regalo
Alan Parsons ProjectTry AnythingAnthologyEye In The SkyEssentialFreudianaPop ClassicssStereotomyo aPyramidaaAmmonia Avenuea aEvea I RobotoaKeats Plus a Tales Of Mystery And ImaginationThe Instrumental WorkThe Turn of a Friendly Cardo aLadyhawkea The Best Of AlanParson Projectu aVulture CultureoPink Floyd Piper At TheGates Of DawnA Saucerful Of SecretsMoreaAtom HeartMother5Meddle i Obscured By Clouds p The Dark Sideof the MoonWish YouWere HereAnimals 5The Wallo The Final CutThe Division Bell o aUmmagumma a aRelics a Brain DamageoStranger Than FictionLed Zeppelin Codap Houses OfThe HolyIn ThroughThe Out DoorLatterDays5Led Zeppelin ILed Zeppelin IILed Zeppelin IIILed Zeppelin IVPhsycical GraffitiPresence
Re: pf(4) man page: include missing header in example program
On 2011/05/02 22:28, Lawrence Teo wrote: The DIOCNATLOOK example program at the end of the pf(4) man page uses memset(3), but string.h is not included. The following diff fixes this. Any thoughts? That change is correct but I'm not sure about keeping this example code at all. We've had divert-to since OpenBSD 4.4 - when this is used instead of rdr-to the destination address is preserved, so it can be fetched with getsockname() without the DIOCNATLOOK dance. As a result the code becomes much less complicated, so we don't really need an example any more, also another big advantage is that there's no need for access to the privileged /dev/pf device. How about this? Index: pf.4 === RCS file: /cvs/src/share/man/man4/pf.4,v retrieving revision 1.72 diff -u -p -r1.72 pf.4 --- pf.428 Dec 2010 13:56:11 - 1.72 +++ pf.43 May 2011 07:56:14 - @@ -314,6 +314,13 @@ struct pfioc_natlook { u_int8_t direction; }; .Ed +This was used to support transparent proxies with rdr-to rules. +New code should use divert-to rules instead. +These preserve the original destination address for +.Xr getsockname 2 +and do not require access to the privileged +.Pa /dev/pf +device. .It Dv DIOCSETDEBUG Fa u_int32_t *level Set the debug level. See the @@ -988,73 +995,6 @@ Explicitly remove source tracking nodes. .It Pa /dev/pf packet filtering device. .El -.Sh EXAMPLES -The following example demonstrates how to use the -.Dv DIOCNATLOOK -command to find the internal host/port of a NATed connection: -.Bd -literal -#include sys/types.h -#include sys/socket.h -#include sys/ioctl.h -#include sys/fcntl.h -#include net/if.h -#include netinet/in.h -#include net/pfvar.h -#include err.h -#include stdio.h -#include stdlib.h - -u_int32_t -read_address(const char *s) -{ - int a, b, c, d; - - sscanf(s, %i.%i.%i.%i, a, b, c, d); - return htonl(a 24 | b 16 | c 8 | d); -} - -void -print_address(u_int32_t a) -{ - a = ntohl(a); - printf(%d.%d.%d.%d, a 24 255, a 16 255, - a 8 255, a 255); -} - -int -main(int argc, char *argv[]) -{ - struct pfioc_natlook nl; - int dev; - - if (argc != 5) { - printf(%s gwy addr gwy port ext addr ext port\en, - argv[0]); - return 1; - } - - dev = open(/dev/pf, O_RDWR); - if (dev == -1) - err(1, open(\e/dev/pf\e) failed); - - memset(nl, 0, sizeof(struct pfioc_natlook)); - nl.saddr.v4.s_addr = read_address(argv[1]); - nl.sport= htons(atoi(argv[2])); - nl.daddr.v4.s_addr = read_address(argv[3]); - nl.dport= htons(atoi(argv[4])); - nl.af = AF_INET; - nl.proto= IPPROTO_TCP; - nl.direction= PF_IN; - - if (ioctl(dev, DIOCNATLOOK, nl)) - err(1, DIOCNATLOOK); - - printf(internal host ); - print_address(nl.rsaddr.v4.s_addr); - printf(:%u\en, ntohs(nl.rsport)); - return 0; -} -.Ed .Sh SEE ALSO .Xr ioctl 2 , .Xr bridge 4 ,
macppc: fix volume +/- from keyboard (i2s)
This diff fix the use of the volume keys +/- for the iBooks/PowerBooks. Index: dev/i2s.c === RCS file: /cvs/src/sys/arch/macppc/dev/i2s.c,v retrieving revision 1.18 diff -u -p -r1.18 i2s.c --- dev/i2s.c 15 Jul 2010 03:43:11 - 1.18 +++ dev/i2s.c 3 May 2011 08:01:16 - @@ -637,9 +637,7 @@ i2s_get_port(h, mc) } int -i2s_query_devinfo(h, dip) - void *h; - mixer_devinfo_t *dip; +i2s_query_devinfo(void *h, mixer_devinfo_t *dip) { struct i2s_softc *sc = h; int n = 0; @@ -674,6 +672,7 @@ i2s_query_devinfo(h, dip) dip-type = AUDIO_MIXER_VALUE; dip-prev = dip-next = AUDIO_MIXER_LAST; dip-un.v.num_channels = 2; + dip-un.v.delta = 8; strlcpy(dip-un.v.units.name, AudioNvolume, sizeof(dip-un.v.units.name)); return 0;
Re: alc(4) support for Atheros AR815x
Edd Barrett wrote: On Mon, May 02, 2011 at 11:02:41AM +0100, Stuart Henderson wrote: On 2011/05/02 01:16, Edd Barrett wrote: On Sun, May 01, 2011 at 08:10:56PM +0100, Stuart Henderson wrote: On 2011/05/01 18:35, Edd Barrett wrote: I have acquired a netboot (packard bell dot s), which I think uses this NIC. Is there an updated diff? Yes I just took the 2 minutes it took to apply it and fix the minor conflicts and linewrapping issue with the diff. Untested beyond it builds. Stu's diff seems to work, kevlo's diff really.. although the first time i booted my bsd.rd I was unable to install due to: alc0: watchdog timeout (missed link) I had a report of a system with alc(4) which only works if the cable is connected at boot. Is that what happens for you too? If so, try this, similar to freebsd r214542. This change was already included in kevlo's diff. It does seem like it could still be related to the link state. I managed to get another error by: * booting with no cable plugged in. * once the system is up, connect a cable * run dhclient alc0 Then as DHREQUESTs were sent some kernel messages: alc0: watchdog timeout I have seen such a timeouts on age(4). The issue occurs irregularly, box just stops responding over network for a while, records watchdog timeout and then box become available again. dmesg follows (age(4) is dropped in favor of xl(4) so no watchdog timeouts recorded at the moment). From my understanding it can be a common issue with atphy(4) so both alc(4) and age(4) are affected. Alexey OpenBSD 4.7-beta (GENERIC.MP) #82: Fri Feb 5 01:05:44 MST 2010 t...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP real mem = 2145910784 (2046MB) avail mem = 2079428608 (1983MB) mainbus0 at root bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xf06e0 (71 entries) bios0: vendor American Megatrends Inc. version 0603 date 07/03/2007 bios0: ASUSTeK Computer INC. P5K acpi0 at bios0: rev 0 acpi0: tables DSDT FACP APIC MCFG OEMB HPET OSFR acpi0: wakeup devices P0P2(S4) P0P1(S4) UAR1(S4) PS2K(S4) EUSB(S4) USBE(S4) P0P5(S4) P0P6(S4) P0P7(S4) P0P8(S4) P0P9(S4) USB0(S4) USB1(S4) USB2(S4) USB3(S4) USB4(S4) USB5(S4) USB6(S4) P0P4(S4) acpitimer0 at acpi0: 3579545 Hz, 24 bits acpimadt0 at acpi0 addr 0xfee0: PC-AT compat cpu0 at mainbus0: apid 0 (boot processor) cpu0: Intel(R) Core(TM)2 Duo CPU E6750 @ 2.66GHz, 2671.97 MHz cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,CX16,xTPR,NXE,LONG cpu0: 4MB 64b/line 16-way L2 cache cpu0: apic clock running at 333MHz cpu1 at mainbus0: apid 1 (application processor) cpu1: Intel(R) Core(TM)2 Duo CPU E6750 @ 2.66GHz, 2671.61 MHz cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,CX16,xTPR,NXE,LONG cpu1: 4MB 64b/line 16-way L2 cache ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins acpihpet0 at acpi0: 14318179 Hz acpiprt0 at acpi0: bus 0 (PCI0) acpiprt1 at acpi0: bus 1 (P0P2) acpiprt2 at acpi0: bus 5 (P0P1) acpiprt3 at acpi0: bus -1 (P0P5) acpiprt4 at acpi0: bus -1 (P0P6) acpiprt5 at acpi0: bus -1 (P0P7) acpiprt6 at acpi0: bus 3 (P0P8) acpiprt7 at acpi0: bus 2 (P0P9) acpiprt8 at acpi0: bus 4 (P0P4) acpicpu0 at acpi0: PSS acpicpu1 at acpi0: PSS aibs0 at acpi0 acpibtn0 at acpi0: PWRB cpu0: Enhanced SpeedStep 2671 MHz: speeds: 2664, 1998 MHz pci0 at mainbus0 bus 0 pchb0 at pci0 dev 0 function 0 Intel 82G33 Host rev 0x02 ppb0 at pci0 dev 1 function 0 Intel 82G33 PCIE rev 0x02: apic 2 int 16 (irq 11) pci1 at ppb0 bus 1 vga1 at pci1 dev 0 function 0 vendor NVIDIA, unknown product 0x0400 rev 0xa1 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation) wsdisplay0: screen 1-5 added (80x25, vt100 emulation) uhci0 at pci0 dev 26 function 0 Intel 82801I USB rev 0x02: apic 2 int 16 (irq 11) uhci1 at pci0 dev 26 function 1 Intel 82801I USB rev 0x02: apic 2 int 21 (irq 3) uhci2 at pci0 dev 26 function 2 Intel 82801I USB rev 0x02: apic 2 int 18 (irq 5) ehci0 at pci0 dev 26 function 7 Intel 82801I USB rev 0x02: apic 2 int 18 (irq 5) usb0 at ehci0: USB revision 2.0 uhub0 at usb0 Intel EHCI root hub rev 2.00/1.00 addr 1 azalia0 at pci0 dev 27 function 0 Intel 82801I HD Audio rev 0x02: apic 2 int 22 (irq 15) azalia0: codecs: Realtek ALC883 audio0 at azalia0 ppb1 at pci0 dev 28 function 0 Intel 82801I PCIE rev 0x02: apic 2 int 17 (irq 10) pci2 at ppb1 bus 4 ppb2 at pci0 dev 28 function 4 Intel 82801I PCIE rev 0x02: apic 2 int 17 (irq 10) pci3 at ppb2 bus 3 jmb0 at pci3 dev 0 function 0 JMicron JMB363 IDE/SATA rev 0x03 ahci0 at jmb0: apic 2 int 16 (irq 11), AHCI 1.0 scsibus0 at ahci0: 32 targets pciide0 at jmb0: DMA, channel 0 wired to native-PCI, channel 1 wired to native-PCI pciide0: using apic 2 int 16 (irq 11) for native-PCI interrupt pciide0: channel 0 disabled (no drives) pciide0:
perl -w and adduser(8)
I thought I had found a bug in adduser and started having a look at the code. First thing I noticed is it didn't have perl -w so I added it, then realised there wasn't a bug, just user error Anyway, here is the code to allow adduser(8) have perl -w. I have tested and can see no functional change (apart from 2 simple variable type checks at the end). oks/comments? -mark If there is interest in this kind of thing I'm sure I could look at rmuser.8 Index: adduser.perl === RCS file: /cvs/src/usr.sbin/adduser/adduser.perl,v retrieving revision 1.53 diff -u -p -r1.53 adduser.perl --- adduser.perl3 Jan 2007 15:26:04 - 1.53 +++ adduser.perl3 May 2011 09:48:58 - @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # # $OpenBSD: adduser.perl,v 1.53 2007/01/03 15:26:04 simon Exp $ # @@ -667,7 +667,11 @@ sub new_users_group_update { } # group membership might have changed else { - push(@a, $gid{$e}:*:$e:$groupmembers{$e}); + if ($groupmembers{$e}) { + push(@a, $gid{$e}:*:$e:$groupmembers{$e}); + } else { + push(@a, $gid{$e}:*:$e:); + } } } # append empty YP group @@ -788,7 +792,7 @@ sub new_users { local($new_users_ok) = 1; -$new_groups = no unless $groupname{$new_groups}; +$new_groups = no; while(1) { $name = new_users_name; @@ -952,7 +956,8 @@ USAGE # uniq(1) sub uniq { local(@list) = @_; -local($e, $last = , @array); +local($e, $last, @array); +$last = ; foreach $e (sort @list) { push(@array, $e) unless $e eq $last; @@ -1030,7 +1035,7 @@ sub hints { sub parse_arguments { local(@argv) = @_; -while ($_ = $argv[0], /^-/) { +while (@argv ($_ = $argv[0], /^-/)) { shift @argv; last if /^--$/; if(/^--?(v|verbose)$/) { $verbose = 1 } @@ -1285,11 +1290,11 @@ sub confirm_list { # otherwise 0 sub confirm_yn { local($message, $confirm) = @_; -local($yes) = '^(yes|YES|y|Y)$'; -local($no) = '^(no|NO|n|N)$'; +local($yes) = '^(yes|YES|y|Y|1)$'; +local($no) = '^(no|NO|n|N|0)$'; local($read, $c); -if ($confirm ($confirm =~ $yes || $confirm == 1)) { +if ($confirm ($confirm =~ $yes)) { $confirm = y; } else { $confirm = n; @@ -1532,7 +1537,7 @@ verbose = $verbose # Get new password for new users # defaultpasswd = yes | no -defaultpasswd = $defaultpasswd +defaultpasswd = $defaultpasswd # Default encryption method for user passwords # Methods are all those listed in login.conf(5) @@ -1572,7 +1577,7 @@ uid_start = $uid_start uid_end = $uid_end # default login.conf(5) login class -defaultclass = $defaultclass +defaultclass = $defaultclass # login classes available from login.conf(5) # login_classes = ('default', 'daemon', 'staff') @@ -1589,6 +1594,10 @@ EOF # check for sane variables sub variable_check { # Check uid_start uid_end + die ERROR: uid_start not a number\n + if(!($uid_start =~ /^[+-]?\d+$/)); + die ERROR: uid_end not a number\n + if(!($uid_end =~ /^[+-]?\d+$/)); warn WARNING: uid_start 1000!\n if($uid_start 1000); die ERROR: uid_start = uid_end!\n if($uid_start = $uid_end); # unencrypted really only usable in batch mode
Conseils de Gouvernement du 16 et 29 avril 2011
Visitez le portail officiel du Gouvernement de CC4te d'Ivoire, Cliquez ici ( http://www.gouv.ci/; )B B ( http://www.gouv.ci/; ) COMMUNIQUE DU GOUVERNEMENT B CONSEILS DE GOUVERNEMENT ( http://www.gouv.ci/communique_gouv.php?recordID=93; ) B COMMUNIQUES B B B CONSEIL DE GOUVERNEMENT DU 19 AVRIL 2011 Ce jour, mardi 19 avril 2011, Le Conseil de Gouvernement sbest rC)uni sous la prC)sidence de Son Excellence Monsieur Soro Kigbafori Guillaume, Premier Ministre. Cbest la premiC(re fois que ce Conseil de Gouvernement se tenait dans les locaux de la primature au Plateau, depuis la formation du gouvernement, le 5 dC)cembre 2010. B Le Conseil a examinC) la situation sociopolitique en mettant lbaccent sur trois points essentielsB : la reprise des activitC)s gouvernementales et de lbadministration, la question sC)curitaire et la situation des universitC)s. B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B A lire ici. ( http://www.gouv.ci/communique_gouv.php?recordID=143; ) B B CONSEIL DE GOUVERNEMENT DUB 26 AVRIL 2011 Le Conseil de Gouvernement sbest rC)uni ce jour, mardi 26 avril 2011, C la salle du Conseil au Plateau, sous la prC)sidence de Son Excellence MonsieurB Soro Kigbafori Guillaume, Premier Ministre. Au cours de ce Conseil, plusieurs communications ont C)tC) entendues et des dC)cisions arrC*tC)es. B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B B A lire ici. ( http://www.gouv.ci/communique_gouv.php?recordID=145; ) B B B B B B B B B B B B B B Le Conseil des Ministres Ce jour, mardi 19 avril 2011, Le Conseil de Gouvernement sbest rC)uni sous la prC)sidence de Son Excellence Monsieur Soro Kigbafori Guillaume, Premier Ministre. Cbest la premiC(re fois que ce Conseil de Gouvernement se tenait dans les locaux de la primature au Plateau,... Lire plus [+] ( http://www.gouv.ci/communique_gouv.php?recordID=143; ) B B MinistC(re C la UNE - ( http://www.solidarite.gouv.ci/; ) Visitez ce site ( http://www.solidarite.gouv.ci/; ) B B Grands dossiers B ( http://www.gouv.ci/bonnegouvernance2009_2013.php; ) -- B ( http://www.gouv.ci/ajustemet_prix_petrol31052010.php; ) B B B B B LA COMMUNICATION AU COEUR DE L'ACTION GOUVERNEMENTALE B Continuez de nous faire part de vos suggestions ( http://www.gouv.ci/webmaster.php; ).B Merci C toutes celles et tous ceux qui nous ont dC)jC C)crit ! B Si vous ne souhaitez plus recevoir notre lettre d'informations, cliquez ici pour vous dC)sabonner B [demime 1.01d removed an attachment of type image/jpeg which had a name of =?utf-8?Q?charle=5Fkoffi.Jpg?=] [demime 1.01d removed an attachment of type image/jpeg which had a name of =?utf-8?Q?gouvletter.jpg?=] [demime 1.01d removed an attachment of type image/jpeg which had a name of =?utf-8?Q?gouvsoro3.jpg?=] [demime 1.01d removed an attachment of type image/jpeg which had a name of =?utf-8?Q?logo.jpg?=]
Panasonic MD-10000
USD 1499PANASONIC NV-MD1 Sensor: 3 CCD Sistema: PAL / Formato: Mini DV Monitor: TFT 2.5 pulgadas / Zoom: Optico: 15x Digital: 750x / Accesorios incluidos: Cables AV y USB / Bateriacute;a / Adaptador-cargador AC / Software
limit number of tasks on the crypto queue
hi, recently me and jsg have figured out that a traffic burst can kill your interface (deplete the rx ring) if you're using ipsec. the problem is that there's no limit on number of outstanding crypto operations. every job contains a pointer to a cluster that comes from the nic driver. under high load a number of jobs on a crypto queue reaches the limit for the mclpool and network card fails to allocate clusters for the rx ring and stalls (both bnx and ix don't recover). we experimented with large watermarks (2 clusters) but that just delays the problem a bit. real solution is to prevent an excessive amount of operations to be enqueued to the crypto queue. the problem is as usual: how to define a limit? in this diff i've used a 1/3 of the cluster pool hardlimit which behaves pretty good with different kern.maxclusters values. opinions? OKs? (i'm not sure that using `min' in the m_clhardlimit is anyhow better than `max', so please speak up if you know how to improve this.) Index: crypto/crypto.c === RCS file: /home/cvs/src/sys/crypto/crypto.c,v retrieving revision 1.59 diff -u -p -r1.59 crypto.c --- crypto/crypto.c 11 Jan 2011 15:42:05 - 1.59 +++ crypto/crypto.c 3 May 2011 13:56:41 - @@ -677,3 +677,14 @@ out: *featp = feat; return (0); } + +int +crypto_onqueue(u_int64_t sid) +{ + u_int32_t hid; + + hid = (sid 32) 0x; + if (hid crypto_drivers_num) + return (crypto_drivers[hid].cc_queued); + return (0); +} Index: crypto/cryptodev.h === RCS file: /home/cvs/src/sys/crypto/cryptodev.h,v retrieving revision 1.55 diff -u -p -r1.55 cryptodev.h --- crypto/cryptodev.h 16 Dec 2010 16:56:08 - 1.55 +++ crypto/cryptodev.h 3 May 2011 13:21:36 - @@ -323,6 +323,7 @@ int crypto_kinvoke(struct cryptkop *); void crypto_done(struct cryptop *); void crypto_kdone(struct cryptkop *); intcrypto_getfeat(int *); +intcrypto_onqueue(u_int64_t); void cuio_copydata(struct uio *, int, int, caddr_t); void cuio_copyback(struct uio *, int, int, const void *); Index: kern/uipc_mbuf.c === RCS file: /home/cvs/src/sys/kern/uipc_mbuf.c,v retrieving revision 1.156 diff -u -p -r1.156 uipc_mbuf.c --- kern/uipc_mbuf.c18 Apr 2011 19:23:46 - 1.156 +++ kern/uipc_mbuf.c3 May 2011 17:01:14 - @@ -454,6 +454,30 @@ m_clget(struct mbuf *m, int how, struct return (m); } +int +m_clhardlimit(struct mbuf *m) +{ + struct pool *pp; + int limit = 0; + + if (m == NULL) + return (-1); + + do { + if ((m-m_flags (M_EXT|M_CLUSTER)) != (M_EXT|M_CLUSTER)) + continue; + pp = mclpools[m-m_ext.ext_backend]; + if (limit) + limit = min(limit, pp-pr_hardlimit); + else + limit = pp-pr_hardlimit; + } while ((m = m-m_next) != NULL); + + if (!limit) + limit = -1; + return (limit); +} + struct mbuf * m_free_unlocked(struct mbuf *m) { Index: netinet/ip_ah.c === RCS file: /home/cvs/src/sys/netinet/ip_ah.c,v retrieving revision 1.99 diff -u -p -r1.99 ip_ah.c --- netinet/ip_ah.c 11 Jan 2011 15:42:05 - 1.99 +++ netinet/ip_ah.c 3 May 2011 17:35:48 - @@ -548,7 +548,7 @@ ah_input(struct mbuf *m, struct tdb *tdb int rplen; struct cryptodesc *crda = NULL; - struct cryptop *crp; + struct cryptop *crp = NULL; if (!(tdb-tdb_flags TDBF_NOREPLAY)) rplen = AH_FLENGTH + sizeof(u_int32_t); @@ -632,7 +632,9 @@ ah_input(struct mbuf *m, struct tdb *tdb } /* Get crypto descriptors. */ - crp = crypto_getreq(1); + if (m_clhardlimit(m) == -1 || + crypto_onqueue(tdb-tdb_cryptoid) m_clhardlimit(m) / 3) + crp = crypto_getreq(1); if (crp == NULL) { m_freem(m); DPRINTF((ah_input(): failed to acquire crypto @@ -982,7 +984,7 @@ ah_output(struct mbuf *m, struct tdb *td struct cryptodesc *crda; struct tdb_crypto *tc; struct mbuf *mo, *mi; - struct cryptop *crp; + struct cryptop *crp = NULL; u_int16_t iplen; int len, rplen; u_int8_t prot; @@ -1151,7 +1153,9 @@ ah_output(struct mbuf *m, struct tdb *td } /* Get crypto descriptors. */ - crp = crypto_getreq(1); + if (m_clhardlimit(m) == -1 || + crypto_onqueue(tdb-tdb_cryptoid) m_clhardlimit(m) / 3) + crp = crypto_getreq(1); if (crp == NULL) { m_freem(m); DPRINTF((ah_output(): failed to acquire crypto Index: netinet/ip_esp.c
Re: pf(4) man page: include missing header in example program
On Tue, May 3, 2011 at 9:56 AM, Stuart Henderson s...@spacehopper.org wrote: On 2011/05/02 22:28, Lawrence Teo wrote: The DIOCNATLOOK example program at the end of the pf(4) man page uses memset(3), but string.h is not included. The following diff fixes this. Any thoughts? That change is correct but I'm not sure about keeping this example code at all. We've had divert-to since OpenBSD 4.4 - when this is used instead of rdr-to the destination address is preserved, so it can be fetched with getsockname() without the DIOCNATLOOK dance. As a result the code becomes much less complicated, so we don't really need an example any more, also another big advantage is that there's no need for access to the privileged /dev/pf device. How about this? i'm in favor of this change, so ok mikeb
Re: macppc: support for Dynamic Frequency Switching
You can check if your machine supports it by looking for the cpu-vcore-select node in your openfirmware dump: $ eeprom -p |grep vcore FWIW, the only known (to us) systems with that node are: PowerBook4,3 PowerBook6,5 PowerBook6,7 PowerBook6,8 as reported on the `mainbus0' line in dmesg. Miod
Re: macppc: support for Dynamic Frequency Switching
Date: Tue, 26 Apr 2011 18:29:16 +0530 From: Martin Pieuchot mpieuc...@nolizard.org The following diff adds support for dfs. It requires my precedent patch about GPIOs. I don't have a machine with a MPC7448 so it's only tested with a MPC7447A. I'm also interested in various device-tree dumps for further development. If you can send me yours, contact me off list. Comments ? Looks good! Unfortunately the G4 mini (which has the MPC7447A) doesn't support this. Just two comments: Index: dev/dfs.c === RCS file: dev/dfs.c diff -N dev/dfs.c --- /dev/null 1 Jan 1970 00:00:00 - +++ dev/dfs.c 26 Apr 2011 12:13:22 - @@ -0,0 +1,150 @@ +/* $OpenBSD$ */ +/* + * Copyright (c) 2011 Martin Pieuchot m...@nolizard.org + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include sys/param.h +#include sys/filedesc.h Why do you need to include sys/filedesc.h for? +#include sys/sysctl.h + +#include machine/cpu.h +#include machine/autoconf.h +#include macppc/pci/macobio.h + +#define DFS2(1 22) /* Divide-by-Two */ +#define DFS4(1 23) /* Divide-by-Four (MPC7448 Specific) */ + +extern int perflevel; +static int voltage; You should store the voltage inside a softc (pointed out by miod@). +int dfs_match(struct device *, void *, void *); +void dfs_attach(struct device *, struct device *, void *); +void dfs_setperf(int); +void dfs_scale_frequency(u_int); + +struct cfattach dfs_ca = { + sizeof(struct device), dfs_match, dfs_attach +}; + +struct cfdriver dfs_cd = { + NULL, dfs, DV_DULL +}; + +int +dfs_match(struct device *parent, void *arg, void *aux) +{ + struct confargs *ca = aux; + uint16_t cpu; + + if (strcmp(ca-ca_name, cpu-vcore-select) != 0) + return (0); + + cpu = ppc_mfpvr() 16; + if (cpu == PPC_CPU_MPC7447A || cpu == PPC_CPU_MPC7448) + return (1); + + return (0); +} + +void +dfs_attach(struct device *parent, struct device *self, void *aux) +{ + struct confargs *ca = aux; + uint32_t hid1; + uint16_t cpu; + + voltage = ca-ca_reg[0]; + + hid1 = ppc_mfhid1(); + + if (hid1 DFS4) { + ppc_curfreq = ppc_maxfreq / 4; + perflevel = 25; + } else if (hid1 DFS2) { + ppc_curfreq = ppc_maxfreq / 2; + perflevel = 50; + } + + cpu_setperf = dfs_setperf; + + printf(: Dynamic Frequency Switching, speeds: ); + printf(%d, %d, ppc_maxfreq, ppc_maxfreq / 2); We typically use pure lower case for stuff that shows up in dmesg. And I'm not sure the Dynamic Frequency Switching part really adds useful information. Perhaps just change this in: + printf(: speeds: %d, %d, ppc_maxfreq, ppc_maxfreq / 2);
Re: macppc: support for Dynamic Frequency Switching
Index: dev/dfs.c +static int voltage; There is no reason for this variable to be global. You should put it in your device' softc instead. +int +dfs_match(struct device *parent, void *arg, void *aux) +{ + struct confargs *ca = aux; + uint16_t cpu; + + if (strcmp(ca-ca_name, cpu-vcore-select) != 0) + return (0); + + cpu = ppc_mfpvr() 16; Is there any possibility for this device to attach to multiprocessor machines? If so, what if there are multiple cpu-vcore-select nodes, one per processor? Oh well, I suppose there won't be multiprocessor systems with different cpu models... at least not on macppc. + cpu = ppc_mfpvr() 16; + if (cpu == PPC_CPU_MPC7448) + printf(, %d MHz\n, ppc_maxfreq / 4); + else + printf( MHz\n); Nitpicking, but I'd rather see the optional /4 freq be printed as , %d and an unconditional MHz\n in all cases. +void +dfs_setperf(int perflevel) +{ + if (perflevel 50) { + if (ppc_curfreq != ppc_maxfreq) { + macobio_write(voltage, GPIO_DDR_OUTPUT | 1); + DELAY(1000); Speaking of DELAY()... it is implemented using the processor internal counter register. Is this register impacted by frequency changes? If so, shouldn't you update the computed ns_per_tick delay() constant? Also, this register is used to feed the timecounter. Is the clock still accurate after running for a while at a lower frequency? Is there any other, fixed, clock source which can be used as a safe monotonic clock source? Miod
Re: macppc: support for Dynamic Frequency Switching
+ printf(: Dynamic Frequency Switching, speeds: ); + printf(%d, %d, ppc_maxfreq, ppc_maxfreq / 2); We typically use pure lower case for stuff that shows up in dmesg. And I'm not sure the Dynamic Frequency Switching part really adds useful information. Perhaps just change this in: Well, x86 writes `Enhanced SpeedStep', and sets a bad example. Miod
libsndio: remove support for legacy device names
hack to support legacy audio/midi device naming scheme is almost two years old, ok to drop support for it? -- Alexandre Index: mio.c === RCS file: /cvs/src/lib/libsndio/mio.c,v retrieving revision 1.10 diff -u -p -r1.10 mio.c --- mio.c 16 Apr 2011 10:52:22 - 1.10 +++ mio.c 3 May 2011 20:21:39 - @@ -38,8 +38,7 @@ mio_open(const char *str, unsigned mode, static char prefix_rmidi[] = rmidi; static char prefix_aucat[] = aucat; struct mio_hdl *hdl; - struct stat sb; - char *sep, buf[4]; + char *sep; int len; #ifdef DEBUG @@ -57,17 +56,9 @@ mio_open(const char *str, unsigned mode, } sep = strchr(str, ':'); if (sep == NULL) { - /* -* try legacy /dev/rmidioxxx device name -*/ - if (stat(str, sb) 0 || !S_ISCHR(sb.st_mode)) { - DPRINTF(mio_open: %s: missing ':' separator\n, str); - return NULL; - } - snprintf(buf, sizeof(buf), %u, minor(sb.st_rdev)); - return mio_rmidi_open(buf, mode, nbio); + DPRINTF(mio_open: %s: ':' missing in device name\n, str); + return NULL; } - len = sep - str; if (len == (sizeof(prefix_midithru) - 1) memcmp(str, prefix_midithru, len) == 0) Index: sio.c === RCS file: /cvs/src/lib/libsndio/sio.c,v retrieving revision 1.3 diff -u -p -r1.3 sio.c --- sio.c 3 May 2011 20:15:23 - 1.3 +++ sio.c 3 May 2011 20:21:39 - @@ -46,8 +46,7 @@ sio_open(const char *str, unsigned mode, static char prefix_aucat[] = aucat; static char prefix_sun[] = sun; struct sio_hdl *hdl; - struct stat sb; - char *sep, buf[NAME_MAX]; + char *sep; int len; #ifdef DEBUG @@ -68,15 +67,8 @@ sio_open(const char *str, unsigned mode, } sep = strchr(str, ':'); if (sep == NULL) { - /* -* try legacy /dev/audioxxx or ``socket'' device name -*/ - if (stat(str, sb) 0 || !S_ISCHR(sb.st_mode)) { - snprintf(buf, sizeof(buf), 0.%s, str); - return sio_aucat_open(buf, mode, nbio); - } - snprintf(buf, sizeof(buf), %u, minor(sb.st_rdev) 0xf); - return sio_sun_open(buf, mode, nbio); + DPRINTF(sio_open: %s: ':' missing in device name\n, str); + return NULL; } len = sep - str; if (len == (sizeof(prefix_aucat) - 1)
Re: limit number of tasks on the crypto queue
On Tue, May 3, 2011 at 9:24 PM, Claudio Jeker cje...@diehard.n-r-g.com wrote: On Tue, May 03, 2011 at 07:53:56PM +0200, Mike Belopuhov wrote: hi, recently me and jsg have figured out that a traffic burst can kill your interface (deplete the rx ring) if you're using ipsec. the problem is that there's no limit on number of outstanding crypto operations. every job contains a pointer to a cluster that comes from the nic driver. under high load a number of jobs on a crypto queue reaches the limit for the mclpool and network card fails to allocate clusters for the rx ring and stalls (both bnx and ix don't recover). we experimented with large watermarks (2 clusters) but that just delays the problem a bit. real solution is to prevent an excessive amount of operations to be enqueued to the crypto queue. the problem is as usual: how to define a limit? in this diff i've used a 1/3 of the cluster pool hardlimit which behaves pretty good with different kern.maxclusters values. opinions? OKs? While reading this text I only had one thought. That is why we have ifqueues. Like for example the IP input queue. Sure the crypto thread works differently but it should behave similar. true. that's the first thing i thought of. but here it's really tied to the cluster pool and it makes sense to fail crypto operations for clusters only because others can wait. Does it actually make sense to queue 2000+ packets on the crypto thread? Aren't the packets delayed for a very long time? that depends on how fast is your machine, but more or less yes. we had 4000 packets on the queue w/o any problems on the receiver.
Re: adb(4)/pm_direct.c cleanup
On Tue, May 03, 2011 at 08:11:52AM +0530, Martin Pieuchot wrote: On macppc, the pm_* methods are always attached to a PMU (or PMU99), so no need to check for hardware. Tested here with a powerbook6,5. Ok? This appears to be working fine on my PowerBook4,1 (ibook g3), will do more testing tomorrow if needed. There's no dmesg change. [ using 481912 bytes of bsd ELF symbol table ] console out [ATY,RageM3p29s]console in [keyboard] , using ADB : memaddr 9400 size 400, : consaddr 96008000, : ioaddr 9002, size 2: memtag 8000, iotag 8000: width 1024 linebytes 1024 height 768 depth 8 Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. Copyright (c) 1995-2011 OpenBSD. All rights reserved. http://www.OpenBSD.org OpenBSD 4.9-current (GENERIC) #0: Tue Oct 5 17:18:42 CEST 2010 jasper@cupertino:/usr/src/sys/arch/macppc/compile/GENERIC real mem = 402653184 (384MB) avail mem = 376979456 (359MB) mainbus0 at root: model PowerBook4,1 cpu0 at mainbus0: 750 (Revision 0x3311): 600 MHz: 256KB backside cache mem0 at mainbus0 spdmem0 at mem0: SDRAM non-parity PC66 spdmem1 at mem0: 256MB SDRAM non-parity PC100CL2 memc0 at mainbus0: uni-n kiic0 at memc0 offset 0xf8001000 iic0 at kiic0 mpcpcibr0 at mainbus0 pci: uni-north, Revision 0xff pci0 at mpcpcibr0 bus 0 pchb0 at pci0 dev 11 function 0 Apple Pangea AGP rev 0x00 vgafb0 at pci0 dev 16 function 0 ATI Mobility M3 rev 0x02, mmio wsdisplay0 at vgafb0 mux 1: console (std, vt100 emulation) mpcpcibr1 at mainbus0 pci: uni-north, Revision 0x0 pci1 at mpcpcibr1 bus 0 pchb1 at pci1 dev 11 function 0 Apple Pangea rev 0x00 macobio0 at pci1 dev 23 function 0 Apple Pangea Macio rev 0x00 openpic0 at macobio0 offset 0x4: version 0x4614 little endian macgpio0 at macobio0 offset 0x50 macgpio1 at macgpio0 irq 47 pgs0 at macgpio0: irq 55 firewire-linkon at macgpio0 not configured gpio1 at macgpio0 not configured gpio9 at macgpio0 not configured extint-gpio4 at macgpio0 not configured extint-gpio12 at macgpio0 not configured escc-legacy at macobio0 offset 0x12000 not configured zsc0 at macobio0 offset 0x13000: irq 22,23 zstty0 at zsc0 channel 0 zstty1 at zsc0 channel 1 tumbler0 at macobio0 offset 0x1: irq 30,1,2 timer at macobio0 offset 0x15000 not configured adb0 at macobio0 offset 0x16000 irq 25: via-pmu, 3 targets akbd0 at adb0 addr 2: PowerBook G4 keyboard (Inverted T) wskbd0 at akbd0: console keyboard, using wsdisplay0 ams0 at adb0 addr 3: EMP trackpad tpad 2-button, 400 dpi wsmouse0 at ams0 mux 0 abtn0 at adb0 addr 7: brightness/volume/eject buttons apm0 at adb0: battery flags 0x5, 7% charged battery at macobio0 offset 0x0 not configured backlight at macobio0 offset 0xf300 not configured kiic1 at macobio0 offset 0x18000 iic1 at kiic1 wdc0 at macobio0 offset 0x1f000 irq 19: DMA wd0 at wdc0 channel 0 drive 0: HTS424040M9AT00 wd0: 16-sector PIO, LBA48, 38154MB, 78140160 sectors atapiscsi0 at wdc0 channel 0 drive 1 scsibus0 at atapiscsi0: 2 targets cd0 at scsibus0 targ 0 lun 0: TOSHIBA, DVD-ROM SD-R2002, 1B29 ATAPI 5/cdrom removable wd0(wdc0:0:0): using PIO mode 4, DMA mode 2 cd0(wdc0:0:1): using PIO mode 4, DMA mode 2 wi0 at macobio0 offset 0x3 irq 57: wi0: Firmware 4.16 variant 1, address 00:10:c6:6a:93:64 audio0 at tumbler0 ohci0 at pci1 dev 24 function 0 Apple Pangea USB rev 0x00: irq 27, version 1.0 ohci1 at pci1 dev 25 function 0 Apple Pangea USB rev 0x00: irq 28, version 1.0 usb0 at ohci0: USB revision 1.0 uhub0 at usb0 Apple OHCI root hub rev 1.00/1.00 addr 1 usb1 at ohci1: USB revision 1.0 uhub1 at usb1 Apple OHCI root hub rev 1.00/1.00 addr 1 mpcpcibr2 at mainbus0 pci: uni-north, Revision 0x16 pci2 at mpcpcibr2 bus 0 pchb2 at pci2 dev 11 function 0 Apple Pangea PCI rev 0x00 Apple Pangea FireWire rev 0x00 at pci2 dev 14 function 0 not configured gem0 at pci2 dev 15 function 0 Apple Pangea GMAC rev 0x00: irq 41, address 00:03:93:62:98:f8 bmtphy0 at gem0 phy 0: BCM5221 100baseTX PHY, rev. 4 vscsi0 at root scsibus1 at vscsi0: 256 targets softraid0 at root bootpath: /pci@f200/mac-io@17/ata-4@1f000/disk@0:/bsd root on wd0a swap on wd0b dump on wd0b Index: dev/adb.c === RCS file: /cvs/src/sys/arch/macppc/dev/adb.c,v retrieving revision 1.29 diff -u -p -r1.29 adb.c --- dev/adb.c 1 Feb 2009 17:04:26 - 1.29 +++ dev/adb.c 3 May 2011 02:27:28 - @@ -1307,7 +1307,6 @@ adb_setup_hw_type(void) case ADB_HW_PMU: adbSoftPower = 1; - pm_setup_adb(); return; default: Index: dev/pm_direct.c === RCS file: /cvs/src/sys/arch/macppc/dev/pm_direct.c,v retrieving revision 1.22 diff -u -p -r1.22 pm_direct.c --- dev/pm_direct.c 18 Feb 2007 19:33:48 - 1.22 +++ dev/pm_direct.c 3 May 2011 02:27:28 - @@ -54,10 +54,6 @@ /* hardware dependent values */ #define ADBDelay
Re: macppc: fix volume +/- from keyboard (i2s)
On Tue, May 03, 2011 at 01:38:03PM +0530, Martin Pieuchot wrote: This diff fix the use of the volume keys +/- for the iBooks/PowerBooks. Index: dev/i2s.c === RCS file: /cvs/src/sys/arch/macppc/dev/i2s.c,v retrieving revision 1.18 diff -u -p -r1.18 i2s.c --- dev/i2s.c 15 Jul 2010 03:43:11 - 1.18 +++ dev/i2s.c 3 May 2011 08:01:16 - @@ -637,9 +637,7 @@ i2s_get_port(h, mc) } int -i2s_query_devinfo(h, dip) - void *h; - mixer_devinfo_t *dip; +i2s_query_devinfo(void *h, mixer_devinfo_t *dip) { struct i2s_softc *sc = h; int n = 0; @@ -674,6 +672,7 @@ i2s_query_devinfo(h, dip) dip-type = AUDIO_MIXER_VALUE; dip-prev = dip-next = AUDIO_MIXER_LAST; dip-un.v.num_channels = 2; + dip-un.v.delta = 8; strlcpy(dip-un.v.units.name, AudioNvolume, sizeof(dip-un.v.units.name)); return 0; can't test it but this seems good to me -- Alexandre
perl -w and adduser
I thought I had found a bug in adduser and started having a look at the code. First thing I noticed is it didn't have perl -w so I added it, then realised there wasn't a bug, just user error Anyway, here is the code to allow adduser(8) have perl -w. I have tested and can see no functional change (apart from 2 simple variable type checks at the end). Perhaps better to use use warnings instead of perl -w. -mark Index: adduser.perl === RCS file: /cvs/src/usr.sbin/adduser/adduser.perl,v retrieving revision 1.53 diff -u -p -r1.53 adduser.perl --- adduser.perl3 Jan 2007 15:26:04 - 1.53 +++ adduser.perl4 May 2011 04:39:41 - @@ -28,6 +28,8 @@ # # $From: adduser.perl,v 1.22 1996/12/07 21:25:12 ache Exp $ +use warnings; + use IPC::Open2; use Fcntl qw(:DEFAULT :flock); @@ -667,7 +669,11 @@ sub new_users_group_update { } # group membership might have changed else { - push(@a, $gid{$e}:*:$e:$groupmembers{$e}); + if ($groupmembers{$e}) { + push(@a, $gid{$e}:*:$e:$groupmembers{$e}); + } else { + push(@a, $gid{$e}:*:$e:); + } } } # append empty YP group @@ -788,7 +794,7 @@ sub new_users { local($new_users_ok) = 1; -$new_groups = no unless $groupname{$new_groups}; +$new_groups = no; while(1) { $name = new_users_name; @@ -952,7 +958,8 @@ USAGE # uniq(1) sub uniq { local(@list) = @_; -local($e, $last = , @array); +local($e, $last, @array); +$last = ; foreach $e (sort @list) { push(@array, $e) unless $e eq $last; @@ -1030,7 +1037,7 @@ sub hints { sub parse_arguments { local(@argv) = @_; -while ($_ = $argv[0], /^-/) { +while (@argv ($_ = $argv[0], /^-/)) { shift @argv; last if /^--$/; if(/^--?(v|verbose)$/) { $verbose = 1 } @@ -1285,11 +1292,11 @@ sub confirm_list { # otherwise 0 sub confirm_yn { local($message, $confirm) = @_; -local($yes) = '^(yes|YES|y|Y)$'; -local($no) = '^(no|NO|n|N)$'; +local($yes) = '^(yes|YES|y|Y|1)$'; +local($no) = '^(no|NO|n|N|0)$'; local($read, $c); -if ($confirm ($confirm =~ $yes || $confirm == 1)) { +if ($confirm ($confirm =~ $yes)) { $confirm = y; } else { $confirm = n; @@ -1532,7 +1539,7 @@ verbose = $verbose # Get new password for new users # defaultpasswd = yes | no -defaultpasswd = $defaultpasswd +defaultpasswd = $defaultpasswd # Default encryption method for user passwords # Methods are all those listed in login.conf(5) @@ -1572,7 +1579,7 @@ uid_start = $uid_start uid_end = $uid_end # default login.conf(5) login class -defaultclass = $defaultclass +defaultclass = $defaultclass # login classes available from login.conf(5) # login_classes = ('default', 'daemon', 'staff') @@ -1589,6 +1596,10 @@ EOF # check for sane variables sub variable_check { # Check uid_start uid_end + die ERROR: uid_start not a number\n + if(!($uid_start =~ /^[+-]?\d+$/)); + die ERROR: uid_end not a number\n + if(!($uid_end =~ /^[+-]?\d+$/)); warn WARNING: uid_start 1000!\n if($uid_start 1000); die ERROR: uid_start = uid_end!\n if($uid_start = $uid_end); # unencrypted really only usable in batch mode