]> git.lizzy.rs Git - plan9front.git/log
plan9front.git
8 years agobetter memory management of threads (thanks knuth)
ben [Wed, 27 Apr 2016 22:36:43 +0000 (17:36 -0500)]
better memory management of threads (thanks knuth)

8 years agomerge in master
ben [Wed, 27 Apr 2016 13:20:54 +0000 (08:20 -0500)]
merge in master

8 years agouse Beof for awk port
ben [Wed, 27 Apr 2016 13:09:16 +0000 (08:09 -0500)]
use Beof for awk port

8 years agoremove ape regexp library, add utility for awk native port
ben [Wed, 27 Apr 2016 12:52:41 +0000 (07:52 -0500)]
remove ape regexp library, add utility for awk native port

8 years agolibjson: add slack space to literal string buffer to handle bad runes (thanks mischief)
cinap_lenrek [Wed, 27 Apr 2016 10:59:06 +0000 (12:59 +0200)]
libjson: add slack space to literal string buffer to handle bad runes (thanks mischief)

if the input string contains invalid utf-8, runetochar() produces
unicode replacement characters that can overflow the literal buffer.
as the overflow check is done after runetochar(), add UTFmax bytes
of slack space avoiding the issue.

8 years agoremove old libregexp files; add headers for upas/bayes
ben [Wed, 27 Apr 2016 03:26:03 +0000 (22:26 -0500)]
remove old libregexp files; add headers for upas/bayes

8 years agoNew libregexp and APE ported to native
ben [Wed, 27 Apr 2016 03:23:44 +0000 (22:23 -0500)]
New libregexp and APE ported to native

8 years agoabaco(1): remove readweb
cinap_lenrek [Mon, 25 Apr 2016 22:10:47 +0000 (00:10 +0200)]
abaco(1): remove readweb

8 years agomade abaco's gui respect $font and made readweb respect most installations
Matthew Veety [Mon, 25 Apr 2016 21:49:31 +0000 (17:49 -0400)]
made abaco's gui respect $font and made readweb respect most installations

8 years agorsa: rename getkey() to getrsakey(), document rsa2csr in rsa(8)
cinap_lenrek [Fri, 22 Apr 2016 01:41:06 +0000 (03:41 +0200)]
rsa: rename getkey() to getrsakey(), document rsa2csr in rsa(8)

8 years agolibsec: implement server side SCSV preventing silly client fallbacks
cinap_lenrek [Fri, 22 Apr 2016 00:33:29 +0000 (02:33 +0200)]
libsec: implement server side SCSV preventing silly client fallbacks

silly clients (web*) reconnect when the handshake failed with a lower
protocol version, which allows downgrade attacks (POODLE). but instead
of stopping this madness, they invented a new magic TLSID to indicate
to the server that this connection attempt is a retry, and rely on the
server to notice and stop them from sabotaging themselfs.

8 years agolibsec: order tlshand cipher suits by: keyexchange>=cipher>=hash, ignore client prefe...
cinap_lenrek [Thu, 21 Apr 2016 21:29:59 +0000 (23:29 +0200)]
libsec: order tlshand cipher suits by: keyexchange>=cipher>=hash, ignore client preference

client preference is usualy crazy, so just ignore it.
we always want the diffie hellman suits before static
rsa and prefer chacha over aes-gcm.

8 years agorsagen: increase default key size to 2048 bits
cinap_lenrek [Thu, 21 Apr 2016 19:25:33 +0000 (21:25 +0200)]
rsagen: increase default key size to 2048 bits

8 years agolibsec: remove affine coordinate point operations from ecc
cinap_lenrek [Thu, 21 Apr 2016 18:41:19 +0000 (20:41 +0200)]
libsec: remove affine coordinate point operations from ecc

we now just do point addtion in jacobian coordinate system, and
convert the result to affine when s->z == nil.

8 years agolibsec: implement elliptic curve group operations in jacobian coordinate system
cinap_lenrek [Wed, 20 Apr 2016 18:09:59 +0000 (20:09 +0200)]
libsec: implement elliptic curve group operations in jacobian coordinate system

