summaryrefslogtreecommitdiff
path: root/gdhcp/client.c
AgeCommit message (Collapse)AuthorFilesLines
2015-08-07Base Code merged to SPIN 2.4submit/tizen/20150810.034432hyunuktak1-10/+33
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com> Change-Id: I84a42375b5c59739e4caca1f726699ea7647ef17
2014-10-31Tethering: Add interface that save lease in DHCP informationChengyi Zhao1-65/+0
Change-Id: Ia09c875954d8a20a3e6c39f87076780d8a6582e4
2014-10-29Imported Upstream version 1.26upstream/1.26Zhang zhengguang1-15/+61
2014-07-17Imported Upstream version 1.24upstream/1.24Zhang zhengguang1-279/+684
2013-06-12dhcpv6: Send domain list option to serverJukka Rissanen1-0/+3
OPTION_DOMAIN_LIST(24) was not sent to server.
2013-05-15gdhcp: Handle dhcp_client->type == G_DHCP_IPV4LLJustin Maggard1-17/+17
Clean up several places where dhcp_client->type == G_DHCP_IPV4LL is unhandled.
2013-05-06dhcpv6: Implement CONFIRM message supportJukka Rissanen1-2/+68
See RFC 3315 Chapter 18.1.2. Creation and Transmission of Confirm Messages for details
2013-05-06gdhcp: Initialize message status code earlyJukka Rissanen1-4/+3
The message status code was initialized too late i.e., after it was set so we lost the status code. This problem was seen with wide-dhcpv6 server.
2013-04-30dhcpv6: Add elapsed time option to sent messagesJukka Rissanen1-3/+47
A mandatory elapsed time option was missing from the sent DHCPv6 messages. See RFC 3315 chapter 22.9 for details.
2013-04-26gdhcp: Do not change the transaction id if retransmittingJukka Rissanen1-3/+9
As requested in RFC 3315 chapter 15.1, a client MUST leave the transaction id unchanged in retransmissions of a message.
2013-04-26gdhcp: Add helper functions for message retransmissionJukka Rissanen1-0/+17
2013-04-26gdhcp: Add debug print for transaction idJukka Rissanen1-5/+12
Print transaction id of sent and received messages so that it is easier to match the packets.
2012-12-20gdhcp: Use glib memory functionsDaniel Wagner1-1/+1
Use for all memory allocation/dealocation operation the glib functions. This allows us to use g_mem_profile().
2012-12-04dhcpv6: Memory leak when sending Option Request OptionJukka Rissanen1-0/+2
2012-10-11gdhcp: Use data size specific option setting functionJukka Rissanen1-6/+7
Instead of using dhcp_add_simple_option() the gdhcp now uses three functions for setting uint8, uint16 and uint32 values.
2012-10-11gdhcp: Use host byte order internallyJukka Rissanen1-26/+21
Convert to network byte order just before sending the packet.
2012-07-17gdhcp: Set client state to INIT_SELECTING on restartForest Bond1-0/+1
With the previous behavior, we would end up sending a discover message and then ignoring the reply due to the client state mismatch, so a restart would never result in successful acquisition of a lease. RFC 2131 specifies that the client should return to INIT state in various restart scenarios. However, also note that it would not make sense in any case to send a discover message and ignore the reply.
2012-07-15gdhcp: Avoid shadowing address string variableMarcel Holtmann1-4/+4
2012-05-11gdhcp: Make sure we have the message before accessing itJukka Rissanen1-0/+3
2012-05-11gdhcp: Message type is required in DHCPv4Jukka Rissanen1-1/+4
2012-05-09gdhcp: Remove dead assignmentHenrique Dante de Almeida1-1/+1
2012-05-09gdhcp: Remove assignment that's never usedHenrique Dante de Almeida1-1/+0
2012-05-04gdhcp: Add option and length checksPatrik Flykt1-0/+6
2012-04-29gdhcp: Update copyright informationMarcel Holtmann1-1/+1
2012-03-01dhcpv4-client: Change coding style for passing NULL to timeGrant Erickson1-5/+5
Pass NULL rather than 0 when calling time(2) to follow prefered stylistic convention.
2012-03-01gdhcp: set secs in a RFC 951- and 2131-compliant mannerGrant Erickson1-0/+15
This patch sets the BOOTP secs field in a RFC 951- and 2131-compliant manner for DHCPv4 DISCOVER and REQUEST/SELECT packets. Certain DHCP servers, such as that implemented in Mac OS X (< 10.7) for its "Internet Sharing" feature, refuse to issue a DHCP lease to clients that have not set a non-zero value in their DISCOVER or REQUEST packets. In fact, based on http://hints.macworld.com/article.php? story=20071223001432304, it's not non-zero but a value greater than four (4) seconds to allow another "authoritative" DHCP server on the subnet to reply first. Side-by-side packet analysis of Mac OS X, iOS, Android, ISC and Windows clients show that these clients set the BOOTP 'secs' field and are successfully issued a DHCP lease by Mac OS X. By contrast, a connman-based client will issue 10 back-to-back DISCOVER packets and will not be returned a DHCP OFFER from the server.
2012-02-13gdhcp: Add RFC 1533- and 2132-compliant client-id optionGrant Erickson1-0/+22
This patch adds a function to add a RFC 1533- and 2132-compliant DHCP client-id option (61) to sent DHCPv4 packets.
2012-02-13gdhcp: Refactor alloc_dhcp_option to accept string or raw data.Grant Erickson1-7/+21
Support specifying NULL-terminated string or raw data for allocated DHCP options.
2012-01-05dhcpv6: Release message implemented.Jukka Rissanen1-0/+31
2012-01-05dhcpv6: Handle address expiration by restarting the stack.Jukka Rissanen1-1/+17
2012-01-05dhcpv6: Rebind message implemented.Jukka Rissanen1-2/+46
2012-01-05dhcpv6: Renew message implemented.Jukka Rissanen1-1/+45
2012-01-05dhcpv6: Request message implemented.Jukka Rissanen1-1/+35
2012-01-05dhcpv6: Initial stateful DHCPv6 support.Jukka Rissanen1-11/+408
This patch contains solicitation message support.
2012-01-05dhcpv6: Support stateless DHCPv6Jukka Rissanen1-0/+34
See relevant parts from these RFCs: RFC 3315 - DHCP for IPv6 RFC 3646 - DNS configuration options for DHCP for IPv6 RFC 3736 - Stateless DHCP service for IPv6 RFC 4075 - SNTP configuration option for DHCPv6 The patch does not support authenticated information messages.
2012-01-05gdhcp: Generic stateless DHCPv6 support.Jukka Rissanen1-29/+474
The patch adds support for information-request DHCPv6 message.
2011-12-16gdhcp: Check listerner_watch before remove itYu A Wang1-1/+2
Fixed following error: connmand[4547]: src/dhcp.c:dhcp_release() dhcp 0x8c6d3e8 connmand[4547]: DHCP: switch listening mode (3 ==> 0) (connmand:4547): GLib-CRITICAL **: g_source_remove: assertion `tag > 0' failed
2011-11-10gdhcp: Use gcc atomics instead glib's onesDaniel Wagner1-3/+3
g_atomic_int_exchange_and_add() has been removed from glib 2.30 and g_atomic_int_add() should be used. Though there are still quite a few distros out which do not ship a glib version with g_atomic_int_add(). Instead of maintaing a compatiblilty glib layer we just use the built-in functions for atomic memory access.
2011-10-25gdhcp: Add SOCK_CLOEXEC to socket()Daniel Wagner1-2/+2
Make sure all file descriptor are closed.
2011-08-09dhcp: Try to reuse the IP address we had last time.Jukka Rissanen1-4/+23
This fix will cause the DHCP_REQUESTED_IP option to be sent to the server. Fixes BMC #21068
2011-06-14dhcp: Cancel old renewal timeout prior to adding a new oneGrant Erickson1-0/+6
Given the following reproduction steps: 1) Set up an access point with a Class B IP address, say 10.2.40.254. 2) Set up the access point to provide DHCP leases over a range 10.2.40.2 through 10.2.40.253. 3) Set up a short lease renewal period of 5-10 minutes. 4) Allow the device to associate, connect and receive an IP address. 5) Midway through the lease interval, change the access point to a different IP address, say, 10.2.41.254. 6) Change the access point to issue DHCP leases over a new range, 10.2.41.2 through 10.2.41.253. 7) Watch as the access point resets, the connection is lost, the connection is regained and as connman tries to get a new DHCP lease. Prior to commit 39825846, connman could receive a new but different DHCP lease but connman would not program the confirmed lease to the interface. However, following that commit, it now programs the new, changed DHCP lease to the interface but still believes the old lease is valid and attempts to keep servicing the old renewal timeout for the prior but now stale lease. This patch cancels any existing, pending DHCP lease renewal timeout following a DHCP lease configuration change.
2011-05-27gdhcp: Remove unused variableMarcel Holtmann1-3/+0
2010-12-28Building fix about implicit declaration of strnlenYang Ruirui1-0/+1
I got build failing as below: cc1: warnings being treated as errors gdhcp/client.c: In function ‘alloc_dhcp_option’: gdhcp/client.c:1455: error: implicit declaration of function ‘strnlen’ define _GNU_SOURCE fixes this problem.
2010-12-21gdhcp: Add netmask getterJulien Massot1-0/+24
2010-12-14gdhcp: Add IPv4 Link-Local supportJulien Massot1-8/+292
IPv4 Link-Local negociation starts on gdhcp client failure.
2010-12-10gdhcp: Fix client listener watch events listJulien Massot1-2/+2
Add G_IO_NVAL, G_IO_ERR and G_IO_HUP to the events list.
2010-12-10gdhcp: Fix spelling mistakeJulien Massot1-1/+1
2010-11-29gdhcp: Initialise socket structure before bindingSamuel Ortiz1-0/+1
2010-11-25gdhcp: Support hostname with space charactersMartin Xu1-2/+5
2010-11-24Increase number of DHCP discover attempts for interoperabilityMarcel Holtmann1-1/+1
Currently the DHCP discover is retried five times with a timeout of three seconds. This is not always enough if a bridge forward delay is longer than 15 seconds is configured. So increase DHCP discover attempts to ten times.