Commit graph

277 commits

Author SHA1 Message Date
cinap_lenrek fbf29fc695 ip/cifsd: dont return garbage in upper 32 bit of unix extension stat fields 2019-09-11 15:41:14 +02:00
cinap_lenrek 88b386a4a1 ip/cifsd: add basic support for UNIX extensions 2019-09-10 21:19:34 +02:00
cinap_lenrek 67edb3bd01 ip/cifsd: exit to close connection when we get malformed smb header (fixes linux mount hang) 2019-09-10 21:17:23 +02:00
cinap_lenrek 98e2ea45fb ip/ipconfig: don't leave behind null address when dhcp gets interrupted
cleanup the null address (::) when the command gets interrupted.
2019-09-06 18:48:35 +02:00
Alex Musolino 39a435ee1c snoopy(8): add support for dhcp classless static routes option
To complement the new cl-routes field, the bootp static routes option has been
renamed to cf-routes and the network/gateway pairs are separated with a right
arrow.
2019-06-11 15:27:12 +09:30
Alex Musolino d904a57e17 snoopy(8): avoid extra spaces in dhcp filter output 2019-06-11 15:19:18 +09:30
Alex Musolino 396844787c snoopy(8): include dhcp.h instead of replicating bootp/dhcp options enum 2019-06-11 15:18:27 +09:30
cinap_lenrek 8f00b7096e ip/ipconfig: use defaults for loopback
- do not write /net/ndb for loopback medium unless -p is specified
- use defmask() instead of hardcoded /64 for v6 to get correct /128 mask for ::1
- only do duplicate address detection on ethernet
2019-03-17 05:44:55 +01:00
cinap_lenrek 7aac23b02b ip/ipconfig: use ewrite() to enable routing command for sendra 2019-03-17 04:07:30 +01:00
cinap_lenrek d75f7d273b ip/tinc: 4096 bit RSA, (passive) pmtu discovery, fix udpfd close() race, cleanup
- increase buffer size to support up to 4096 bit RSA keys
- handle PMTUDiscovery option and respond to pmtu probes
- handle port in Address option
- wlock(&netlk) before closing udpfd to sync with writers
- move default subnet handling out of gethost()
2019-03-10 19:07:58 +01:00
cinap_lenrek 14da3b8a1f ip/tinc: honor TcpOnly and IndirectData settings, script support, prefer incoming udp connections
only try listen/dial on udp when IndirectData/TcpOnly is not
enabled.

add support for scipts:
 host-up
 host-down
 tinc-up
 tinc-down
 subnet-up
 subnet-down

