summaryrefslogtreecommitdiff
path: root/src/network/networkd-dhcp4.c
AgeCommit message (Collapse)AuthorFilesLines
2019-11-18network: unify config_parse_dhcp_server_option_data() and ↵Yu Watanabe1-163/+1
config_parse_dhcp_send_option()
2019-11-17network: make SendOption= also take type fieldYu Watanabe1-6/+84
This makes SendOption= and SendRawOption= takes values in the same format.
2019-10-30network: amend SendOption= to take a c-escaped stringZbigniew Jędrzejewski-Szmek1-8/+7
No need to punish users by forcing them to do base64 encodings.
2019-10-30network: rename SendOptions= to SendOption=Zbigniew Jędrzejewski-Szmek1-1/+1
The name with plural made more sense where multiple options could be specified in one line. After changes in the pull request, this option only accepts one value, so from users' POV it should be singular. (The field in the data structure remains plural, because it actually stores multiple values.)
2019-10-15network: DHCPv4 client: add support to send arbitary option and dataSusant Sahani1-0/+93
2019-10-03networkd: split out repeated code to a helper functionZbigniew Jędrzejewski-Szmek1-30/+33
Follow-up for 156ddf8df7.
2019-10-03Merge pull request #12818 from yuwata/network-issue-8726Zbigniew Jędrzejewski-Szmek1-6/+111
network: disable kernel creating prefix route when RouteTable= is set
2019-10-02sd-dhcp-client: do not crash if sd_dhcp_client_send_release() is called with ↵Zbigniew Jędrzejewski-Szmek1-3/+3
no lease Again, a public function should not crash if called at an inopportune moment. Also, make sure we don't call the function if we have no lease.
2019-09-26dhcp4: make IPServiceType configurableSiddharth Chandrasekara1-1/+6
IPServiceType set to CS6 (network control) causes problems on some old network setups that continue to interpret the field as IP TOS. Make DHCP work on such networks by allowing this field to be set to CS4 (Realtime) instead, as this maps to IPTOS_LOWDELAY. Signed-off-by: Siddharth Chandrasekaran <csiddharth@vmware.com>
2019-09-20network: DHCP server Add support to transmit SIP serverSusant Sahani1-0/+6
1. DHCP server trasmit 2. Client parses and saves in leases Implements http://www.rfc-editor.org/rfc/rfc3361.txt ``` Frame 134: 348 bytes on wire (2784 bits), 348 bytes captured (2784 bits) on interface 0 Ethernet II, Src: 42:65:85:d6:4e:32 (42:65:85:d6:4e:32), Dst: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4) Internet Protocol Version 4, Src: 192.168.5.1, Dst: 192.168.5.11 User Datagram Protocol, Src Port: 67, Dst Port: 68 Dynamic Host Configuration Protocol (ACK) Message type: Boot Reply (2) Hardware type: Ethernet (0x01) Hardware address length: 6 Hops: 0 Transaction ID: 0x7cc87cb4 Seconds elapsed: 0 Bootp flags: 0x0000 (Unicast) Client IP address: 0.0.0.0 Your (client) IP address: 192.168.5.11 Next server IP address: 0.0.0.0 Relay agent IP address: 0.0.0.0 Client MAC address: 1e:04:f8:b8:2f:d4 (1e:04:f8:b8:2f:d4) Client hardware address padding: 00000000000000000000 Server host name not given Boot file name not given Magic cookie: DHCP Option: (53) DHCP Message Type (ACK) Length: 1 DHCP: ACK (5) Option: (51) IP Address Lease Time Length: 4 IP Address Lease Time: (3600s) 1 hour Option: (1) Subnet Mask (255.255.255.0) Length: 4 Subnet Mask: 255.255.255.0 Option: (3) Router Length: 4 Router: 192.168.5.1 Option: (6) Domain Name Server Length: 4 Domain Name Server: 192.168.5.1 Option: (42) Network Time Protocol Servers Length: 4 Network Time Protocol Server: 192.168.1.1 Option: (120) SIP Servers <=====here Length: 9 SIP Server Encoding: IPv4 Address (1) SIP Server Address: 192.168.1.1 SIP Server Address: 192.168.5.2 Option: (101) TCode Length: 13 TZ TCode: Europe/Berlin Option: (54) DHCP Server Identifier (192.168.5.1) Length: 4 DHCP Server Identifier: 192.168.5.1 Option: (255) End Option End: 255 ``` ``` cat /run/systemd/netif/state  ✔  ⚡  3148  16:40:51 OPER_STATE=routable CARRIER_STATE=carrier ADDRESS_STATE=routable DNS=192.168.94.2 192.168.5.1 NTP=192.168.5.1 SIP=192.168.1.1 192.168.5.2 ``` aa
2019-09-20network dhcp4: Add support send request options in a generic mannerSusant Sahani1-0/+81
2019-09-17network: take more route information into hash funcYu Watanabe1-1/+1
2019-09-17network DHCP4: Dont mislead the logs.Susant Sahani1-1/+1
The debug log making sense to the end user as an error.
2019-08-31network: adjust log level when DHCPv4 lease lostYu Watanabe1-1/+1
2019-07-24tree-wide: drop netinet/ether.h from socket-util.h and sd-netlink.hYu Watanabe1-0/+1
2019-07-22network: add fallback logic for old kernelsYu Watanabe1-7/+57
It seems that old kernels do not support prefix routes with non-default route tables. This adds a fallback logic when adding route fails. In that case, prefix route is created by kernel and the default route table is used.
2019-07-22network: disable kernel creating prefix route when RouteTable= is setYu Watanabe1-0/+55
Closes #8726.
2019-07-19network: add DHCPv4.RoutesToDNS= settingYu Watanabe1-2/+4
2019-07-19network: set routes to dns servers provided by DHCPv4Yu Watanabe1-1/+95
2019-07-19network: store routes provided by DHCPv4 in SetYu Watanabe1-62/+61
This re-writes d03073ddcde6dd2d5604b70ff4184acbe0a7961a.
2019-07-17network: do not configure routes when dropping addressesYu Watanabe1-0/+5
Follow-up for 4ff296b02411bb4f0dc38f48cbab06f8645d2a08.
2019-07-15network: make link enter failed state when a configuration failsYu Watanabe1-4/+7
Some path of configuring address, route or etc., go to failed state, but some do not. E.g., failure in address configuration which is provided by DHCPv4 goes to failed state, but static address does not. This is just for consistency. This should not change anything if everything is fine. This also voidify manager_rtnl_process_address().
2019-07-14network:dhcp4: request domain search list if UseDomains=yesYu Watanabe1-0/+6
Closes #8174.
2019-07-11network: process address reply messageYu Watanabe1-2/+2
2019-07-11network: rework route_scope_from_address()Yu Watanabe1-2/+2
2019-07-11network: route_configure() do nothing when it returns 0Yu Watanabe1-6/+6
2019-07-06src/network/networkd-dhcp4.c: set prefsrc for classless or static routesDan Streetman1-0/+4
When a DHCP server provides only a gateway, the networkd-dhcp4 code adds a default route using that gateway, and sets the just-provided address as the route's prefsrc; this was added in commit 46b0c76e2c355c0d0cc4792abb98cde07b28bc53 However, if the DHCP server has also provided classless route(s), these are used instead of a default route using the provided gateway; the networkd-dhcp4 code sets up the classless routes, but does not use the just-provided dhcp address as the prefsrc of the route(s). Note that it also doesn't set the prefsrc for static routes, though it should. If the interface has only the dhcp-provided address, this is not usually a problem, but if it has another address (e.g. a static address), then traffic sent through the dhcp-provided gateway might not use the dhcp-provided source address. If the gateway router only will route traffic from the dhcp-provided address, then the dhcp client system's networking through the router will not work. Fixes: #12969
2019-06-30network: move conf parsers and function prototypesYu Watanabe1-0/+174
2019-06-07network: assign new DHCP address before removing old lease addressYu Watanabe1-23/+122
Closes #12676.
2019-06-07network: ignore callback calls when link is in failed stateYu Watanabe1-2/+11
2019-06-07network: drop unnecessary link_enter_failed() callsYu Watanabe1-10/+4
As the function called soon later anyway.
2019-06-07network: check earlier the existence of lifetime in leaseYu Watanabe1-6/+6
2019-06-07network: make all failures in route configuration fatalYu Watanabe1-8/+9
2019-06-06networkd: add support to keep configurationSusant Sahani1-4/+4
2019-05-28network: do not send DHCPRELEASE when CriticalConnection= is enabledYu Watanabe1-2/+15
2019-05-28network: lower log level about critical connectionYu Watanabe1-1/+1
2019-05-28network: split dhcp_lease_lost() into small piecesYu Watanabe1-102/+167
2019-05-28network: set dhcp4_configured flag false before configuring addressYu Watanabe1-0/+2
Otherwise, even if dhcp_lease_acquired() fails, the flag is still on.
2019-05-28network: reset Link::dhcp4_configured flag earlierYu Watanabe1-1/+2
2019-05-28network: set preferred source in removing route entry on address lostYu Watanabe1-13/+30
Closes #12490.
2019-05-22network: unify link_ipv4ll_enabled() and link_ipv4ll_fallback_enabled()Yu Watanabe1-1/+1
2019-05-16network: honor MTUBytes= settingYu Watanabe1-2/+2
Closes #12552.
2019-05-14networkd: DHCP client add support to send RELEASE packetSusant Sahani1-0/+3
closes #10820
2019-05-11network: drop unnecessary initializationsYu Watanabe1-1/+1
2019-05-10Merge pull request #12480 from ssahani/proxy-arpYu Watanabe1-1/+1
network: bridge add support to configure proxy ARP/WIFI
2019-05-10networkd: Add support for blacklisting serversSusant Sahani1-12/+45
closes #6260 fuzzer: Add DHCP support for blacklisting servers
2019-05-09network: include glibc headers before including kernel headersYu Watanabe1-1/+1
2019-05-07network: add error cause in the logYu Watanabe1-1/+1
2019-05-07networkd: Allow DHCP4 client to set the number to attempt to reconfigure.Susant Sahani1-0/+6
Otherwise current value is 6 and after 6 it will give up.
2019-05-04networkd: Option to use LinkLocalAddressing only when DHCP failsSusant Sahani1-1/+17
When LinkLocalAddressing=fallback or LinkLocalAddressing=ipv4-fallback then IPv4LL will be started only when DHCP fails. Closes #9648.