8 years agorcpu: make sure not to leak /env/fn#server and /env/fn#aanserver for drawterm (thanks...
cinap_lenrek [Tue, 19 Apr 2016 22:41:03 +0000 (00:41 +0200)]
rcpu: make sure not to leak /env/fn#server and /env/fn#aanserver for drawterm (thanks mischief)

8 years agolibsec: implement server side ECDHE key exchange with secp256r1, move DH state in...
cinap_lenrek [Mon, 18 Apr 2016 17:24:57 +0000 (19:24 +0200)]
libsec: implement server side ECDHE key exchange with secp256r1, move DH state in TlsSec structure, simplify

implement ECDHE key exchange with secp256r1 on the server side, providing
perfect forward secrecy (tho slowly).

it is easier to just keep the ECDH/DH state in the TlsSec structure,
which fits better with the grouping of the functions. we do the cleanup
in tlsConnectionFree() now, so a lot of error handling logic could go
away.

reinvestigated some error paths and removed the ones that cannot error.

move functions to fit the logical grouping.

combine the code for signing handshake hashes (for client certs) and
DH parameters. provide digestDHparams() function to be shared between
server and client code.

8 years agowebfs: fix memory leak of serverName in tlswrap()
cinap_lenrek [Mon, 18 Apr 2016 17:07:02 +0000 (19:07 +0200)]
webfs: fix memory leak of serverName in tlswrap()

8 years agorsa(8): provide example for converting OpenSSL generated PEM file to factotum
cinap_lenrek [Sun, 17 Apr 2016 05:33:35 +0000 (07:33 +0200)]
rsa(8): provide example for converting OpenSSL generated PEM file to factotum

8 years agolibsec: massive cleanup of tlshand.c
cinap_lenrek [Sun, 17 Apr 2016 05:20:54 +0000 (07:20 +0200)]
libsec: massive cleanup of tlshand.c

don't pass or generate sessionID's. this was never used nor
actually implemented and leaks the process pid.

get rid of version and random field duplications, move TlsSec
structure into TlsConnection.

make msgRecv() clear the message first, get rid of unneccesary
msgClear() calls.

8 years agolibsec: fix memory leak of RSApub, avoid parsing certificate twice to extract rsa...
cinap_lenrek [Sat, 16 Apr 2016 21:36:55 +0000 (23:36 +0200)]
libsec: fix memory leak of RSApub, avoid parsing certificate twice to extract rsa public key

instead of letting factotum_rsa_open() parse the certificate,
we pass in the rsa public key which is then matched against the
factotum keyring. this avoids parsing the x509 certificate
twice.

the sec->rsapub was not freed, so free it in tlsSecClose()

8 years agolibsec: recognize and decode PKCS#8 wrapped RSA private keys for auth/asn12rsa
cinap_lenrek [Sat, 16 Apr 2016 02:16:10 +0000 (04:16 +0200)]
libsec: recognize and decode PKCS#8 wrapped RSA private keys for auth/asn12rsa

example usage:

auth/pemdecode 'PRIVATE KEY' test.pem | auth/asn12rsa

8 years agowebfs: change %H (hostname) format to %N to not collide with encodefmt's %H (hex)
cinap_lenrek [Fri, 15 Apr 2016 21:54:00 +0000 (23:54 +0200)]
webfs: change %H (hostname) format to %N to not collide with encodefmt's %H (hex)

8 years agolibsec: x509: convert to UTF8 from BMPString and UNIString, reject \0 bytes
cinap_lenrek [Fri, 15 Apr 2016 21:51:52 +0000 (23:51 +0200)]
libsec: x509: convert to UTF8 from BMPString and UNIString, reject \0 bytes

8 years agolibc: fix out of bounds access in dirpackage(), simplify
cinap_lenrek [Wed, 13 Apr 2016 20:19:37 +0000 (22:19 +0200)]
libc: fix out of bounds access in dirpackage(), simplify

- dirpackage() was not checking if the stat entry lies within
the buffer. fixed.

- simplify dirpackage(), as we process all the bytes from
the buffer, we do not need to track "ss" here as its the same
as "ts".