when dialing udp connection, only switch when there is no
other udp connection active. when we receive an authenticated
message, we switch to that connection immidiately.
2019-03-04 20:29:33 +01:00
cinap_lenrek a7ab815839 ip/cifsd: fix %.*s format xdirflush() path 2019-02-25 03:53:09 +01:00
cinap_lenrek 80b1890093 ip/ppp: fix %.*s format in debug print 2019-02-25 03:52:05 +01:00
cinap_lenrek cb8ef42b55 ip/pppoe: fix %.*s format in debug prints 2019-02-25 03:51:19 +01:00
cinap_lenrek b01b637889 ip/socksd: fix %.*s format in dialstring 2019-02-25 03:50:14 +01:00
cinap_lenrek 80a1d1ab93 ip/tftpd: fix %.*s format for homedir path 2019-02-25 03:49:17 +01:00
cinap_lenrek 1335a57865 ip/torrent: fix %.*s format in dialstring 2019-02-25 03:48:12 +01:00
cinap_lenrek cce5422e79 ip/tinc: fix mistake from previous commit 2019-02-15 02:16:31 +01:00
cinap_lenrek c0176a5051 ip/ipconfig: format ipmask with %M instead of %I 2019-02-13 04:45:41 +01:00
cinap_lenrek 45213ee6c7 ip/ipconfig, ndb/dns, libndb: handle parseipmask() errors 2019-02-12 21:44:57 +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 4e91e4a2db ip/dhcpd: remove undocumented dhcpgroup mechanism, group related ndb attributes together 2019-01-24 20:29:39 +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
qwx 9f755671fb torrent: avoid trying to fetch blocks past file 2019-01-08 13:22:09 +01:00
cinap_lenrek 615f43b76e ip/dhcpd: Add swap server support in dhcpd (thanks k0ga) 2018-11-08 21:15:07 +01:00
BurnZeZ 84e019aba3 fix misleading/wrong fd checks 2018-10-20 18:44:09 +00:00
cinap_lenrek 065c3557af ip/dhcpd, ip/tftpd: change default for tftp homedir to / 2018-10-08 02:11:36 +02: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 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 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 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
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 94333ce6a6 devip, ipconfig: avoid overflow on lifetime checks 2018-09-23 22:07:56 +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
cinap_lenrek 08385e6681 ip/tftpd: remove sunkernel hack 2018-09-13 22:15:42 +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 b863253879 ip/dhcpd: revert arpenter() changes 2018-08-30 00:03:07 +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 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
cinap_lenrek 43636dbb7f ip/ipconfig: make ra6 daemon less chatty, log to /sys/log/ipconfig instead of /sys/log/v6routeradv 2018-08-15 21:54:42 -04:00
cinap_lenrek ab4c0a012f ip/ipconfig: simplify by combining mklladdr() into mkclientid() 2018-08-12 22:39:44 +02:00
cinap_lenrek 9445f08788 ip/ipconfig: call mklladdr() to get conf.hwa initialized for ipv6 2018-08-11 16:19:32 +02:00
cinap_lenrek 55b73cbbbf ip/dhcp6d: don't drink and code 2018-06-12 19:50:04 +02:00
cinap_lenrek b9b6fcd85f ip/dhcp6d: only announce all-dhcp-servers multicast address on interface with link-local address on it 2018-06-12 19:36:31 +02:00
cinap_lenrek 232382bfc1 ip/dhcp6d: ignore short and from non-local source packets 2018-06-11 19:32:44 +02:00
cinap_lenrek d497eb2d2f dhcp6d: make constants for message types, check server identifier in request, only recheck ndb every minute 2018-06-10 22:48:51 +02:00
cinap_lenrek a3f3e31b20 dhcp6d: add minimal stateless DHCPv6 server for network boot and DNS configuration 2018-06-10 22:08:57 +02:00
cinap_lenrek 182077ac24 ip/dhcpd: parseip() error handling, make sure client ip is ipv4, add explicit length arguments to lookupname() and lookupserver() 2018-06-03 20:52:10 +02:00
cinap_lenrek 0cf8a0c4a8 ip/ipconfig: use ipmove() instead of memmove() 2018-06-03 20:31:48 +02:00
cinap_lenrek d5c906f515 ip/tftpd: deal with block wrap arround 2018-05-22 01:53:15 +02:00
cinap_lenrek 6e19d19285 separate MSCHAP(v2) and NTLM(v2) authentication
due to linux omiting the final Z(4) in the NTLMv2 reply, and
the need for the windom for LMv2 authentication, here is a new
AuthNTLM ticket request now with length and dom fields.
2018-05-20 22:49:24 +02:00
cinap_lenrek 40f6e00b9c ip/cifsd: limit response data count in TRANS2 for remotebuffersize, avoid empty filename for the root 2018-05-20 03:48:33 +02:00
cinap_lenrek 58aba2a67f cifsd: fix ntlmv2 authentication
in ntlmv2, the client will retry the challenge response trying a bunch
of different domain names assuming the same server challenge. so we have
to make retries work with factotum and the auth server.

also, windows 7 with compatlevel=4 sends all zeros LM response.
2018-05-19 16:40:01 +02:00
cinap_lenrek eb3951bcd4 ppp: set source specific default route regardless of primary flag, set link speed thru new ctl message when -b is specified 2018-05-10 19:36:14 +02:00
cinap_lenrek 87d922589d ip/linklocal: invert the localadm bit from mac address instead of just setting it 2018-05-02 20:34:43 +02:00
cinap_lenrek 2247741fe0 ip/ipconfig: fix exit status for ndbconfig 2018-05-02 00:03:54 +02:00
cinap_lenrek 190c40c9ff ip/ipconfig: populate /net/ndb from v6 router advertisements, configure multiple addresses in ndbconfig()
we now update /net/ndb with the following information gathered
from router advertisements (rfc6106 and plan9 specific options):

- recursive dns servers (option 25, ndb: dns=)
- dns search list (option 31, ndb: dnsdomain=)
- plan9 fileserver (option 250, ndb: fs=)
- plan9 authserver (option 251, ndb: auth=)

note the plan9 specific options can be disabled with the -G flag.

for ndbconfig (-N flag), we now collect all ip addresses in ndb
belonging to the devices mac address and configue them all. v6
addresses are getting added when a link local address exists
or the -6 flag has been specified to automatically configure one.

