Age | Commit message (Collapse) | Author | Files | Lines |
|
Change-Id: Icc887f469e77eea24915c89efcf216aff466fa98
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
|
|
Change-Id: I3bf09588ec0f1ee69bb1024a88ea912558d12ca7
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
|
|
Change-Id: I02fc50820cccc66aed702a97a9928981e73b43cf
Signed-off-by: Taesub Kim <taesub.kim@samsung.com>
|
|
Change-Id: Ie99a531c8d9573ab2db41ed3ea9e2ecd3cce5284
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
|
|
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
Change-Id: Iae03c564dfba3b9fd35ca751856aecbfcc58d7fc
|
|
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
Change-Id: I84a42375b5c59739e4caca1f726699ea7647ef17
|
|
Change-Id: Ib54bbd745645a53c86bb69655529f809b6586621
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
|
|
|
|
|
|
Currently tethering does not support IPv6 so its listener is
not created and is null. This will cause following output
connmand[18363]: src/dnsproxy.c:destroy_tcp_listener() index 31
(connmand:18363): GLib-CRITICAL **: g_io_channel_unref: assertion `channel != NULL' failed
connmand[18363]: src/dnsproxy.c:destroy_udp_listener() index 31
(connmand:18363): GLib-CRITICAL **: g_io_channel_unref: assertion `channel != NULL' failed
|
|
This came from Daniel when running ConnMan using valgrind
==20635== Conditional jump or move depends on uninitialised value(s)
==20635== at 0x49ECF4: get_name (dnsproxy.c:867)
==20635== by 0x49F3F7: parse_response (dnsproxy.c:1096)
==20635== by 0x49FD40: cache_update (dnsproxy.c:1410)
==20635== by 0x4A0FF3: forward_dns_reply (dnsproxy.c:1803)
==20635== by 0x4A15D9: udp_server_event (dnsproxy.c:1912)
==20635== by 0x3331E47A54: g_main_context_dispatch (gmain.c:2715)
==20635== by 0x3331E47D87: g_main_context_iterate.isra.24 (gmain.c:3290)
==20635== by 0x3331E48181: g_main_loop_run (gmain.c:3484)
==20635== by 0x44B600: main (main.c:670)
|
|
The listener_table can be NULL if we have started connman with -r
option. Because we return < 0 value to caller in this case,
the caller, e.g. the tethering code, has a possibility to change
its functionality, e.g. the tethering code can fall back to some
other DNS servers.
|
|
We must copy the response buffer before fixing the packet length.
Otherwise the packet length will go wrong if the request contained
EDNS0 data.
|
|
We were not handling client sent partial TCP messages correctly.
This meant that ConnMan would block if the client using TCP would
not send full DNS request.
When a new TCP client connects in tcp_listener_event(), a new
TCP channel is created to handle a partial client message if
all of the message is not already available. The partial TCP
message is patched together in tcp_client_event(). When all of
the TCP message has been received, the message is processed in
read_tcp_data(). The client has to send the DNS request within two
seconds before the connection is closed by ConnMan.
|
|
|
|
|
|
|
|
|
|
|
|
We add IPv6 loopback address to resolv.conf if we have created
an IPv6 listening socket to port 53. Also remove ::1 from resolv.conf
when deleting the proxy.
|
|
Do not bind to ANY address so that other DNS server applications
can be used on the same host for interfaces that are not managed
by ConnMan. This means that we only create DNS listeners on loopback
and tethering interfaces.
|
|
If dnsproxy is not in use, like when connman has been started
with -r option, then the listener_table will be NULL which can
cause crash in hash table lookup call.
|
|
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.
|
|
|
|
Service and network code use only interface indexes. Convert the rest of
the code using interface names to use interface indexes instead. The files
affected are:
include/resolver.h
src/connman.h
src/dnsproxy.c
src/resolver.c
src/rtnl.c
src/service.c
src/tethering.c
As the network and service code used interface indexes, the interface
name had to be looked up via a SIOCGIFNAME ioctl when needed. If a service
was removed due to the interface and network being taken down, the lookup
wouldn't work. This caused DNS servers to be left behind with broken sockets
since removing the DNS servers was done using the interface name.
|
|
The DNS proxy code creates and uses a TCP connection only for a single
request at a time. A TCP DNS proxy is added to the end of the server
list, but should not be used for generic requests as the connection
will be closed down after the response to the initial request. Any
other requests sent over the connection will silently disappear.
Add a check to ignore TCP DNS servers for generic lookups.
|
|
If the socket creation failed, continue with the next server.
|
|
Check GIO channel for NULL before using it. Also shut down the GIO channel
so that already pending input will not use the free'd structure.
|
|
The socket is created again on the next request.
Previously, an error condition only caused the event watch to be removed
and then added again on the next request to avoid processing spurious
error events. But in some network environments, the error condition is
caused by an overly aggressive firewall that rejects our UDP packets and
sends an ICMP error packet indicating an unreachable host and/or port.
In some of these cases we can recover by using a different UDP source
port for outgoing requests (i.e. by closing and re-opening the socket).
|
|
Check that the first part of the name is not of zero length before
attempting to calculate the length of the domain part. Also ensure
the domain lenght checking does not run outside of the receive
buffer.
Also add debug messages for ids and lengths in order to pinpoint
any possible problems.
|
|
We copied too much data into addrinfo struct which corrupted
the protocol and channel fields.
Fixes BMC#25726
|
|
The AI_PASSIVE is useless here because the server address
is always known.
|
|
There has been cases where send() is returning EINVAL even though
there is a connected the socket. So use sendto() instead and supply
the destination address when sending.
|
|
|
|
It is not necessary to create TCP sockets to server if we have
the answer already in the cache.
|
|
We should use the DNS header struct when checking DNS
protocol values instead of using pointer so that the
TCP offset is properly taken care of.
|
|
|
|
The DNS packet starts from offset 2 in TCP payload.
|
|
Handle the TCP offset properly.
|
|
The cached DNS packet will always contain two prefix bytes.
For UDP we do not send these two extra bytes. This way we do
not need to know if the cached message is from UDP or TCP query.
|
|
Instead of generating SIGPIPE, just return EPIPE error
if TCP stream is broken. This way we cannot get aborted
if we receive SIGPIPE (seen this happening).
|
|
|
|
|
|
The domain list is created in the tcp_server_event function
at connection time (G_IO_OUT event), so it is not necessary
to create it here too.
|
|
|
|
|
|
This copy will be made after scanning the list of nameservers and
only if at least one TCP server is created.
Otherwise, it will be sent an error response to the request.
|
|
Convert connman_info() into DBG() in order to avoid excessive logging
when debug prints are disabled.
|
|
|
|
The memory areas can overlap so memmove() must be used.
|