- zero Dir* array pointer early in dirread() and dirreadall()
and avoid calling dirpackage on <= buffer length.

8 years agokbdfs: add shift+altgr table 7 for polish keymaps
cinap_lenrek [Wed, 13 Apr 2016 15:00:20 +0000 (17:00 +0200)]
kbdfs: add shift+altgr table 7 for polish keymaps

8 years agoSubject: typo: ee corrected (thanks Eric Lindblad)
cinap_lenrek [Wed, 13 Apr 2016 13:54:31 +0000 (15:54 +0200)]
Subject: typo: ee corrected (thanks Eric Lindblad)

sorry there were entries as

3 27 '§
3 27 '½

should have been

3 27 '§
3 43 '½

attached is a corrected version

8 years agofix estonian keymap (thanks Eric Lindblad)
cinap_lenrek [Wed, 13 Apr 2016 13:31:04 +0000 (15:31 +0200)]
fix estonian keymap (thanks Eric Lindblad)

The /sys/lib/kbmap/ee file seemed to have CRs in it. If a first column in the table
(for modifier key) as 4 is for Alt Gr + Shift then the attached (UTF-8 without BOM)
should work as a replacement ee file.

Best Regards,
Eric Lindblad

8 years agopython: make hashlib.py fallback to openssl in case of old python binary
cinap_lenrek [Wed, 13 Apr 2016 00:21:03 +0000 (02:21 +0200)]
python: make hashlib.py fallback to openssl in case of old python binary

8 years agoremove unused liboventi
cinap_lenrek [Tue, 12 Apr 2016 23:09:45 +0000 (01:09 +0200)]
remove unused liboventi

8 years agoktrace: sign extend stack dump pc for amd64
cinap_lenrek [Tue, 12 Apr 2016 23:08:13 +0000 (01:08 +0200)]
ktrace: sign extend stack dump pc for amd64

8 years agolibc: remove unneeded #include <auth.h> for crypt() and netcrypt()
cinap_lenrek [Tue, 12 Apr 2016 23:06:34 +0000 (01:06 +0200)]
libc: remove unneeded #include <auth.h> for crypt() and netcrypt()

8 years agolibdraw: avoid BPSHORT()/BPLONG() expansion, cleanup loadchar(),cachechars()
cinap_lenrek [Tue, 12 Apr 2016 22:34:48 +0000 (00:34 +0200)]
libdraw: avoid BPSHORT()/BPLONG() expansion, cleanup loadchar(),cachechars()

assigning the expression value to a temporary variable in
BPSHORT() and BPLONG() saves arround 2K of text in rio on
arm and arround 1K on amd64.

loadchar(): use the passed in "h" as the char index instead
of recomputing it from c-f->cache. dont recompute wid.

cachechars(): do cache lookup and find oldest entry in a
single loop pass.

8 years agoadd danish keymap (thanks Eric Lindblad)
cinap_lenrek [Tue, 12 Apr 2016 11:37:21 +0000 (13:37 +0200)]
add danish keymap (thanks Eric Lindblad)

8 years agoape: explicitely list the ape libs to build in mkfile
cinap_lenrek [Mon, 11 Apr 2016 18:43:48 +0000 (20:43 +0200)]
ape: explicitely list the ape libs to build in mkfile

8 years agoape: removing openssl
cinap_lenrek [Mon, 11 Apr 2016 18:39:12 +0000 (20:39 +0200)]
ape: removing openssl

8 years agopython: remove openssl support, use ape/libsec for cryptographics hash functions
cinap_lenrek [Mon, 11 Apr 2016 18:31:14 +0000 (20:31 +0200)]
python: remove openssl support, use ape/libsec for cryptographics hash functions

8 years agogs: replace openssl aes implementation with ape/libsec
cinap_lenrek [Mon, 11 Apr 2016 18:27:50 +0000 (20:27 +0200)]
gs: replace openssl aes implementation with ape/libsec

8 years agoape: add libauth, libbio, libmp and libsec as replacements for openssl
cinap_lenrek [Mon, 11 Apr 2016 18:23:34 +0000 (20:23 +0200)]
ape: add libauth, libbio, libmp and libsec as replacements for openssl