move the dhcp code in its own dhcp.c file and make symbols static
that are not used across modules.
2018-05-01 23:32:28 +02:00
cinap_lenrek af3fd92789 ip/ppp: remove old struct 2018-04-28 04:39:09 +02:00
cinap_lenrek 691370a08d ip/ipconfig: always refresh ndb/cs and ndb/dns when adding or removing ip addresses 2018-04-19 01:01:39 +02:00
cinap_lenrek 94018b2130 fix parseip() error handling in ipconfig, ppp, tftpfs and dns 2018-04-17 01:34:10 +02:00
cinap_lenrek 93ab48008e ip/ipconfig: use unique ip/ipmask/ipgw values close to match for ndbconfig 2018-04-15 00:07:42 +02:00
cinap_lenrek 780c5dfd1a ip/ipconfig: setup per local address default routes 2018-04-11 22:57:16 +02:00
cinap_lenrek eac7a2b12a ip/gping: icmpv6 support 2018-04-10 20:04:20 +02:00
cinap_lenrek 0272fa04fd ip/traceroute: icmpv6 support 2018-04-10 19:06:34 +02:00
cinap_lenrek 3e60d7127d ip/ping: stop doing clever things with dialstrings, just let cs/dial figure it out 2018-04-10 00:56:50 +02:00
cinap_lenrek dac42bd005 ip/ipconfig: fix v6 ndp code, use source specific default routes 2018-04-08 21:16:29 +02:00
cinap_lenrek 8ce98a0b32 ip/ipconfig: stop spamming the console about router receiving RA's 2018-03-18 07:31:09 +01:00
cinap_lenrek b192800096 ftpfs: no caching by default, add -c flag to enable it (patch by mycroftiv) 2018-02-14 20:35:36 +01:00
cinap_lenrek d2ec488a93 ip/dhcpd: remove old testing code 2018-01-27 23:47:46 +01:00
cinap_lenrek 5054c9795c ip/pptpd: don't mess with ipifc (handled by ppp), slay note gorup on exit 2018-01-22 21:34:39 +01:00
cinap_lenrek b670fc0ac5 ppp: remove left over debug print 2018-01-21 23:56:37 +01:00
cinap_lenrek 98b1f2a75b ppp: mschapv2 support 2018-01-21 22:55:14 +01:00
cinap_lenrek 9d0ba6f162 ip/ipconfig: use 2000::/3 instead of ::/0 for v6 default route
the ::/0 route has the bad side effect of breaking v4 connections
when theres no default route due to v6 mapped v4 addresses. this
might be temporary measure.
2018-01-16 23:27:23 +01:00
cinap_lenrek 12f27944a5 p/ipconfig: don't put automatic link-local address configuration in /net/ndb 2018-01-16 21:37:36 +01:00
cinap_lenrek b85245f5d2 ip/ipconfig: add v6 deault route from router advertisements 2018-01-14 19:33:30 +01:00
cinap_lenrek d682a6cb38 ip/ipconfig: set on-link flag in router advertisement prefix info (fixes windows7) 2018-01-10 18:28:23 +01:00
cinap_lenrek 3b7f73ccff ip/tinc: handle and set ethertype for ipv6 2017-12-21 04:11:02 +01:00
cinap_lenrek 0affe02b61 ip/tinc: handle single byte noop and end-of-option-list tcp options in clampmss() 2017-12-17 20:20:17 +01:00
cinap_lenrek 4a684fc627 6in4: add -m mtu option to specify outer MTU
instead of hardcoding the tunnel interface MTU to 1280,
we calculate the tunnel MTU from the outside MTU, which
can now be specified with the -m mtu option. The deault
outside MTU is 1500 - 8 (PPPoE).
2017-11-18 16:03:44 +01:00
cinap_lenrek daf292ac9d tinc: implement experimental mash peer to peer VPN from http://www.tinc-vpn.org/ 2017-10-31 22:44:25 +01:00
cinap_lenrek 2713779ee6 ip/torrent: avoid requesting same chunks
instead of always just requesting the missing range
of the current piece, remember the workpiece offset
and request sequential chunks from the workpiece.

this avoids double requests of the same ranges when
the peer does not respond with the data immidiately.
2017-05-01 00:01:14 +02:00
cinap_lenrek 1e2d95a803 ip/torrent: exit immidiately when file is complete after verification and not being in seed mode 2017-03-20 19:15:40 +01:00