Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. Make online service provides Internet to the other services
      (Jose Blanquicet)
   2. [PATCH] dhcp: reduce socket creation/bind latency (Tobias Klauser)


----------------------------------------------------------------------

Message: 1
Date: Wed, 12 Apr 2017 07:51:52 +0000
From: Jose Blanquicet <[email protected]>
To: [email protected]
Subject: Make online service provides Internet to the other services
Message-ID:
        <CAFC8iJ+-Phd7=8uygqsmjnovss77wbdghdbf86-54kjd5mt...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Hi,

When Tethering is enabled and there is an online service which
provides Internet then ConnMan will create a NAT to provide Internet
to the devices connected to its AP. Now, if I connect my system to
another PC, for instance using an Ethernet cable (A new Ethernet
service in terms of ConnMan); then I would like that also traffic
coming from that new service can go out to Internet through the online
service, is it possible to do with ConnMan?

If it is out of ConnMan's scope then I will need to do this manually,
so the question would be; is it possible to make these new routing
rules live together with ConnMan ones?

Regards,

Jose Blanquicet


------------------------------

Message: 2
Date: Wed, 12 Apr 2017 11:26:12 +0200
From: Tobias Klauser <[email protected]>
To: [email protected]
Subject: [PATCH] dhcp: reduce socket creation/bind latency
Message-ID: <[email protected]>

When creating a PF_PACKET socket with subsequent bind() call - both using
the same protocol argument - passing the protocol to socket() is
redundant and omitting it can save some latency. This should drop the
cost of the subsequent bind() to almost zero, see [1] for details.

Reference:
[1] 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=902fefb82ef72a50c78cb4a20cc954b037a98d1c

Signed-off-by: Tobias Klauser <[email protected]>
---
 gdhcp/client.c | 2 +-
 gdhcp/common.c | 2 +-
 gdhcp/ipv4ll.c | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gdhcp/client.c b/gdhcp/client.c
index e2eac109fc01..9deb52ea42f4 100644
--- a/gdhcp/client.c
+++ b/gdhcp/client.c
@@ -1269,7 +1269,7 @@ static int dhcp_l2_socket(int ifindex)
                .filter = (struct sock_filter *) filter_instr,
        };
 
-       fd = socket(PF_PACKET, SOCK_DGRAM | SOCK_CLOEXEC, htons(ETH_P_IP));
+       fd = socket(PF_PACKET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
        if (fd < 0)
                return -errno;
 
diff --git a/gdhcp/common.c b/gdhcp/common.c
index 146fc05bfc7f..6f8167184995 100644
--- a/gdhcp/common.c
+++ b/gdhcp/common.c
@@ -577,7 +577,7 @@ int dhcp_send_raw_packet(struct dhcp_packet *dhcp_pkt,
                                offsetof(struct ip_udp_dhcp_packet, udp),
        };
 
-       fd = socket(PF_PACKET, SOCK_DGRAM | SOCK_CLOEXEC, htons(ETH_P_IP));
+       fd = socket(PF_PACKET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
        if (fd < 0)
                return -errno;
 
diff --git a/gdhcp/ipv4ll.c b/gdhcp/ipv4ll.c
index 59adee6bdfac..d90019872bbd 100644
--- a/gdhcp/ipv4ll.c
+++ b/gdhcp/ipv4ll.c
@@ -72,7 +72,7 @@ int ipv4ll_send_arp_packet(uint8_t* source_eth, uint32_t 
source_ip,
        uint32_t ip_target;
        int fd, n;
 
-       fd = socket(PF_PACKET, SOCK_DGRAM | SOCK_CLOEXEC, htons(ETH_P_ARP));
+       fd = socket(PF_PACKET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
        if (fd < 0)
                return -errno;
 
@@ -117,7 +117,7 @@ int ipv4ll_arp_socket(int ifindex)
        int fd;
        struct sockaddr_ll sock;
 
-       fd = socket(PF_PACKET, SOCK_DGRAM | SOCK_CLOEXEC, htons(ETH_P_ARP));
+       fd = socket(PF_PACKET, SOCK_DGRAM | SOCK_CLOEXEC, 0);
        if (fd < 0)
                return fd;
 
-- 
2.12.2




------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 18, Issue 10
***************************************

Reply via email to