8 years agohg: create system wide /sys/lib/hgrc to enabled hgwebfs extension
cinap_lenrek [Sun, 10 Apr 2016 18:39:10 +0000 (20:39 +0200)]
hg: create system wide /sys/lib/hgrc to enabled hgwebfs extension

the openssl we currently use is outdated and will be removed
soon. webfs will handle the https for us with native tls code.
keys have to be stored in factotum for everyone who also wants
to commit directly.

8 years agolibauth: remove unneeded includes for authsrv.h, avoid pulling in dependency for...
cinap_lenrek [Sun, 10 Apr 2016 18:24:20 +0000 (20:24 +0200)]
libauth: remove unneeded includes for authsrv.h, avoid pulling in dependency for rerrstr()

8 years agolibsec: make #include headers consistent
cinap_lenrek [Sun, 10 Apr 2016 18:23:18 +0000 (20:23 +0200)]
libsec: make #include headers consistent

8 years agolibsec: dont use mips assembly routines for spim, wrong endianess
cinap_lenrek [Sun, 10 Apr 2016 18:22:00 +0000 (20:22 +0200)]
libsec: dont use mips assembly routines for spim, wrong endianess

8 years agolibmp: fix build for spim, reduce by the mips assembly files
cinap_lenrek [Sun, 10 Apr 2016 18:20:53 +0000 (20:20 +0200)]
libmp: fix build for spim, reduce by the mips assembly files

8 years agohg: set mercurial.url.has_https when hgwebfs extension is in use
cinap_lenrek [Sun, 10 Apr 2016 18:18:21 +0000 (20:18 +0200)]
hg: set mercurial.url.has_https when hgwebfs extension is in use

this allows the use of SSL/HTTPS even when python is not build
with openssl support.

8 years agoape: move compatibility libc.h to lib9 directory and incooperate needed functions...
cinap_lenrek [Sun, 10 Apr 2016 01:01:37 +0000 (03:01 +0200)]
ape: move compatibility libc.h to lib9 directory and incooperate needed functions for ape/mp (wip)

8 years agoape: remove broken 9errstr.c
cinap_lenrek [Sun, 10 Apr 2016 00:54:29 +0000 (02:54 +0200)]
ape: remove broken 9errstr.c

8 years agoape: add internal _NSEC() function and make gettimeofday() use it
cinap_lenrek [Sun, 10 Apr 2016 00:52:31 +0000 (02:52 +0200)]
ape: add internal _NSEC() function and make gettimeofday() use it

8 years agolibmp: make includes consistent, make test program compile under ape (work in progress)
cinap_lenrek [Sun, 10 Apr 2016 00:35:01 +0000 (02:35 +0200)]
libmp: make includes consistent, make test program compile under ape (work in progress)

8 years agolibdraw: dont postnote to pid==0 in ekill()
cinap_lenrek [Sat, 9 Apr 2016 22:00:37 +0000 (00:00 +0200)]
libdraw: dont postnote to pid==0 in ekill()

8 years agomerge
cinap_lenrek [Sat, 9 Apr 2016 19:29:11 +0000 (21:29 +0200)]
merge

8 years agoadd missing target for antiword in /sys/src/cmd/aux/mkfile (thanks _sl)
cinap_lenrek [Sat, 9 Apr 2016 19:27:25 +0000 (21:27 +0200)]
add missing target for antiword in /sys/src/cmd/aux/mkfile (thanks _sl)

8 years agoaes(2): mention aesCBC bug
aiju [Sat, 9 Apr 2016 18:51:24 +0000 (20:51 +0200)]
aes(2): mention aesCBC bug

8 years agolisten(8): fix html rendering
cinap_lenrek [Fri, 8 Apr 2016 20:00:16 +0000 (22:00 +0200)]
listen(8): fix html rendering

8 years agolisten(8): document tcp17019 rcpu service
cinap_lenrek [Fri, 8 Apr 2016 19:53:48 +0000 (21:53 +0200)]
listen(8): document tcp17019 rcpu service

