summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2013-02-22iptables: Merge clear_tables_flags() and reset_xtables()Daniel Wagner1-25/+19
Both function reset the xtables library. So let's do this at the same place.
2013-02-22iptables: Free table pointerDaniel Wagner1-1/+3
And also use g_strv_length() to count the number of entries. Thanks Tomasz!
2013-02-22iptables: Free match rulesDaniel Wagner1-0/+9
We forgot to free the match rules.
2013-02-22iptables: Reset pointer after freeingDaniel Wagner1-2/+6
The match or the target might be reused in the next invocation of iptables and then xtables operates on this invalid pointer. xt_t->t and xt_m->m are keept alive via the global variables xtables_targets and xtables_matches.
2013-02-22iptables: Reinitialize global parser tableDaniel Wagner1-2/+16
xtables modifies the global parse table and allocates additional memory. If that happens we need to free it afterwards.
2013-02-22iptables: Free xtables entry when removing one entry from the tableDaniel Wagner1-2/+3
2013-02-19error: Handle ECONNREFUSED gracefully in dbus error handlerJukka Rissanen1-0/+1
2013-02-19storage: Add function to load provider configuration fileJukka Rissanen2-0/+17
2013-02-19config: Read only wifi configJukka Rissanen1-1/+5
2013-02-19config: Remove obsolete definitionJukka Rissanen1-2/+0
2013-02-18iptables: Cannot flush all rules without API to set themPatrik Flykt1-10/+2
Currently there exists no API where iptables rules can be set. The flush code does not touch the default chain policy at the moment. Any pre- existing iptables rules setting default policy to reject and relying on individual iptables rules allowing packets going through will prevent all IP communication. Removing all iptables rules on startup can expose the device to unwanted traffic as well. For the time being disable iptables flush on init. Please be careful with iptables rules and the masquerading ones ConnMan sets when tethering.
2013-02-14shared: Add helpers for SHA-1 based HMAC, PBKDF2 and PRFMarcel Holtmann2-0/+222
2013-02-14shared: Add generic debug and hexdump helpersMarcel Holtmann2-0/+121
2013-02-12systemd: Force daemon restart on failureJukka Rissanen1-0/+1
Important if you have a headless system.
2013-02-12iptables: Update the hook entries correctly in iptables_delete_rule()Daniel Wagner1-3/+8
The builtin value is only valid in the chain head entry and not in any other entry. That means we need to lookup the head entry and use that builtin value (== hook id) and then update all references which follow that chain.
2013-02-12iptables: Test if match and target arguments are also the sameDaniel Wagner1-1/+21
We need to verify that also the arguments are the same, e.g. if we have two rules like -t filter -A INPUT -m mark --mark 1 -j LOG -t filter -A INPUT -m mark --mark 2 -j LOG then the matcher and the target would be the same without looking at '1' or '2'. When deleting a rule, we would always remove the first rule which matches the 'match' type and target type, so let's have a look also on the arguments. iptables does it the same way.
2013-02-12iptables: Fix fallthrough rulesDaniel Wagner1-0/+21
2013-02-12iptables: Remove unused __connman_iptables_command()Daniel Wagner2-464/+0
2013-02-12nat: Use new iptables APIDaniel Wagner1-4/+8
2013-02-12iptables: Add split out iptables commandsDaniel Wagner2-0/+527
Instead of having a pure string based API, we add two new main functions, __connman_iptables_append() and __connman_iptables_remove(). The missing commands will be added later. To simplify the whole code, the __connman_iptables_command() code is refactored into smaller pieces: parse_rule_spec() calls a few functions such as clear_tables_flags() and parse_xt_modules() which should make the reading of the main parser loop simpler. Also added a few comments on the parser which is really tricky.
2013-02-12nat: No need to 'nat' table anymoreDaniel Wagner1-18/+0
This is done in iptables.c directly.
2013-02-12iptables: Flush 'filter' 'mangle' and 'nat' tableDaniel Wagner1-1/+60
The implementation is ugly but there is not much we can do about it, the iptables API is being just plain stupid here.
2013-02-12iptables: Add CONNMAN_IPTABLES_DEBUG environment variableDaniel Wagner1-30/+84
If CONNMAN_IPTABLES_DEBUG is set, then print the table when it is loaded and print it the table which will be written. Also use DBG() instead of connman_info().
2013-02-12iptables: Remove dependency on table in iterator_entries_cb_tDaniel Wagner1-24/+14
With removing the table argument the callback can now either iterate over buffer we get from the kernel or the one we write to the kernel.
2013-02-12iptables: Do not pass table into dump_match() and dump_target()Daniel Wagner1-8/+5
2013-02-12iptables: Get rid of the iterator macroDaniel Wagner1-57/+60
Instead implement the iterator loop directly. Since both dump_entry() and add_entry() have calculated 'builtin' and 'offset' let's pass in them in as well. In the next step we are able to remove also the table argument which will allow us to unify the parsing the table we get from IPT_SO_GET_ENTRIES and the table we will pass in to the kernel via IPT_SO_SET_REPLACE.
2013-02-12iptables: Clear global parser flagsDaniel Wagner1-0/+20
That allows the parser to be reentrantable.
2013-02-12iptables: Make string arguments constDaniel Wagner1-23/+30
2013-02-12iptables: Add some documentationDaniel Wagner1-0/+90
These are some random notes but should give the next person to debug iptables some introduction.
2013-02-05ipconfig: Use proper address structure when appending IPv4 infoPatrik Flykt1-1/+1
2013-02-05service: Validate the IP addresses before usePatrik Flykt1-41/+58
When setting IP address information via D-Bus, first create a new ipconfig structure to hold the values. If the values were validated correctly, update the service ipconfig structure with the new values. In order to achieve this, refactor the existing code. Fixes BMC#25930
2013-02-05service: Factor out ipconfig creationPatrik Flykt1-20/+38
The caller has to set the created ipconfig into its data structures.
2013-02-05ipconfig: Add checks for invalid IPv4/IPv6 addressesPatrik Flykt1-3/+23
Also fine tune returned errors.
2013-02-05ipconfig: Do not overwrite gateway addressJukka Rissanen2-12/+8
If we have already received gateway address via newroute rtnl message, then do not overwrite it when receiving newaddr message. Fixes BMC#25931
2013-01-30technology: Support multiple technology driversPatrik Flykt1-49/+111
As tethering is enabled on the technology level, both the bluetooth and the bluetooth_legacy plugin need to register technology drivers for CONNMAN_SERVICE_TYPE_BLUETOOTH. Modify the technology code to create a list of registered technology drivers instead of a single technology driver pointer.
2013-01-30service: Must not return NULL with a synchronous GDBus method callPatrik Flykt1-2/+0
If NULL is returned, GDBus will call the registered function repeatedly.
2013-01-30network: Allow more than one network driver register the same typePatrik Flykt1-10/+0
Allowing more than one network driver to register the same network type requires the network driver to properly identify which networks belong to it in the network driver probe function.
2013-01-30technology: Enable/disable individual devices also with rfkillPatrik Flykt1-4/+16
In order to keep ConnMan devices in sync with Bluz 5 adapters, the individual devices need to be enabled/disabled also when unblocking/blocking them with rfkill. Thus enable devices after unblocking and disable devices before blocking with rfkill.
2013-01-30technology: Check technology driver probe function before callingPatrik Flykt1-1/+5
2013-01-30technology: Remove technology driver by pointerPatrik Flykt1-2/+4
Compare the technology driver pointer to the driver being unregistered as the function is supposed to remove only the given driver. Also check if the driver has a remove function before calling it.
2013-01-30technology: Remove unnecessary comparison and gotoPatrik Flykt1-5/+1
2013-01-30network: Unset driver on failed matchPatrik Flykt1-1/+3
2013-01-24service: Notify leaving online state when downgrading it to readyTomasz Bursztyka1-1/+3
Fixes BMC#25862
2013-01-24ipconfig: IPv6 was enabled too earlyJukka Rissanen1-2/+3
When enabling IPv6 ipconfig, we enable kernel IPv6 support too early. The ipconfig might get unreffed which will disable ipconfig and thus disable kernel IPv6 support. By moving kernel IPv6 enabling after the ipconfig unref call, we make sure that IPv6 kernel support is properly enabled. This is related to fix in commit d479904ecaa2bd9
2013-01-18dnsproxy: DNS response answer count was incorrectly setJukka Rissanen1-1/+1
We set the answer count in host byte order instead of network byte order when sending cached AAAA record. This problem is only seen in special case when an AAAA record is generated by us when there is IPv4 address in cache but no IPv6 address for the host.
2013-01-16network: Do not report any error when removing a connecting networkTomasz Bursztyka1-1/+2
When connecting a network, if it's related technology is disabled, this network will raise an error through the agent. Leading to a possible retry request from the user, then to a crash if the user does so. Thus, we prevent any error to be raised in such situation and silently disconnect the connecting network instead.
2013-01-16network: Move up code about set_connected() and set_disconnectedTomasz Bursztyka1-625/+627
2013-01-16service: Trigger autoconnect when AutoConnect flag is enabledJukka Rissanen1-0/+3
2013-01-16ipconfig: Do not disable IPv6 in lower up stateJukka Rissanen1-12/+0
Disabling IPv6 in lower up causes problems in IPv6 connectivity. The interface IPv6 status can stay in disabled state because of races. So this patch reverts the commit 4ce90440a70abce7de537777 and lets service IPv6 state go to READY when we get an auto configured address for the interface. Fixes BMC#25929
2013-01-15service: Update notifier state when relevant while getting readyTomasz Bursztyka1-1/+2
When getting 1 service to online, and disonnecting it: Manager state stays at 'ready'. This is due to service updating the notifier about its state 'ready' 2 times. Once when connecting: idle -> ready, and once when disconnecting: online -> ready.