Commit graph

6687 commits

Author SHA1 Message Date
BurnZeZ ffdbfdf991 postscript: use PI 2019-02-13 03:24:31 +00:00
cinap_lenrek 0ed8f6ff5f libip: don't reject ipmask in v6 form for v4 address 2019-02-13 04:04:33 +01:00
cinap_lenrek 45213ee6c7 ip/ipconfig, ndb/dns, libndb: handle parseipmask() errors 2019-02-12 21:44:57 +01:00
cinap_lenrek d551a83ae4 libip: return -1 in parseipmask() and parseipandmask() when mask is not ipv4 and v4 argument was set 2019-02-12 21:43:22 +01:00
cinap_lenrek 7102a23245 devip: use parseipandmask() for ipifc and route control message parsing 2019-02-11 23:43:14 +01:00
cinap_lenrek b1c9ddb3f0 ndb/dns: provide v4 argument to parseipmask(), use snprint() instead of sprint() 2019-02-11 23:42:15 +01:00
cinap_lenrek fd277c053d upas/smtpd: implement ipv6 support for ip blacklist, replace v4parsecidr() with parseipandmask() 2019-02-11 23:40:34 +01:00
cinap_lenrek 50e617f8b6 ratfs: implement ipv6 support, replace v4parsecidr() with parseipandmask() 2019-02-11 23:38:58 +01:00
cinap_lenrek 168dabc142 ip/rip: use new parseipandmask() function 2019-02-11 23:36:29 +01:00
cinap_lenrek 595fbddb1c ip/ayiya: use parseipandmask(), use ipvmp() instead of equivip6() 2019-02-11 23:34:26 +01:00
cinap_lenrek 97d45a5468 ip/6in4: use parseipandmask(), use ipvmp() instead of equivip6() 2019-02-11 23:33:44 +01:00
cinap_lenrek 584343aa16 ip/tinc: use new parseipandmask() to parse subnets, use ipcmp()/ipmove(), remove prefixlen 2019-02-11 23:32:40 +01:00
cinap_lenrek 7a12930910 ip/dhcpd: provide v4 argument for parseipmask() 2019-02-11 23:30:52 +01:00
cinap_lenrek 7c3db1d620 ip/ipconfig: use new parseipandmask() function 2019-02-11 23:29:53 +01:00
cinap_lenrek a7c01127f9 libndb: provide parseipmask() v4 argument in subnet(), use snprint() instead of sprint() 2019-02-11 23:28:43 +01:00
cinap_lenrek 0af11f97b5 libip: replace v4parsecidr() with new parseipandmask()
we want to accept V4 subnets in CIDR notation consistently which
means we need to interpret the mask in context of the IP address.
so parseipmask() now has an additional v4 flag argument which
offsets the prefixlength by 96 so a /24 will be interpreted
as a /120.

parseipandmask() is the new function which handles this automatically
depending on the ip address type.

v4parsecidr() is now obsolete.
2019-02-11 23:26:57 +01:00
cinap_lenrek 66b9196f77 segment(3): use bind -c in examples (thanks henesy) 2019-02-08 22:28:20 +01:00
cinap_lenrek 01b6aa0f9f cifs: merge with steve simons latest version. thank you very much! 2019-02-05 23:10:03 +01:00
cinap_lenrek a2abe177e4 cifs: fix pruning of . and .. directory entries (thanks steve simon)
steve wrote:

> I cam across a bug in cifs.
>
> An empty directory under windows 7 pro contains a single entry "." but it
> doesn't appear to contain "..". As a result "." is not removed on dirscan
> and plan9 gets when trying to traverse the hierarchy.
2019-02-05 20:53:40 +01:00
cinap_lenrek 31637404ba bcm: include sdmmc in pi kernel configuration 2019-02-01 23:31:44 +01:00
cinap_lenrek cefc849a95 devdraw: get rid of softscreen==0xa110c hack and make attachscreen() return Memdata*
all screen implementations use a Memimage* internally
for the framebuffer, so we can return a shared reference
to its Memdata structure in attachscreen() instead of
a framebuffer data pointer.

this eleminates the softscreen == 0xa110c hack as we
always use shared Memdata* now.
2019-01-30 18:22:52 +01:00
cinap_lenrek 8e1218aceb bcm: list devswap only once in devtab array 2019-01-30 18:05:04 +01:00
cinap_lenrek 5b5416aa05 devdraw: simplify drawgen() 2019-01-28 23:29:22 +01:00
cinap_lenrek 8152e9d075 devip: tcp: Don't respond to FIN-less ACKs during TIME-WAIT (thanks Barret Rhoden)
Under the normal close sequence, when we receive a FIN|ACK, we enter
TIME-WAIT and respond to that LAST-ACK with an ACK.  Our TCP stack would
send an ACK in response to *any* ACK, which included FIN|ACK but also
included regular ACKs.  (Or PSH|ACKs, which is what we were actually
getting/sending).

That was more ACKs than is necessary and results in an endless ACK storm
if we were under the simultaneous close sequence.  In that scenario,
both sides of a connection are in TIME-WAIT.  Both sides receive
FIN|ACK, and both respond with an ACK.  Then both sides receive *those*
ACKs, and respond again.  This continues until the TIME-WAIT wait period
elapses and each side's TCP timers (in the Plan 9 / Akaros case) shut
down.

The fix for this is to only respond to a FIN|ACK when we are in TIME-WAIT.
2019-01-27 22:12:50 +01:00
cinap_lenrek 63a0d519bc dhcpd(8), ndb(6): group related ndb attributes together 2019-01-24 20:30:14 +01:00
cinap_lenrek 4e91e4a2db ip/dhcpd: remove undocumented dhcpgroup mechanism, group related ndb attributes together 2019-01-24 20:29:39 +01:00
cinap_lenrek eb7eea0bb9 troff: fix -ms mug (thanks aksr)
Executing .KS after .1C exhibits a bug.
Instead on the next page, the text between .KS and .KE is shown at
the bottom of the page (where footnote would be).
To reproduce the bug: http://sprunge.us/xyCUX7

The bug can be fixed by changing two lines in tmac.s:

    if \\n(NX<1 .bp\}

to

    if \\n(NX<=1 .bp\}