8 years agotls(3): document support for TLSv1.1 and TLSv1.2
cinap_lenrek [Fri, 8 Apr 2016 19:20:15 +0000 (21:20 +0200)]
tls(3): document support for TLSv1.1 and TLSv1.2

8 years agoqball(2): fix bad manpage reference
cinap_lenrek [Thu, 7 Apr 2016 19:51:56 +0000 (21:51 +0200)]
qball(2): fix bad manpage reference

8 years agodevstream(3): removed
cinap_lenrek [Thu, 7 Apr 2016 19:51:32 +0000 (21:51 +0200)]
devstream(3): removed

8 years agoether82563: initial i217 support from http://www.9legacy.org/9legacy/patch/pc-ether82...
cinap_lenrek [Thu, 7 Apr 2016 19:24:13 +0000 (21:24 +0200)]
ether82563: initial i217 support from http://www.9legacy.org/9legacy/patch/pc-ether82563-i210.diff (thanks k0ga)

This patch is only an adaptation for 9front of the patch located in
http://www.9legacy.org/9legacy/patch/pc-ether82563-i210.diff.  The
major difference is that this patch ignores errors in checksum of
eeprom, because in my system the checksum was wrong.  After 3 months,
I didn't have problems, and I think the patch can be used.  although
it has some things that need to be fixed.  If the link is inactive
when the system boots then it will remain inactive forever.

8 years agotcp567: run authserver with p9sk1 tickets disabled preventing offline password brute...
cinap_lenrek [Thu, 7 Apr 2016 19:19:48 +0000 (21:19 +0200)]
tcp567: run authserver with p9sk1 tickets disabled preventing offline password brute-force

8 years agojpg: fd == 0 is valid, so don't ignore it
BurnZeZ [Thu, 7 Apr 2016 00:22:42 +0000 (20:22 -0400)]
jpg: fd == 0 is valid, so don't ignore it

