summaryrefslogtreecommitdiff
path: root/gdhcp
AgeCommit message (Collapse)AuthorFilesLines
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-05-04gdhcp: Fix packet length checkingPatrik Flykt1-3/+15
Fix packet length checking where payload length could have been zero. Also check that we don't set the option pointer beyond the end of the packet payload.
2012-04-29gdhcp: Update copyright informationMarcel Holtmann5-5/+5
2012-04-20gdhcp: fix strict-aliasing warningLucas De Marchi1-1/+1
The previous way was giving the following warning with gcc 4.7: CC gdhcp/common.o gdhcp/common.c: In function 'dhcp_add_simple_option': gdhcp/common.c:275:38: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing Change it slightly so not to give this warning.
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 Erickson2-0/+24
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-13gdhcp: Fix build failureSamuel Ortiz1-2/+0
<inet.h> doesn't exist.
2012-01-05dhcpv6: Release message implemented.Jukka Rissanen2-0/+32
2012-01-05dhcpv6: Handle address expiration by restarting the stack.Jukka Rissanen2-2/+20
2012-01-05dhcpv6: Rebind message implemented.Jukka Rissanen2-3/+49
2012-01-05dhcpv6: Renew message implemented.Jukka Rissanen2-2/+49
2012-01-05dhcpv6: Request message implemented.Jukka Rissanen2-1/+43
2012-01-05dhcpv6: Initial stateful DHCPv6 support.Jukka Rissanen4-11/+450
This patch contains solicitation message support.
2012-01-05dhcpv6: Support stateless DHCPv6Jukka Rissanen2-0/+36
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 Rissanen5-40/+734
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 Wagner2-6/+6
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-28gdhcp: Possible file descriptor leakJukka Rissanen1-2/+2
2011-10-25gdhcp: Add SOCK_CLOEXEC to socket()Daniel Wagner4-10/+10
Make sure all file descriptor are closed.
2011-08-09dhcp: Try to reuse the IP address we had last time.Jukka Rissanen2-5/+24
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 Massot2-0/+25
2010-12-14gdhcp: Add IPv4 Link-Local supportJulien Massot4-8/+489
IPv4 Link-Local negociation starts on gdhcp client failure.
2010-12-10gdhcp: Fix server listener watch events listSamuel Ortiz1-2/+2
Add G_IO_NVAL, G_IO_ERR and G_IO_HUP to the events list.
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-12-09dhcp: Handle proxy PAC option correctlyDavid Woodhouse1-0/+1
We're requesting the unofficial proxy option (252) but then throwing away the response because we don't recognise the type for it. This fixes proxy detection via DHCP.
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.
2010-11-13gdhcp: Fix server function name typoSamuel Ortiz1-2/+2
2010-11-13gdhcp: Send DHCPNAK when receiving a REQUEST before a DISCOVERSamuel Ortiz1-2/+6
2010-11-13gdhcp: Initial DHCP server implementationMartin Xu2-1/+939
2010-11-13gdhcp: Move get_interface_name and interface_is_up to common.cMartin Xu3-65/+76
This is needed for the dhcp server implementation.
2010-09-11Remove two pointless whitespacesMarcel Holtmann1-2/+2
2010-09-11Handle potential NULL pointer with DHCP optionsMarcel Holtmann1-0/+3
2010-08-17Remove some pointless spaces violating the coding styleMarcel Holtmann1-2/+2
2010-08-17Add more debug statements to DHCP libraryMarcel Holtmann1-0/+21
2010-08-03Use five retries for DHCP discover and select requestsMarcel Holtmann1-2/+2
2010-08-03If hostname is not provided then don't request one via DHCPMarcel Holtmann1-20/+3
2010-08-03Add server ID option support to dhcp-libSamuel Ortiz1-0/+1
2010-07-29Add DHCP library constant for requesting domain nameMarcel Holtmann1-0/+1