and

    if \\n(NX<1 'bp\}
to

  if \\n(NX<=1 'bp\}
2019-01-23 21:28:22 +01:00
cinap_lenrek d1a0091b56 dhcpd(8), ndb(6): update documentation (thanks k0ga) 2019-01-23 20:58:52 +01:00
cinap_lenrek c58df62d06 ip/dhcpd: send vendor ndb attribute if available (thanks k0ga)
At this moment plan9 is using vendorinfo to communicate
some specific plan9 parameters, but there are some boards
that use this attribute to set specific values. This
patch allows netbooting of these boards using ndb attributes
instead of hard coded solutions in dhcpd(1). Vendor attribute
is used for that purpose because it is also used for the
same purpose in bootp.
2019-01-23 20:57:20 +01:00
cinap_lenrek ad6e6444f9 ip/dhcpd: add rootserverip read in lookupip() (thanks k0ga)
Lookupip() was already reading rootpath, but it didn't read the
address of the rootserver.  As they are very related it makes sense to
read them at the same time.

This patch also fixes a typo, where vendorclass was used instead of
vendor, resulting that vendor ndb attribute was never used.
2019-01-23 20:49:50 +01:00
cinap_lenrek 3cf63ee15f ip/dhcpd: change swap to rootserver (thanks k0ga) 2019-01-23 20:47:48 +01:00
cinap_lenrek 058951bb80 devtls: remove static "already" flag in tlsinit(). this function is only run once. 2019-01-22 22:08:07 +01:00
cinap_lenrek 26d36c3ae2 devswap: simplify, don't panic when writing swapfile fails
always start the pager kproc in swapinit(), simplifying kickpager().

allow zero conf.nswap and conf.nswppo. avoid allocating the reference
map and iolist arrays in that case.

use ulong for ioptr and iolist indices.

don't panic when writing pages out to the swapfile fails. just
requeue the page in the io transaction list so we will try
again next time executeio() is run or just free the page when
the swap reference was dropped.

remove unused pagersummary() function.
2019-01-22 22:06:42 +01:00
cinap_lenrek 4b2f31131a pc64: properly handle faulterror in faultamd64()
replicate what faulterror() would have done with up->nerrlab == 0,
that is, terminate the process.
2019-01-22 21:55:20 +01:00
Alex Musolino 927e342aca upas/fs: remove unused function pop3log 2019-01-22 15:11:53 +10:30
aiju b9745c60a1 merge 2019-01-20 12:55:31 +01:00
cinap_lenrek 116b075371 rc: clear out redirections on "rfork F" (RFCFDG)
rfork F closes all file descriptors, so we have to
invalidate the redirections as they are now refering
to closed files. not doing so causes the wrong file
descriptors being closed later on as the fd numbers
get reused.
2019-01-20 12:02:03 +01:00
aiju 62bedca19f dtracy: fix && 2019-01-20 03:07:10 +00:00
cinap_lenrek 83aa7ba709 ether82563: fix bugus FCA write and link detection for i217
the FCA registers 0x28, 0x2C have been reassigned to
to FEXTNVM on i217, i218 and i219 so add Fnofca flag
and avoid writing the registers.

make link detection more robust on i217 by delaying the
phy status read after link status change by 150ms. we'd
otherwise get a "phy wedged" (power saving state?) and
not update the link status until the next link change.
2019-01-13 17:17:11 +01:00
cinap_lenrek 998d478550 ether82563: work arround spurious jumbo packets on i217 (thanks k0ga)
i217 appears to receive spurious jumbo frame and then
stops receiving completely. reducing the mtu to 2k as
a work arround for now.
2019-01-12 21:07:12 +01:00
cinap_lenrek 1759a1746d /sys/lib/plumb/basic: make plumbing page bookmarks work with relative paths (thanks Tobias Heinicke) 2019-01-12 20:07:23 +01:00
cinap_lenrek 0de56a9913 ether82563: use 9018 byte mtu from datasheet for i217, i218, i219 2019-01-12 19:37:37 +01:00
cinap_lenrek 9ba89d63ef merge 2019-01-12 15:35:50 +01:00
cinap_lenrek 53275c7045 ether82563, ether82598, etherx550: round rbsz to multiple of 1K
the max packet size is configured in 1K increments on these chips,
which can result in the card receiving a 10K packet but the
driver having only allocated 9.5K of buffer. this actually caued
pool corruption with i210, i217, i218, i219, i350.

for 82598 and x550, we explicitely round rbsz to avoid similar bugs
in the future, even tho the Rbsz constant was already a multiple of
1K and is not affected by the bug.
2019-01-12 15:34:23 +01:00
qwx 9f755671fb torrent: avoid trying to fetch blocks past file 2019-01-08 13:22:09 +01:00
cinap_lenrek d0f824edc2 pc, pc64: properly track dependencies for mem.h on autogenerated apbootstrap.h and reboot.h targets 2019-01-04 02:51:29 +01:00
cinap_lenrek c88ed6488f upas/fs: don't put messages on the lru that cannot be uncached
the lru is there to track least recently used messages so
we can evict them from the cache and refetch them again on
demand. for pop3 mailbox, which doesnt provide fetch routine,
the messages should never be put on the freelist.
2019-01-02 10:26:38 +01:00
cinap_lenrek de8580ed9f upas/fs: include mkupas in mkfile last to get default target 2019-01-02 10:22:27 +01:00
Alex Musolino 2c6cc12133 upas/fs: fix infinite loop in putcache (again)
The previous attempt to fix this problem (see changesets b32199e0f90a
and 00ae79a6ba50) caused all calls to cachefree to free the cached
message contents in addition to updating the LRU list.  This causes
problems for the POP3 driver since it provides no fetch function; once
a message is evicted from the LRU cache, its contents is lost.

This time we fix cachefree to always update the LRU list but only free
the cached message contents if the driver provides a fetch function or
the force flag is set.
2018-12-31 00:00:09 +10:30
cinap_lenrek f464b7ff16 rsa(8): add example for tinc(8) (thanks k0ga, qwx) 2018-12-28 11:46:15 +01:00
aiju 83b854df0d dtracy: fix conditional branch generation 2018-12-28 10:26:25 +00:00
BurnZeZ ca10fccafe remove function prototype that leaked into last commit 2018-12-26 04:51:35 +00:00
BurnZeZ c650a7db0c tcs: clean up old port code, and avoid writing 0 to stdout 2018-12-26 04:47:22 +00:00
cinap_lenrek 27921a1ba0 mk: fix closing random fd from uninitialized stack variable (thanks BurnZeZ, mycroftiv)
mycroftiv → this is practically "500 mile email" territory - the "6 letter mk bug"
2018-12-26 05:04:56 +01:00
cinap_lenrek 1b619dea42 nusb/disk: revert previous attempts and just not issue capacity command when theres no media present 2018-12-24 19:06:01 +01:00
Ori Bernstein ee9b29550f Make the check work.
Embarrassing.
2018-12-23 23:10:42 -08:00
cinap_lenrek c80f22f74a nusb/disk: implement 64 bit lba read/write commands (16 byte commands)
untested.
2018-12-24 05:10:43 +01:00
cinap_lenrek 2aec1f8a09 nusb/disk: fix typo "(" 2018-12-24 05:05:41 +01:00
Ori Bernstein bb151fa789 Don't unnecessarily unstall devices.
Some SD card readers are slow to unstall. We try to unstall them
in a loop if there's no SD card in there, but they're not stalled.
They're happily reporting that there's no SD card in them by giving
back the appropriate error code.

Skipping the unstall speeds up the retry loop, cutting the time spent
attaching the USB device at boot from multiple minutes to nearly instant.
2018-12-23 19:44:58 -08:00
cinap_lenrek ec1c1b9b52 dossrv: cleanup 2018-12-24 01:21:47 +01:00
cinap_lenrek 1e0b65c8bf dossrv: make GLONG() return ulong, handle getsect() error in dostat() 2018-12-23 22:43:29 +01:00
cinap_lenrek d843bc8e22 etherx550: add intel 10GB ethernet controlller x550 driver (thanks joe9) 2018-12-23 17:48:11 +01:00
cinap_lenrek 426c989317 ether82598: fix multicast filter (thanks aiju, joe9) 2018-12-23 17:41:47 +01:00
cinap_lenrek 4a634d2102 dossrv: use 64 bit vlong for sectors 2018-12-22 20:49:24 +01:00
cinap_lenrek 9fe1377336 dtracy: avoid pointer to integer truncation warning on amd64 2018-12-15 20:39:32 +01:00
aiju 192a222f5b fplot: fix operator associativity 2018-12-15 11:57:35 +00:00
aiju 3114102485 fplot: add min/max operators 2018-12-13 16:15:10 +00:00
aiju c7304ea03c dtracy: get rid of DTName struct, support more than three parts in a probe name, wildcard matching 2018-12-13 10:42:49 +00:00
aiju dae5a44111 pc(1): reference counting bug 2018-12-13 10:38:21 +00:00
Alex Musolino c69bf6e0bc merge 2018-12-13 12:00:32 +10:30
Alex Musolino b830824cba upas/fs: remove now unnecessary "force" argument to cachefree 2018-12-13 11:59:34 +10:30
cinap_lenrek eb5676d4be upas/fs: handle errors from fetch for cachebody()/cacheheaders()
for imap, when a fetch fails, error out of read and stat. also don't
add failed to download messages into the lru.
2018-12-12 19:33:08 +01:00
Alex Musolino 9b194f23b2 merge 2018-12-12 12:51:29 +10:30
Alex Musolino b836802fe6 upas/fs: fix infinite loop in putcache
Force the cacheclear operation in the LRU cache trimming loop in order
to guarantee that the cache becomes smaller with each iteration.

Without the force flag cacheclear is a no-op for mailboxes that do not
provide a fetch function, e.g. POP3.
2018-12-12 12:48:53 +10:30
stanley lieber 4c68cfa412 fortunes: [9fans] ..... UNSUBSCRIBE_HELP NEEDED 2018-12-11 12:57:36 -05:00
aiju 40d6302b5f forgotten files 2018-12-11 09:20:34 +00:00
aiju a6517fb498 kernel: change peek to return number of characters left rather than 0/-1 2018-12-11 09:17:44 +00:00
aiju cc066d8130 dtracy: catch page faults 2018-12-11 09:09:08 +00:00
aiju 6f30420136 add dtracy support to mkdevc and enable dtracy with plan9.ini 2018-12-11 07:44:34 +00:00
BurnZeZ e93a85710e sshfs: add exits(nil) to threadmain 2018-12-10 05:18:05 +00:00
aiju ca851bbb5e dtracy: call dtptrigger with a struct pointer rather than a list of arguments; put return value in arg9 2018-12-09 21:43:22 +00:00
aiju b96be17376 dtracy: fix lexer bug 2018-12-08 18:04:25 +00:00
aiju 722a1a3334 fix dtracy man page 2018-12-08 17:24:23 +00:00
aiju 6056a46c64 add dtracy manpage 2018-12-08 16:35:21 +00:00
aiju 58fa29447b dtracy: add support for aggregations 2018-12-08 15:07:53 +00:00
cinap_lenrek 03e60450c2 rio: get rid of window delete thread, fix mysterious disappearing windows
because a client might not handle resize, rio would try to move ther
window offsceen after 750 ms. however, it does this by window name,
which could have been reassigned by another concurrent rio, causing the
wrong window to disappear.

now we always move the window offscreen before freeimage(). this way we
are sure to still have the right reference to the original window.
2018-12-07 16:32:04 +01:00
BurnZeZ 96b1debbf8 add entries for il rcpu 2018-12-07 01:41:27 +00:00
BurnZeZ c6d4cd09a3 ptrap(4): fix formatting 2018-12-06 06:53:41 +00:00
aiju 4415dde6d3 forp: change indexing to verilog-like semantics 2018-12-06 10:56:32 +00:00
BurnZeZ 023f5eca58 acid: fix transcript 2018-12-06 07:11:35 +00:00
aiju 64d0d3b8ac libmp: fix mptouv behaviour to match mptoui 2018-12-06 09:32:20 +00:00
aiju 17b80cbcf1 libmp: add tests for integer conversions 2018-12-06 09:32:07 +00:00
aiju 7e477cc769 mptov: make it actually work 2018-12-05 10:26:52 +00:00
cinap_lenrek 6891093034 kernel: remove unused static variable "sofar" from timerintr() (thanks mischief) 2018-12-05 03:59:08 +01:00
cinap_lenrek d15aca0532 kernel: fix tprof on multiprocessor
segclock() has to be called from hzclock(), otherwise
only processes running on cpu0 would catche the interrupt
and the time delta would be wrong.

lock the segment when allocating Seg->profile as
profile ctl might be issued from multiple processes.
Proc->debug qlock is not sufficient.

Seg->profile can never be freed or reallocated once
set as the timer interrupt accesses it without any
locking.
2018-12-05 01:43:19 +01:00
cinap_lenrek 79bfff6437 factotum: rsa: use mptober() to get right adjusted result instead of mptobe() and memset() 2018-12-04 19:34:36 +01:00
cinap_lenrek c5393d612f bootrc: remove $ff references (was old parsed /boot/boot argument list) 2018-12-04 18:55:56 +01:00
aiju b5f7e27f44 kencc: make "function not declared" a warning unless compiling with -T 2018-12-02 11:36:58 +00:00
mischief a847d7a53d python: explicitly declare WaitForThreadShutdown as void 2018-12-02 03:30:30 -08:00
mischief cb7375dcbc ape: declare gethostname 2018-12-02 03:30:22 -08:00
cinap_lenrek 9eeca04d87 merge 2018-12-02 03:27:19 +01:00
cinap_lenrek 117f177ccf libsec: fix memory leak in pkcs1_decrypt() 2018-12-02 03:23:48 +01:00
BurnZeZ 2b1454e81c libdtracy: wrong operator in XORI (thanks aiju) 2018-12-01 18:07:40 +00:00
aiju d9b9e15d6b kencc: turn "function args not checked" warning into "function not declared" error if appropriate 2018-12-01 11:39:49 +00:00
aiju 75f5332c9d 2c(1): document some differences with ANSI C 2018-12-01 11:28:26 +00:00
cinap_lenrek ad7316e87c hgwebfs: write headers individually, so they are not limited by webfs iounit (thanks mischief) 2018-12-01 04:22:07 +01:00
cinap_lenrek c4ecd0fee0 webfs: write headers individually so they are not limited in sum to the 8k buffer 2018-12-01 04:20:53 +01:00
aiju ec1976eb05 fplot: add support for readout with middle mouse button 2018-11-30 17:32:10 +00:00
aiju 5b2f81a567 fplot: color different curves 2018-11-30 16:58:01 +00:00
aiju f102882990 fplot: compute y range correctly when used with multiple graphs 2018-11-30 16:12:02 +00:00
cinap_lenrek 55f067553a upas: get rid of broken validatesender example, remove redundant upas/misc and setup target 2018-11-28 21:12:11 +01:00
mischief cd933b2a9c hgwebfs: read to eof by default to match urllib2 behavior 2018-11-28 11:34:52 -08:00
cinap_lenrek 099da8cb82 devip: fix arpread, dont return partial entries 2018-11-28 12:41:18 +01:00
cinap_lenrek 243c25fd8f upas/fs: avoid switch on vlong breaking build (thanks k0ga) 2018-11-26 21:36:51 +01:00
cinap_lenrek 3484b7c23a upas/fs: another mistake ... 2018-11-26 21:29:33 +01:00
cinap_lenrek f75b4fddb3 upas/fs: fix broken body.ext in walk (thanks sl) 2018-11-26 20:15:30 +01:00
cinap_lenrek da9f1ccc28 libmach: change amd64 szreg to 8 (thanks charles forsyth) 2018-11-24 22:38:00 +01:00
aiju 6e6beff85d delete old NOTICE file 2018-11-24 15:22:17 +00:00
cinap_lenrek 434de8db8d snap: use Mach->szaddr as the width of the stack pointer (fixes snap on amd64)
to read the value of the stack pointer register, snap
used Machdata->szreg to determine the width of the
SP register in the Ureg structure. however, the value
does not match the Ureg.sp type for a number of architectures
(mips2, amd64) and it is unclear if this was an oversight
as it is rarely used (snap is indeed the only user) or
if it was intended for a different purpose.

so we use szaddr instead which matches the stack pointer
width in the Ureg and fixes the truncated stack issue on
amd64.
2018-11-22 20:27:27 +01:00
cinap_lenrek 6bd0764167 snap: add debug flag, make debug less verbose 2018-11-22 15:09:54 +01:00
cinap_lenrek 9d471caaae snap: check for overflows, cleanup error handling 2018-11-22 12:44:15 +01:00
cinap_lenrek 3363693205 snap: consequently use ulong for page index and count 2018-11-22 10:31:30 +01:00
cinap_lenrek 5692788724 snap: be more conservative taking stack snapshot
include up to 8k below the stack to get some more context.

don't assume stack is at least 16K.
2018-11-22 10:30:45 +01:00
cinap_lenrek 1f464e0013 upas/fs: keep messages *marked* for deletion in the index 2018-11-22 08:55:13 +01:00
cinap_lenrek 5a5d3e0414 upas/fs: allow msgincref() with mb->refs == 0
this can happen when the on the final sync when the mailbox
is being freed:

freembox -> mboxdecref -> syncmbox -> wridxfile -> pridx -> insurecache -> msgincref
2018-11-22 08:49:41 +01:00
cinap_lenrek 1dcf853fc0 upas/fs: checkfid() might be called with uninitialized fid, ignore 2018-11-21 21:48:55 +01:00
cinap_lenrek 5d2bffc26f upas/fs: fix walk 2018-11-21 17:32:36 +01:00
cinap_lenrek 70f700699a upas/fs: don't enter mailbox into hashtree when it is being freed
syncmbox() used to enter the mailbox into the hash tree to
update the qid.vers. this is wrong when we are doing the final
sync before freeing the mailbox as the hash reference has already
been removed by freemailbox().

also avoid adding hash entries for mails for the about to be
freed mailbox in cachehash().
2018-11-21 16:19:51 +01:00
cinap_lenrek 5ef10e1642 mp(2): fix spelling 2018-11-21 02:08:15 +01:00
cinap_lenrek 39a7be7ea3 mp(2): clarify mptoa() and mpfmt() default base 2018-11-21 01:15:43 +01:00
cinap_lenrek 8e50556f14 upas/fs: rework the refcounting, use 64bit qid path, add checks
add function to check the refcounts for Mailbox and Message on a fid

use the full 64 bit of the qid.path, so we can use the full 32 bit for the id

instead of only maintaining refcount for the top message, msgincref() now
adds a reference to all its parent messages including self and top message.
then we can check in recursive delmessage() that all the parts have a zero
refcount.

remove the Fid.mtop field, it was never used.

make sure deletion and flag changes only affect the top message.

cachefree(): only look for top message in lru. sub-parts are never
added to the cache.

use the nparts field when reading sub-part of existing message, so
that we parse the index right in case the number of parts somehow
changed.

messages marked as Deleted but still in inbox should be written
to the index.
2018-11-21 00:37:35 +01:00
aiju 7a8e875668 games/md: fix mkfile 2018-11-20 09:22:04 +00:00
aiju 99d2e68a6a games/md: use cpu.c from blit 2018-11-20 09:20:46 +00:00
aiju af810c9871 games/blit: clean up cpu.c and make it pass tests 2018-11-20 09:18:20 +00:00
cinap_lenrek 4dee686ca5 pc, pc64: park application processors in rebootcode with mmu off
instead of having application processors spin in mpshutdown()
with mmu on, and be subject to reboot() overriding kernel text
and modifying page tables, park the application processors in
rebootcode idle loop with the mmu off.
2018-11-19 18:42:01 +01:00
cinap_lenrek b04ed2ae52 vt(1): vt doesnt exit when the host process exits as claimed (thanks driusan) 2018-11-18 21:28:56 +01:00
cinap_lenrek 485a3301e6 cc: fix wrong "useless or misleading comparison" warning
to reproduce:

 	u8int x, y;

 	x = 0xff;
 	y = 0xc0;
 	if((s8int)(x & y) >= 0)
 		print("help\n");

compiles correctly but prints a warning

warning: test.c:11 useless or misleading comparison: UINT >= 0

the issue is that compar() unconditionally skipped over
all left casts ignoring the case when a cast would sign
extend the value.

the new code only skips over the cast when the original
type with is smaller than the cast result or when they
are equal width and types have same signedness. so the
effective left hand side type is the last truncation
or sign extension.
2018-11-18 20:42:45 +01:00
cinap_lenrek b6251bff91 rc: implement $"x in terms of Xdol() and new Xqw() instruction
to get $"1 right, remove Xqdol() and instead implement it in
terms of Xdol() instruction and use the new Xqw() instruction
to quote the resulting list.
2018-11-18 04:56:48 +01:00
cinap_lenrek 196da4ec6f devip: fix swapped tcp snd.scale and recv.scale in tcpstate() format (thanks joe9) 2018-11-18 04:14:41 +01:00
cinap_lenrek 064ea89caa libdraw: avoid deadlock for mouse ioproc sending on resizec
a deadlock has been observed with samterm (thanks burnzez),
that shows the mouse ioproc being stuck in sending on the
resize channel, while the mouse consumer is stuck in a
readmouse() loop wanting a rectangle to be drawn by the
user:

recv(v=0x42df50)+0x28 /sys/src/libthread/channel.c:321
readmouse(mc=0x42df50)+0x54 /sys/src/libdraw/mouse.c:34
getrect(.ret=0x41bce0,but=0x4,mc=0x42df50)+0x62 /sys/src/libdraw/getrect.c:49
	r=0x41bc70
	rc=0x41bc70
getr(rp=0x41bce0)+0x24 /sys/src/cmd/samterm/main.c:244
	p=0x6b000004f6
	r=0x2
sweeptext(new=0x0,tag=0x2d)+0x12 /sys/src/cmd/samterm/menu.c:208
	r=0x2
	t=0x42df50
inmesg(type=0x2,count=0x2)+0x1ab /sys/src/cmd/samterm/mesg.c:136
	m=0x10000002d
	l=0x2d00001b00
	i=0x43829000000001
	t=0x438290
	lp=0x42e050
rcv()+0x7a /sys/src/cmd/samterm/mesg.c:77
threadmain(argv=0x7ffffeffef90)+0x173 /sys/src/cmd/samterm/main.c:63

so avoid blocking in the mouse ioproc by using nbsend()
instead of send() for writing to the resize channel.
2018-11-18 03:37:04 +01:00
mischief a25418fddc devbridge: fix runt packets going through the bridge (thanks cinap)
linux will send small, unpadded arp packets which may arrive over
wifi, so allow small packets into the bridge and pad any packets that
are too small when going out.
2018-11-17 17:23:56 -08:00
aiju fbfa249c63 games/c64: make keyboard table more readable 2018-11-17 09:48:46 +00:00
mischief 744867de34 ether82563: ignore i82753 checksums, fixes T60 ethernet 2018-11-14 11:33:52 -08:00
cinap_lenrek 06783edd7a nusb/kb: multitouch support (touchscreens, stylus)
touchscreens signal multiple contact points (X/Y) in
the hid descriptor separated by being nested in separate
collections. the contact point is identified by a
optional contact id. if omited, we use the collection
index and report id.

so we collect all the items (X/Y, buttons, wheel) from
separate collections in Hidslot structures and in the
end combine all the slots together.

buttons are or'ed together while absolute X/Y is applied
when it changed. relative X/Y deltas get added together.

thanks to kivik and Glats for testing.
2018-11-14 09:12:34 +01:00
cinap_lenrek 8a7f897b30 nusb/kb: revert multitouch, breaks some mice... 2018-11-13 03:34:19 +01:00
cinap_lenrek b5ea1cc4be upa/imap4d: ignore messages without digest info 2018-11-12 20:43:25 +01:00
cinap_lenrek 3b51df75b5 disk/mkfs: remove unused cputype variable (thanks kvik) 2018-11-12 16:54:59 +01:00
cinap_lenrek 8c57331b9b merge 2018-11-12 08:53:29 +01:00
cinap_lenrek 9de1403358 nusb/kb: lilu dallas multitouch 2018-11-12 08:52:01 +01:00
aiju c247ce1c33 add dtracy to mkfile 2018-11-11 10:10:30 +00:00
aiju e15b1b8930 add dtracy.h 2018-11-10 20:01:19 +00:00
aiju a7f5ecaf63 dtracy: missing break in dteverify 2018-11-10 14:01:42 +00:00
aiju e6d99771e5 adding dtracy (crude early version) 2018-11-10 13:46:16 +00:00
cinap_lenrek 8c097ae84a ssh: handle unknown MSG_CHANNE_REQUEST messages 2018-11-08 22:35:45 +01:00
cinap_lenrek 2a266430e3 ssh: handle MSG_GOBAL_REQUEST
respond to MSG_GLOBAL_REQUEST with MSG_REQUEST_FAILURE
as stated by rfc4254 when server wants a reply.

failing todo so breaks some proprietary keep-alive schemes.
2018-11-08 22:00:07 +01:00
cinap_lenrek 615f43b76e ip/dhcpd: Add swap server support in dhcpd (thanks k0ga) 2018-11-08 21:15:07 +01:00
cinap_lenrek 85afec4c2f bcm: intrenable() can happen from any cpu in case of dma interrupts 2018-11-08 20:26:32 +01:00
cinap_lenrek b7aedbb366 libdraw: cannot happen 2018-11-08 16:56:34 +01:00
cinap_lenrek df7fcc6cac libdraw: fix gengetwindow()
- fix fd leak in winname read() <= 0 case
- avoid freeing d->image (was by freeimage((*scrp)->image))
- dont leak screen and window in fullscreen mode
2018-11-07 22:01:18 +01:00
cinap_lenrek c0d21d35b1 bcm: cleanup timer code
- calculate hardcoded constants for more clarity
- avoid unneccesary modification of cntpns ctl register
- revert enabling IRQcntpns for cpu0
- remove unused Localintpending register offset constant
2018-11-07 17:02:09 +01:00
cinap_lenrek 385f52183c bcm: simplify irq handling by having per cpu Vctl chain 2018-11-07 16:49:50 +01:00
cinap_lenrek b0d226705c bcm: speed up co-processor operations by avoiding i+d cache flush on each operation
coproc.c generated the instrucitons anew each time,
requiering a i+d cache flush for each operation.

instead, we can speed this up like this:

given that the coprocessor registers are per cpu, we can
assume that interrupts have already been disabled by
the caller to prevent a process switch to another cpu.

we cache the instructions generated in a static append
only buffer and maintain separate end pointers for each
cpu.

the cache flushes only need to be done when new
operations have been added to the buffer.
2018-11-07 16:48:14 +01:00
aiju 17f0b2ce38 nusb/serial: fix wrong guard statement (thanks deuteron) 2018-11-06 12:05:15 +00:00
cinap_lenrek e76452a69f merge 2018-11-06 04:33:29 +01:00
cinap_lenrek a66be23396 dnstcp: temporarily switch on resolver mode so we can resolve the dnsslaves for axfr check 2018-11-06 04:31:48 +01:00
aiju 1d0f8a7e51 sed: only dollars as first address are a problem for -u 2018-11-05 20:17:48 +00:00
mischief a86de839ca rio(1): fix typo 2018-11-04 11:39:04 -08:00
mischief 52ad5b3ec5 mp(2): document mpfactorial 2018-11-04 11:37:13 -08:00
mischief 6df3f7bf38 libmp: declare mpfactorial 2018-11-04 11:37:02 -08:00
cinap_lenrek 0a681f38eb merge 2018-11-04 19:50:06 +01:00
cinap_lenrek 93e493f391 libaml: allow amlmapio() to re-enter the interpreter (can happen by pciadd() -> amleval())
- make frame base pointer variable
- in rwreg(), save/restore the interpreter state and allocate a Frame* on the stack
- add overflow checks for frame base pointer to xec() and amleval()
- gc() scans the whole stack from FP to the *real* bottom F0
2018-11-04 19:48:27 +01:00
aiju 0bd213b7b0 devvmx: remove bogus . direntry 2018-11-04 16:03:35 +00:00
cinap_lenrek 89c659d80b bcm: fix mysterious core clock resets under SMP (thanks richard miller)
reference: https://github.com/raspberrypi/firmware/issues/542

procsave(Proc* p)
{
	uvlong t;

	cycles(&t);
	p->pcycles += t;

// TODO: save and restore VFPv3 FP state once 5[cal] know the new registers.
	fpuprocsave(p);
	/*
	 * Prevent the following scenario:
	 *	pX sleeps on cpuA, leaving its page tables in mmul1
	 *	pX wakes up on cpuB, and exits, freeing its page tables
	 *  pY on cpuB allocates a freed page table page and overwrites with data
	 *  cpuA takes an interrupt, and is now running with bad page tables
	 * In theory this shouldn't hurt because only user address space tables
	 * are affected, and mmuswitch will clear mmul1 before a user process is
	 * dispatched.  But empirically it correlates with weird problems, eg
	 * resetting of the core clock at 0x4000001C which confuses local timers.
	 */
	if(conf.nmach > 1)
		mmuswitch(nil);
}
2018-11-04 16:00:32 +01:00
cinap_lenrek dd82b657c0 bcm: fix mistake in mkfile 2018-11-01 01:07:51 +01:00
cinap_lenrek 5608be398e bcm: fix /dev/reboot text/data corruption (thanks richard miller)
- clean dcache before turning off caches and mmu (rebootcode.s)
- use WFE and inter-core mailboxes for cpu startup (rebootcode.s)
- disable SMP during dcache invalidation before enabling caches and mmu (in armv7.s)
2018-10-31 19:48:16 +01:00
Alex Musolino 913be4e74a awk(1): fix append operator to avoid truncating file 2018-10-31 16:49:02 +10:30
cinap_lenrek 8e9d2434e9 bcm: provide /dev/cputemp in a format stats can understand 2018-10-28 07:10:27 +01:00
cinap_lenrek daf153009e merge 2018-10-28 06:17:34 +01:00
cinap_lenrek b715c39bfa bcm: simplify reboot code
- synchronize rebootcode installation
- handle the 1MB identity map in mmu.c (mmuinit1())
- do not overlap CONFADDR with rebootcode, the non boot
  processors are parked there.
- make REBOOTADDR physical address
2018-10-28 06:16:10 +01:00
cinap_lenrek 0fc2adb43d bcm: cleanup clock code
- disable local clock on interrupt to prevent accidents when reenabling
- always regitster local clock interrupt handler, even for cpu0
- simplify microdelay()
- don't mess with watchdog
2018-10-28 06:09:05 +01:00
cinap_lenrek f17a5cc2cf bcm: fix l2 cache maintenance routines for raspi3 (armv8)
armv8 has 16-way l2, so adjust shift for the set-way cache
tag format.
2018-10-28 06:05:43 +01:00
qwx d74fdfc022 misc small manpage fixes 2018-10-28 00:05:05 +02:00
cinap_lenrek 2ee4c08974 devuart: don't sleep in uartdrainoutput() when called splhi or without a process
uartdrainoutput() might be called in early initialization
from uartctl() without a process.
2018-10-27 20:00:12 +02:00
cinap_lenrek d81f4d4866 rc: skip searchpath for "", "." and ".." 2018-10-27 18:32:00 +02:00
cinap_lenrek d17a049c5b rc: use searchpath() logic to handle $cdpath 2018-10-26 10:25:23 +02:00
cinap_lenrek 1a55b8d1f0 rc: ignore $cdpath for # device rooted paths (thanks kivik) 2018-10-26 09:52:05 +02:00
23hiro 05021e0579 add Centrino Wireless-N 1030 (thanks lksmk from brazil) 2018-10-25 08:09:10 +02:00
cinap_lenrek b65a5a1ca5 /sys/lib/dist/mkfile: add pi.img target for raspi sdcard image 2018-10-22 00:16:04 +02:00
cinap_lenrek f059563b9d add /sys/src/boot/bcm/mkfile to download raspberry pi bootcode firmware 2018-10-22 00:15:39 +02:00
cinap_lenrek 8dfff00e50 nusb/serial: add support for CH340 serial converter 2018-10-21 17:24:33 +02:00
cinap_lenrek 21001d4294 merge 2018-10-21 03:44:16 +02:00
cinap_lenrek 2fd35e9bf8 kbdfs: don't get confused by broken utf8 2018-10-21 03:42:24 +02:00
qwx f5c6a870bf doom: fix music for patch wads
revert last change, which used games/wadfs to expose genmidi and music lumps.
replacements from patch wads were never seen that way.  instead, write genmidi
and music lumps to /tmp and play them from there.
2018-10-21 00:11:39 +02:00
cinap_lenrek b4eb667f02 acme: fix fd checks - initialize Window.rdselfd to -1 not 0 2018-10-20 23:57:50 +02:00
BurnZeZ 84e019aba3 fix misleading/wrong fd checks 2018-10-20 18:44:09 +00:00
cinap_lenrek 292cce2ad1 libdisk: catch null bytes in proto file, fix memory leaks 2018-10-20 20:32:22 +02:00
cinap_lenrek 5bb7240ee9 nusb/kb: work arround broken split transaction on raspi's dwc otg usb controller 2018-10-20 19:57:37 +02:00
cinap_lenrek 83e20b4df1 bcm: import changes for raspi2/3 from richard miller 2018-10-20 19:56:31 +02:00
cinap_lenrek 796e5e6000 nusbrc: support for raspi3 ethernet 2018-10-20 19:53:57 +02:00
cinap_lenrek 37dcb25eee kernel: fix allocb for BLOCKALIGN*2 >= Hdrspc 2018-10-20 19:52:54 +02:00
cinap_lenrek c4ec69045e devusb: use Enotconf[] string constant 2018-10-20 19:41:37 +02:00
cinap_lenrek 86a9f92f47 nusb/ether: add support for lan78xx (raspi3) (thanks richard miller) 2018-10-20 19:30:16 +02:00
cinap_lenrek 29865005f9 nusb/ether: tune buffer size parameters for SMSC ethernet (raspi) (thanks richard miller) 2018-10-20 19:29:18 +02:00
mischief 499478eb62 upas/fs: delete extra binaries 2018-10-18 08:46:44 -07:00
mischief 286ee3ba34 truetypefs(4): fix example path 2018-10-16 12:53:55 -07:00
mischief 717fa414af kbdfs(8): fix nit 2018-10-16 12:53:34 -07:00
aiju d6164606d9 ttf: SHZ also uses 0x36 2018-10-16 19:26:40 +00:00
aiju 4b507ed83d libttf: add SHZ[] instruction 2018-10-16 19:14:19 +00:00
aiju d31f6261b3 libttf: dont unset LOOP in SHC 2018-10-16 18:35:47 +00:00
mischief 2d221e61e3 nusb/disk: also drive usb attached scsi devices 2018-10-15 04:14:59 -07:00
aiju 22fc5467a4 nusb/joy: update misleading comment (thanks Tobias Heinecke) 2018-10-15 10:10:34 +01:00
mischief df89d898f0 libttf: instruction 0x24 is DEPTH, not CLEAR 2018-10-13 02:20:31 -07:00
cinap_lenrek c22ebef4e1 libdisk: back out last change 2018-10-13 00:07:46 +02:00
cinap_lenrek 06abb1098a ssh: fix spinning due to sticky intr flag on connection timeout 2018-10-12 19:28:39 +02:00
cinap_lenrek f12f773944 merge 2018-10-12 19:04:22 +02:00
cinap_lenrek 6e74c7380f libdisk: check for proper line termination in proto file parser 2018-10-12 19:02:57 +02:00
mischief c60ba7267d namespace(4): fix $home bin paths 2018-10-12 08:47:52 -07:00
mischief aa35643207 namespace(4): document new TrueType path, drop unused Hershey fonts path 2018-10-12 08:46:48 -07:00
mischief d5fae54268 truetypefs(4): document truetypefs 2018-10-12 08:36:22 -07:00
mischief aec4240c0c truetypefs: fall back to width if advance is zero
combining marks will have zero advance, but it results in zero-width
glyphs in subfonts.  fall back to width so something meaningful is
rendered even if its not combined properly.
2018-10-12 08:34:17 -07:00
mischief 3a41ce3bf3 truetypefs: fix subfont indices (thanks aiju!) 2018-10-12 08:32:19 -07:00
mischief 4d919ab612 truetypefs: use /lib/font/ttf as default font path 2018-10-12 08:31:05 -07:00
aiju ccfb6f4126 libttf: fix swapped argument in vscan()... 2018-10-12 11:40:34 +00:00
cinap_lenrek 4808971db6 plumber: fix memory and filedescriptor leaks (thanks BurnZeZ) 2018-10-11 22:49:45 +02:00
cinap_lenrek c9e86d6b34 ndb/dnstcp: only lookup the expected address type in findserver()
theres no reason to lookup both A and AAAA records, as we already
know the type of srcip.
2018-10-11 18:57:14 +02:00
cinap_lenrek 5fbf53b467 merge 2018-10-11 18:34:14 +02:00
cinap_lenrek ed888f3ee9 ndb/dns: use nil for pointers in dnresolve() args 2018-10-11 18:32:31 +02:00
cinap_lenrek 784a959888 ndb/dns: do recursive lookup for dnsslave= 2018-10-11 18:31:35 +02:00
cinap_lenrek fce9c3e65a ndb/dns: avoid format strings in procname 2018-10-11 18:29:17 +02:00
aiju 921b75a909 games/gb: when the LCD is turned off, reset ppuy and ppustate to 0, fixes bug in dragon warriors iii reported by mischief 2018-10-11 16:25:11 +00:00
mischief 8eecdc9664 etheriwl: support type 2000 devices and the 2200 chip in x230t 2018-10-10 16:37:13 -07:00
mischief 7af5442d3b nusb/joy: send magic packet to enable playstation controller events 2018-10-10 13:56:28 -07:00
mischief 67e14807e9 nusbrc: prevent nusb/kb from attaching to sony ps3 controller 2018-10-10 13:49:03 -07:00
cinap_lenrek e73ce8475e ndb/dnstcp: return a proper non-answer when rejecting zone transfer 2018-10-09 06:34:27 +02:00
cinap_lenrek 08292c8f1f ndb/dns: fix format print warning for procsetname(), cleanup 2018-10-09 06:08:48 +02:00
cinap_lenrek 45e71cb728 ndb/dns: send_notify() to multiple ip addresses in parallel, filter myip() 2018-10-09 06:07:51 +02:00
cinap_lenrek 7ddda493c0 ndb/dnstcp: restrict DNS zone transfers to clients listed as dnsslave=
initial idea from Steve Simon, but doesnt require reverse
lookup of the callers ip address.
2018-10-09 06:02:36 +02:00
cinap_lenrek 679a253931 usbxhci: only clear RW1C bits when set. 2018-10-08 07:10:59 +02:00
cinap_lenrek 2fecc5789e usbxhci: delay after reset, preserve reserved bits in legacy status control register in handoff()
when clering smi enable bits in the legacy control/status register,
preserve the reserved bits. clear the RW1C bits.

linux code claims intel xhci controller needs a 1ms delay before
accessing any register after reset.
2018-10-08 07:05:28 +02:00
cinap_lenrek a71a57f8f2 remove /lib/tftpd from proto file 2018-10-08 02:18:02 +02:00
cinap_lenrek 564eeba515 get rid of /lib/tftpd 2018-10-08 02:13:29 +02:00
cinap_lenrek 065c3557af ip/dhcpd, ip/tftpd: change default for tftp homedir to / 2018-10-08 02:11:36 +02:00
cinap_lenrek c458216121 pc drivers: more pci cleanup 2018-10-07 23:38:41 +02:00
cinap_lenrek 9fec0e7360 pc drivers: use pcienable() to handle device power up and missing initialization 2018-10-07 22:28:21 +02:00
cinap_lenrek 4d7c195804 pc, pc64: add pcienable() and pcidisable() functions
pcienable() puts a device in fully powered on state
and does some missing initialization that UEFI might
have skipped such as I/O and Memory requests being
disabled.

pcidisable() is ment to shutdown the device, but
currently just disables dma to prevent accidents.
2018-10-07 21:52:53 +02:00
aiju 4e4f2aca32 add (unfinished but working) truetypefs 2018-10-07 11:11:39 +00:00
cinap_lenrek ce062debb1 9boot: get rid of 64 byte line length limit 2018-10-06 02:42:53 +02:00
cinap_lenrek e5cb695c7a merge 2018-10-06 00:30:59 +02:00
cinap_lenrek f9839ed0a2 usbehci, usbxhci: add *noehcihandoff= and *noxhcihandoff= parameters
on Samsung ATIV Smart PC Pro XE00T1C-A01CL, the EHCI handoff
causes the system to freeze in UEFI mode as soon as we assert
the os semaphore bit.

until a general solution is found, provide these parameters to
disable the handoff for now as it seems to otherwise work fine.
2018-10-06 00:29:05 +02:00
cinap_lenrek 83876083c9 pc, pc64: increase CONFADDR buffer from 4K to 24K
move APBOOTSTRAP and TMPADDR to make space available for
boot parameters. which can become quite long such as *e820.
2018-10-06 00:26:07 +02:00
stanley lieber 7efc2e761d fortunes: I'm beginning to wonder if anyone is left that isn't part of 9front? -- Steve Stallion 2018-10-04 23:23:50 -04:00
cinap_lenrek b56450471f devip: remove unused QLock from udp and icmpv6 control blocks (thanks brho) 2018-10-03 00:47:34 +02:00
cinap_lenrek bdcef9d692 5i ki qi vi: avoid buffer overflow in command read loop 2018-09-29 13:58:08 +02:00
mischief e876447b75 audio/libogg: sync to ogg v1.3.3
this corresponds to upstream git commit 4380566a44b8d5e85ad511c9c17eb04197863ec5.
2018-09-28 17:28:51 -07:00
aiju f75bbcdd45 5e: byte access incorrectly checked for long; brk has to round up addresses 2018-09-28 22:53:24 +00:00
cinap_lenrek 451b0c7976 ip/ipconfig: silently ignore prefix information with Autonomous flag clear 2018-09-28 20:23:53 +02:00
cinap_lenrek 9ee967663f ip/ipconfig: default onlink and autoflag to 1 2018-09-28 18:16:08 +02:00
cinap_lenrek 02b867f01e devip: only add interface route for "on-link" prefixes
when a prefix is added with the onlink flag clear, packets
towards that prefix needs to be send to the default gateway
so we omit adding the interface route.

when the on-link flag gets changed to 1 later, we add the
interface route.

the on-link flag is sticky, so theres no way to clear it back
to zero except removing and re-adding the prefix.
2018-09-28 18:13:01 +02:00
cinap_lenrek 03bcc1520a vt: fix backup/forward after resize 2018-09-27 16:08:51 +02:00
cinap_lenrek b74ce50a1c vt: implement word select 2018-09-27 15:24:41 +02:00
cinap_lenrek e7f777ae03 idn(2): add documentation for idn2utf() and utf2idn() 2018-09-26 15:58:19 +02:00
cinap_lenrek a600610fde provide procsetname(2) manpage 2018-09-26 15:24:29 +02:00
cinap_lenrek 19166f2cf3 libc: add procsetname() 2018-09-26 14:56:23 +02:00
cinap_lenrek 311e3b51c6 libc: return number of bytes produced for idn2utf() and utf2idn() 2018-09-26 14:32:17 +02:00
cinap_lenrek f18e8dfde8 ip/ipconfig: increase maximum host and domainname size to 255 bytes. idn for -h option 2018-09-25 21:51:57 +02:00
cinap_lenrek 0126f10d05 ndb/inform: handle internationalized domain names 2018-09-25 20:59:08 +02:00
cinap_lenrek e5e6a729dd merge 2018-09-25 20:45:11 +02:00
cinap_lenrek 33682a5885 ip/ipconfig: handle internationalized domain names 2018-09-25 20:43:37 +02:00
cinap_lenrek 05f6c08985 ip/dhcp6d: handle internationalized domain names 2018-09-25 20:28:19 +02:00
cinap_lenrek 347303b136 ip/dhcpd: handle internationalized domain names 2018-09-25 20:17:56 +02:00
cinap_lenrek 2160da07de ndb/dns: use libc's new idn functions 2018-09-25 20:17:00 +02:00
cinap_lenrek 565fc2be5d webfs: remove idn.c 2018-09-25 20:16:06 +02:00
cinap_lenrek d5f2d2cc3f webfs: fix memory leak in Nfmt(), use libc's new idn functions 2018-09-25 20:15:24 +02:00
cinap_lenrek dfec09c436 libc: add utf2idn() and idn2utf() functions to deal with internationalized domain names 2018-09-25 20:14:25 +02:00
cinap_lenrek d2b3e2f55a merge 2018-09-25 15:06:13 +02:00
cinap_lenrek dbfb766735 ip/dhcpd: implement rfc3397 dhcp search domain option (dnsdomain) 2018-09-25 15:04:19 +02:00
cinap_lenrek 12b3c82014 ip/ipconfig: implement rfc3397 dhcp dns search option (dnsdomain) 2018-09-25 15:02:29 +02:00
Ori Bernstein 72a840b31d Disallow '/' in file names.
A bad rename call could send a path with a '/' to cwfs.
	This is invalid, and should be disallowed.
2018-09-25 01:02:31 -07:00
cinap_lenrek 2f076f946f ip/ipconfig: handle noconfig flag for router advertisement, add debug prints, cleanup 2018-09-24 13:56:25 +02:00
cinap_lenrek ef17043327 libhtml: increase Nestmax to render some convoluted pages (thanks fernan)
example page with broken citation list numbering:

https://en.m.wikipedia.org/wiki/Commodore_64
2018-09-23 23:35:41 +02:00
cinap_lenrek 94333ce6a6 devip, ipconfig: avoid overflow on lifetime checks 2018-09-23 22:07:56 +02:00
cinap_lenrek 70c6bd0397 devip: valid and prefered life-time should be unsigned, add remove6 ctl command 2018-09-23 19:09:48 +02:00
cinap_lenrek 4a92a8f6b2 devip: fix default parameter calculation for router life-time
router life time is in seconds, while max ra interval is
in milliseconds!
2018-09-23 19:08:16 +02:00
cinap_lenrek 259ce5e3de devip: make updating ra6 router parameters atomic
when we fail to parse and validate the command, no update
should take place.
2018-09-23 17:24:59 +02:00
cinap_lenrek 1d4a36c699 ip/ipconfig: valid lifetime is in seconds, not milliseconds. 2018-09-23 17:14:29 +02:00
cinap_lenrek 74272a8364 ip/ipconfig: remove expired default routes on router advertisement 2018-09-23 02:08:59 +02:00
23hiro 0311f01122 keyboard(2) spelling (thanks Amavect) 2018-09-22 09:41:16 +02:00
cinap_lenrek 8c7a4e28d5 vt: make selecting() wait until all buttons are lifted avoiding menu when chording 2018-09-20 21:25:38 +02:00
cinap_lenrek b9796e0774 vt: implement line selection by double click 2018-09-20 21:07:10 +02:00
mischief 6fa3e08412 cfs: close mount half of pipe, fixes cfs not exiting when unmounted 2018-09-19 13:27:55 -07:00
cinap_lenrek 45afecffd1 kprof: fix precedence (thanks geoff) 2018-09-19 01:11:49 +02:00
mischief d73c67660b sum, md5sum, sha1sum: set exit status properly on open/read errors 2018-09-18 15:58:22 -07:00
mischief 026c679f49 webfs: remove automatic Referer header
automatic Referer headers were found to break downloads from
sourceforge.net, causing html pages to appear instead of tarballs.

if a website does need them, they can be added as needed via hget's -r
flag, or added to mothra.

reverts commits 67f536d20329 and 6d999c39a9f0
2018-09-18 13:14:00 -07:00
cinap_lenrek 6b9cc409de mtx, ppc: remove cistrcmp() and cistrncmp() redefinition 2018-09-18 19:34:29 +02:00
cinap_lenrek bd49212b46 kernel: fix livelock in rebalance (thanks Richard Miller)
Once a second rebalance() is called on cpu0 to adjust priorities,
so cpu-bound processes won't lock others out.  However it was only
adjusting processes which were running on cpu0.  This was observed
to lead to livelock, eg when a higher-priority process spin-waits
for a lock held by a lower priority one.
2018-09-18 00:53:05 +02:00
cinap_lenrek e619a03c28 boot(8): document tls and reboot methods 2018-09-17 18:09:33 +02:00
cinap_lenrek 2985d53b7a bootrc: add experimental reboot method to load another kernel
syntax: reboot!bootfile[!method...]

this echos bootfile to /dev/reboot, causing bootfile kernel
to be started.

when method is given, we first connect to the filesystem and
set bootargs so that bootfile can be loaded from the target
network or local fileserver.

note, when no bootfile is given, this causes the kernel to
reboot to bios.
2018-09-16 22:35:16 +02:00
cinap_lenrek 9d60ece816 libndb: add missing ndbdedup.c 2018-09-16 15:27:17 +02:00
cinap_lenrek ed41dd5b28 9boot: don't let user erase the prompt (thanks mischief) 2018-09-16 13:47:33 +02:00
cinap_lenrek a4e444f430 libndb: make ndbipinfo() walk ipnet for all matching entries, concatenate and dedup result 2018-09-16 12:39:47 +02:00
cinap_lenrek 08385e6681 ip/tftpd: remove sunkernel hack 2018-09-13 22:15:42 +02:00
cinap_lenrek a33d76f8c9 ape/make: fix \ line continuation parsing 2018-09-13 11:54:20 +02:00
mischief 5ea7337ae7 port: sync two longjmp fixes from drawterm
see drawterm commits f5e26ae93a6a and fa388286b4ca
2018-09-12 00:35:45 -07:00
mischief bcb3b3940e sdahci(3): correct device name for top level control messages (thanks joe9) 2018-09-11 00:23:35 -07:00
mischief 8c513a0740 atazz(8): fix probe formatting 2018-09-10 23:39:58 -07:00
cinap_lenrek e4d0a76289 ndb/cs: don't do dns lookups when all we got is loopback or link local addresses 2018-09-09 15:38:53 +02:00
cinap_lenrek 183ab18dfc libip: ignore ipv6 link local addresses for myipaddr() 2018-09-09 15:35:14 +02:00
cinap_lenrek b591ee195b devarch: reading msr 0xffffffff 2018-09-09 01:53:53 +02:00
cinap_lenrek ba7b07d51a devarch: restrict i/o port access to 64K, disallow msr 32-bit wrap arround (thanks aiju) 2018-09-09 01:41:35 +02:00
cinap_lenrek 4f2cdcf74b stats: fix etherstats, avoid vmax == 0 2018-09-09 00:24:43 +02:00
cinap_lenrek e534c4147e libmach: substitute /dev/zero for /proc/$pid/fpregs when missing (for snapfs) 2018-09-08 23:31:30 +02:00
cinap_lenrek 97a2e35a0c devarch: fix /dev/msr (thanks joe9, aiju)
the end condition port < offset+n could never become
false when offset truncated to 32 bit signed port is
negative. change the condition variables to unsigned
int.

msr's are not byte addressible, so advance reads by
one instead of 8.
2018-09-08 22:24:36 +02:00
cinap_lenrek a3d8481bb6 libvorbis: fix broken free() (thanks mischief) 2018-09-08 15:15:08 +02:00
cinap_lenrek 96210d79b2 merge 2018-09-08 14:50:41 +02:00
cinap_lenrek 2839760066 rc: fix Xpipefd unbalancing the redir stack
Xpipefd wants the pipe descriptor to be closed in turfredir(), so
it pushes the redirection, but this breaks Xpopredir after normal
redirection. so we shuffle the Xpipefd redir to the bottom of the
stack.
2018-09-08 14:49:00 +02:00
stanley lieber 178bc8548a fortunes: I've been looking into running Plan 9 in JSLinux -- Skip Tavakkolian 2018-09-06 19:08:57 -04:00
mischief 46d49b5dd2 audio/libogg: nuke old libogg.au 2018-09-05 08:37:01 -07:00
cinap_lenrek 2e9835e771 vt: fix selection past baseline (thanks BurnZeZ) 2018-09-04 20:55:10 +02:00
cinap_lenrek 217e8a0619 vt: fix selrange() to recover whitespace indention 2018-09-03 22:37:45 +02:00
cinap_lenrek 676298b16b vt: get rid of "clear" menu entry, fix 24x80 resize, reset selection on setdim(), document snarf/plumb 2018-09-03 21:51:32 +02:00
cinap_lenrek 80cd634c4d vt: fix plumbsel(), snarfsel()
- plumbsel()
	- remove debug prints
	- use smalloc() to convert to bytes
	- fix spurious -1 close of plumb fd

- snarfsel()
	- fix rune buffer leak in open error case
2018-09-03 20:54:26 +02:00
cinap_lenrek de9aa721f6 vt: implement proper selections (thanks Ori_B)
Ori Bernstein wrote:
> I finally got around to taking another shot at this vt patch. This change
> gets rid of implicit snarfing, and instead makes selection the way you
> select text for snarfing or plumbing. Select, then use a menu entry.
>
> It would probably be nice to have double click to expand the selection,
> rio-style, along with plumbing implicitly taking the current word, but
> that can be a separate patch.
>
> This change also punts on scrolling for simplicity -- it clears the
> selection instead of trying to handle the cases where the selection
> goes offscreen.

little amendments:

- fix line selection (point min/max inversion)
- clear selection when switching linesel/blocksel
- move selection on scroll
2018-09-03 20:05:26 +02:00
cinap_lenrek 4596959f3b ndb(8): ndb/inform also publishes ipv6 address now 2018-09-01 15:11:46 +02:00
cinap_lenrek 5a2c3580fc ip/dhcpd: bring back interface address for arpenter()
the arp table is per interface, so it is possible to have the same
netwrok on multiple physical interfaces, tho with different source
ip address. one example would be a ethernet and a wlan interface.
the mac addresses on these mediums can differ (arp proxying taking
place).

so provide our source address on the interface we received the
request on.

the previous change used the ifcaddr; which is correct; but due to a
oversight in the kernel, had to match the ip of the arp entry.
source address will always work.
2018-09-01 15:08:40 +02:00
cinap_lenrek 4e61bc282c ip/dhcpd: add varargck pragma for warning() and fatal(), do syserr with %r format 2018-09-01 14:59:19 +02:00
cinap_lenrek 3fa5aaa1bc ip/ipconfig: add varargck pragma for warning() function 2018-09-01 14:53:38 +02:00
cinap_lenrek 2d9147a33c rtl8169: fix receive for nuc BOXNUC7CJYH 2018-08-31 22:39:46 +02:00
qwx 55e0fd6031 dmid: add support for midi streams
tested with a usb midi keyboard and a midi->usb adaptor
2018-08-31 18:01:21 +02:00
mischief 67b24e6dac nusbrc: add LG G5 for nusb/ether 2018-08-30 16:23:36 -07:00
cinap_lenrek 11d1947814 arp: interface address only specifies the interface, not the source address for route lookup 2018-08-30 21:17:54 +02:00
cinap_lenrek 590bed4bf8 merge 2018-08-30 00:05:00 +02:00
cinap_lenrek b863253879 ip/dhcpd: revert arpenter() changes 2018-08-30 00:03:07 +02:00
aiju 82559c3fdc shift-jis: add support for half-width kana 2018-08-28 05:56:29 +00:00
cinap_lenrek 5c945a0b48 devip: fix router adv/sol options validation (options padded to 8 bytes) 2018-08-27 20:58:48 +02:00
cinap_lenrek cff1ab5fdf ip/ipconfig: add missing {} as DEBUG() is a macro 2018-08-26 23:05:45 +02:00
cinap_lenrek c35027e03d ip/ipconfig: check for recvra 0 on timeout 2018-08-26 22:25:35 +02:00
cinap_lenrek 52b773d635 ip/dhcpd: reject bogus requests, handle multiple ether= attributes in ndb, cleanup
unless relay agent (gaddr) is specified, dhcp requests need to
taget a local ip address on the incoming interface or broadcast.

clients might have multiple ethernet interfaces, so we need to
check if any of the ether= attributes in ndb matches. this is
done by passing lookupip() the attribute name and a expected
value and if a match is found, set Info.indb = 1.

remove tohex(), use encodefmt instead. avoid dynamcic allocation.

include interface device in log messages.
2018-08-26 18:36:35 +02:00
cinap_lenrek 5c326d9f35 devvga: disable cursor on shutdown avoiding graphics glitches on reboot 2018-08-25 21:44:08 +02:00
cinap_lenrek 82c08a8a44 ip/dhcpd: handle multiple networks on the same interface, dont get confused by v6 interface address 2018-08-25 15:10:26 +02:00
mischief 4e938841f0 igfx: support blanking by turning off panel power and backlight
tested on t61, x200, x230, x301, t420, w520
2018-08-21 11:31:45 -07:00
Alex Musolino 0c7fe8ae06 mothra(1): fix formatting 2018-08-21 23:09:35 +09:30
cinap_lenrek 976d19960f vncs: fix uninterruptable temporary warning 2018-08-21 02:21:21 +02:00
cinap_lenrek b1b347a0f4 merge 2018-08-21 02:04:33 +02:00
cinap_lenrek 37cbd6b632 vncv: adjust window size on desktop resize, fix canresize checks 2018-08-21 02:02:50 +02:00
mischief 56a2263aae vncs: shut up used and not set warning 2018-08-20 12:51:29 -07:00
mischief e1907b41d3 hjfs: set group of new files to that of the parent directory (thanks umbraticus) 2018-08-20 12:48:06 -07:00
cinap_lenrek f8f677b48e merge 2018-08-20 19:25:58 +02:00
cinap_lenrek d2089f949e vncs: support for desktop resize extension, update devdraw 2018-08-20 19:23:42 +02:00
aiju 4a120a3816 fix unbounded recursion bug in hjfs 2018-08-20 14:26:19 +01:00
cinap_lenrek 670137bf0a devdraw: zero initialize DImage.dscreen pointer (vnc, drawterm) 2018-08-19 22:00:45 +02:00