8 years agolibdraw: fix out of bounds memory access after subfont array reallocation (thanks...
cinap_lenrek [Tue, 5 Apr 2016 09:24:07 +0000 (11:24 +0200)]
libdraw: fix out of bounds memory access after subfont array reallocation (thanks ray)

/n/bugs/open/libdrawfont.c_buffer_overflow
http://bugs.9front.org/open/libdrawfont.c_buffer_overflow/readme

ray@raylai.com

Hi all,

In plan9port this bug keeps crashing mc when I run lc in a directory with Chinese characters. This is a diff from OpenBSD but it should apply cleanly to the various plan9 sources.

The code is basically trying to do a realloc (I guess realloc wasn't available back then?) but it copies too much from the original buffer.

Since realloc is available, just use it. If realloc isn't available outside plan9port (I haven't checked) the memmove line should be changed from:
memmove(f->subf, of, (f->nsubf+DSUBF)*sizeof *subf);
to:
memmove(f->subf, of, f->nsubf*sizeof *subf);

I hope this is helpful.

Ray

8 years agorio: /dev/kbd cleanup
cinap_lenrek [Mon, 4 Apr 2016 04:47:26 +0000 (06:47 +0200)]
rio: /dev/kbd cleanup

- use free running unsigned indeces for window kbdq
- emalloc() vs malloc() in xfid

8 years agokbdfs(8): document new /dev/kbd behaviour
cinap_lenrek [Sun, 3 Apr 2016 21:16:08 +0000 (23:16 +0200)]
kbdfs(8): document new /dev/kbd behaviour

8 years agochange /dev/kbd to return multiple messages per read
cinap_lenrek [Sun, 3 Apr 2016 20:54:22 +0000 (22:54 +0200)]
change /dev/kbd to return multiple messages per read

8 years agomercurial: CVE-2016-3630
cinap_lenrek [Sun, 3 Apr 2016 02:04:56 +0000 (04:04 +0200)]
mercurial: CVE-2016-3630

backported the following patches from mercurial 3.7.3:

https://selenic.com/repo/hg/rev/b6ed2505d6cf
https://selenic.com/repo/hg/rev/b9714d958e89

8 years agokernel: always clunk closed fids asynchronously, regardless of caching
cinap_lenrek [Fri, 1 Apr 2016 12:12:50 +0000 (14:12 +0200)]
kernel: always clunk closed fids asynchronously, regardless of caching

8 years ago6in4: ingress filter multicast and link-local, but allow relay traffic
cinap_lenrek [Thu, 31 Mar 2016 21:53:10 +0000 (23:53 +0200)]
6in4: ingress filter multicast and link-local, but allow relay traffic

8 years ago6in4: allow setting the local IPv4 address with -i flag (thanks k0ga)
cinap_lenrek [Thu, 31 Mar 2016 18:35:02 +0000 (20:35 +0200)]
6in4: allow setting the local IPv4 address with -i flag (thanks k0ga)

8 years ago9fs: bind -b /n/9front.org!7734 /n/lists
stanley lieber [Thu, 31 Mar 2016 18:15:45 +0000 (14:15 -0400)]
9fs: bind -b /n/9front.org!7734 /n/lists

8 years agokernel: remove unused NSMAX, NSLOG, NSCACHE constants from portdat.h
cinap_lenrek [Thu, 31 Mar 2016 02:23:27 +0000 (04:23 +0200)]
kernel: remove unused NSMAX, NSLOG, NSCACHE constants from portdat.h

8 years agofortunes: Ah, nice. the woodpeckers are back.
stanley lieber [Thu, 31 Mar 2016 01:14:39 +0000 (21:14 -0400)]
fortunes: Ah, nice. the woodpeckers are back.

8 years agodevsegment: cleanups
cinap_lenrek [Wed, 30 Mar 2016 20:49:13 +0000 (22:49 +0200)]
devsegment: cleanups

- return distinct error message when attempting to create Globalseg with physseg name
- copy directory name to up->genbuf so it stays valid after we unlock(&glogalseglock)
- cleanup wstat() handling, allow changing uid
- make sure global segment size is below SEGMAXSIZE
- move isoverlap() check from globalsegattach() into segattach()
- remove Proc* argument from globalsegattach(), segattach() and isoverlap()
- make Physseg.attr and segattach attr parameter an int for consistency

8 years agobullshit: +progressive +enhancement
cinap_lenrek [Wed, 30 Mar 2016 00:36:33 +0000 (02:36 +0200)]
bullshit: +progressive +enhancement

8 years agozynq: cleanup devarch, flushmmu() after procflushpsecg()
cinap_lenrek [Tue, 29 Mar 2016 03:06:32 +0000 (05:06 +0200)]
zynq: cleanup devarch, flushmmu() after procflushpsecg()

8 years agokernel: fix procflushmmu()
cinap_lenrek [Tue, 29 Mar 2016 00:09:49 +0000 (02:09 +0200)]
kernel: fix procflushmmu()

fix bug introduced in previous change for zynq, broke
procflushseg() function only flushing the first proc
matching the segment.

8 years agokernel: print pid as %lud instead %lux (in tsleep() debug print)
cinap_lenrek [Mon, 28 Mar 2016 21:01:54 +0000 (23:01 +0200)]
kernel: print pid as %lud instead %lux (in tsleep() debug print)

8 years agolibsec: fix tlsid for TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES...
cinap_lenrek [Mon, 28 Mar 2016 19:58:37 +0000 (21:58 +0200)]
libsec: fix tlsid for TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256

the previous cipher id's where fore TLS_ECDH_* not TLS_ECDHE_*... sorry :(

8 years agodevtls: print the path of the underlying chan in status file
cinap_lenrek [Mon, 28 Mar 2016 18:12:54 +0000 (20:12 +0200)]
devtls: print the path of the underlying chan in status file

to figure out what network connection a particular tls
conversation refers to, we add the path of the underlying
we send the encrypted tls traffic over in the status file,
example:

term% grep -n '^Chan:' '#a'/tls/*/status
#a/tls/0/status:7: Chan: /net/tcp/6/data
#a/tls/1/status:7: Chan: /net/tcp/0/data

8 years agodevip: applying changes for bug: multicasts_and_udp_buffers
cinap_lenrek [Mon, 28 Mar 2016 14:58:09 +0000 (16:58 +0200)]
devip: applying changes for bug: multicasts_and_udp_buffers

/n/bugs/open/multicasts_and_udp_buffers
http://bugs.9front.org/open/multicasts_and_udp_buffers/readme

michal@Lnet.pl

I have ported my small MPEG-TS analisis tool to Plan9.

To allow this application working I had to fix a bug in the kernel IPv4 code and increase UDP input buffer.

Bug is related to listening for IPv4 multicast traffic. There is no problem if you listen for only one group or multiple groups with different UDP ports. This works:

Write to UDP ctl:

anounce PORT
addmulti INTERFACE_ADDR MULTICAST_ADDR
headers

and you can read packets from data file.

You need to set headers option because otherwise every UDP packet for MULTICAST_ADDR!PORT is treat as separate connection. This is a bug and should be fixed too, but I didn't tried it.

There is a problem when you need to receive packets for multiple multicast groups. Usually the same destination port is used by multiple streams and above sequence of commands fails for second group because the port is the same.

Simple and probably non-intrusive fix is adding "|| ipismulticast(addr)" to if statement at /sys/src/9/ip/devip.c:861 line:

if(ipforme(c->p->f, addr) || ipismulticast(addr))

This fixes the problem and now you can use the following sequence to listen for multiple multicast groups even if they all have the same destination port:

announce MULTICAST_ADDR!PORT
addmulti INTERFACE_ADDR MULTICAST_ADDR
headers

After that my application started working but signals packet drops at >2 Mb/s input rate. The same is reported by kernel netlog. Increase capacity of UDP connection input queue fixes this problem /sys/src/9/ip/udp.c:153

c->rq = qopen(512*1024, Qmsg, 0, 0);

--
Michał Derkacz

8 years agozynq: introduce SG_FAULT to prevent access to AXI segment while PL is not ready
cinap_lenrek [Sun, 27 Mar 2016 18:57:01 +0000 (20:57 +0200)]
zynq: introduce SG_FAULT to prevent access to AXI segment while PL is not ready

access to the axi segment hangs the machine when the fpga
is not programmed yet. to prevent access, we introduce a
new SG_FAULT flag, that when set on the Segment.type or
Physseg.attr, causes the fault handler to immidiately
return with an error (as if the segment would not be mapped).

during programming, we temporarily set the SG_FAULT flag
on the axi physseg, flush all processes tlb's that have
the segment mapped and when programming is done, we clear
the flag again.

8 years agofile: deal with negative coordinates in plan9 bitmaps, print image size
cinap_lenrek [Sun, 27 Mar 2016 14:38:39 +0000 (16:38 +0200)]
file: deal with negative coordinates in plan9 bitmaps, print image size

8 years agokernel: fix tsleep()/twakeup()/tsemacquire() race
cinap_lenrek [Sat, 26 Mar 2016 01:37:42 +0000 (02:37 +0100)]
kernel: fix tsleep()/twakeup()/tsemacquire() race

tsleep() used to cancel the timer with:

if(up->tt != nil)
timerdel(up);

which still can result in twakeup() to fire after tsleep()
returns (because we set Timer.tt to nil *before* we call the tfn).
in most cases, this is not an issue as the Rendez*
usually is just &up->sleep, but when it is dynamically allocated
or on the stack like in tsemacquire(), twakeup() will call
wakeup() on a potentially garbage Rendez structure!

to fix the race, we execute the wakup() with the Timer lock
held, and set p->trend to nil only after we called wakeup().

that way, the timerdel(); which unconditionally locks the Timer;
can act as a proper barrier and use up->trend == nil as the
condition if the timer has already fired.

8 years agorio: flushimage() before wscrsleep()
cinap_lenrek [Wed, 23 Mar 2016 19:17:58 +0000 (20:17 +0100)]
rio: flushimage() before wscrsleep()

8 years agodevtls: zero secret information before freeing, cleanup
cinap_lenrek [Wed, 23 Mar 2016 12:50:58 +0000 (13:50 +0100)]
devtls: zero secret information before freeing, cleanup

8 years agostats: fix display->locking race
cinap_lenrek [Wed, 23 Mar 2016 10:19:36 +0000 (11:19 +0100)]
stats: fix display->locking race

8 years agoadd portable AES-GCM (Galois/Counter Mode) implementation to libsec and devtls
cinap_lenrek [Wed, 23 Mar 2016 01:45:35 +0000 (02:45 +0100)]
add portable AES-GCM (Galois/Counter Mode) implementation to libsec and devtls

8 years agorio: add flushimage() after mb2 menu action
cinap_lenrek [Tue, 22 Mar 2016 16:48:08 +0000 (17:48 +0100)]
rio: add flushimage() after mb2 menu action

8 years agomothra(1): fix url for https://code.9front.org/hg/plan9front/
stanley lieber [Tue, 22 Mar 2016 00:57:18 +0000 (20:57 -0400)]
mothra(1): fix url for https://code.9front.org/hg/plan9front/

8 years agorio botch
BurnZeZ [Sun, 20 Mar 2016 00:27:09 +0000 (20:27 -0400)]
rio botch

8 years agofile(1): print warnings on /fd/2, remove some duplicate strings, whitespace fixes
BurnZeZ [Sun, 20 Mar 2016 00:09:44 +0000 (20:09 -0400)]
file(1): print warnings on /fd/2, remove some duplicate strings, whitespace fixes

8 years agogames/life: add -d delay parameter, -b color reversal parameter, and update manpage
BurnZeZ [Sun, 20 Mar 2016 00:03:10 +0000 (20:03 -0400)]
games/life: add -d delay parameter, -b color reversal parameter, and update manpage

8 years agogames(1) cleanup
BurnZeZ [Sun, 20 Mar 2016 00:00:03 +0000 (20:00 -0400)]
games(1) cleanup

8 years agolib9p: remove duplicate variable assignment in createfile()
BurnZeZ [Sat, 19 Mar 2016 21:58:35 +0000 (17:58 -0400)]
lib9p: remove duplicate variable assignment in createfile()

8 years agorio: fix some spacing, slightly cleaner arg handling
BurnZeZ [Sat, 19 Mar 2016 21:50:33 +0000 (17:50 -0400)]
rio: fix some spacing, slightly cleaner arg handling

8 years agolibdraw: have openfont() set error string
BurnZeZ [Sat, 19 Mar 2016 21:47:25 +0000 (17:47 -0400)]
libdraw: have openfont() set error string

8 years agolibc: trailing whitespace cleanup
BurnZeZ [Sat, 19 Mar 2016 21:35:36 +0000 (17:35 -0400)]
libc: trailing whitespace cleanup

8 years agoip/gping: add main pid to pid list for killall()
cinap_lenrek [Fri, 18 Mar 2016 07:59:01 +0000 (08:59 +0100)]
ip/gping: add main pid to pid list for killall()

8 years agoabandon streaming experiment
cinap_lenrek [Thu, 17 Mar 2016 16:48:19 +0000 (17:48 +0100)]
abandon streaming experiment

for queue like non-seekable files, it is impossible to implement an
exportfs because one has to run the kernels devtab read() and write()
in separate processes, and that makes it impossible to maintain 9p message
order as the scheduler can come in and randomly schedule one process before
another.

so as soon as we have a transition from 9p -> syscalls, we'r screwed.

i currently see just two possibilities:

- introduce special file type like QTSEQ with strictly ordered i/o semantics
- fix all fileservers and exportfs to only do one outstanding i/o to QTSEQ files
which means maintaining a queue per fid

this doesnt propagate. so exporting slow 9p mount again will be limited
again by latency of the inner mount.

other option:

- return offset in Rread, so client can bring responses back into order. this
requires changing all fileservers and drivers to maintain such an per fid offset
and change the protocol to include it in the response, and also pass it to userspace
(new syscalls or pass it in TOS)

this only works for read pipelining, write is still screwed.

both options suck.

--
cinap

8 years agolibc: fix runestrecpy() return value (thanks spew)
cinap_lenrek [Wed, 16 Mar 2016 16:27:00 +0000 (17:27 +0100)]
libc: fix runestrecpy() return value (thanks spew)