From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cormorant.upnet.gr (cormorant.upnet.gr [150.140.129.7]) by dpdk.org (Postfix) with ESMTP id 5DC9E235 for ; Wed, 15 Aug 2018 11:22:15 +0200 (CEST) Received: (qmail 15610 invoked from network); 15 Aug 2018 09:22:10 -0000 Received: from xmail2.upnet.gr (HELO mail1.upnet.gr) ([150.140.129.43]) (envelope-sender ) by cormorant.upnet.gr (qmail-ldap-1.03) with SMTP for ; 15 Aug 2018 09:22:10 -0000 MIME-Version: 1.0 Date: Wed, 15 Aug 2018 12:22:14 +0300 From: Konstantinos Schoinas To: users@dpdk.org In-Reply-To: <259d01f7a94e1c4eadf9e57fe89be7cc@upnet.gr> References: <259d01f7a94e1c4eadf9e57fe89be7cc@upnet.gr> Message-ID: <0d5ad82171cc381f5b5a8efd6a9f0f91@upnet.gr> X-Sender: ece8537@upnet.gr User-Agent: Roundcube Webmail/1.1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-users] Sequence Number X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Aug 2018 09:22:16 -0000 -------- Αρχικό μήνυμα -------- Θέμα: Sequence Number Ημερομηνία: 2018-08-15 12:21 Αποστολέας: Konstantinos Schoinas Παραλήπτης: users Hello, I am building an application blocks TLS session if i find a sepcific forbidden Server Name Indication. According to RFC i must make a response with Fatal Error (2) unrecognized name(112). When i receive the Client Hello and after i Extract the SNI and check it against a black list i do process the client hello in order to response to client and terminate the session. Although i am getting a lot of retransmit packets on wireshark so i suppose i am doing something wrong. I think i mights have seq and ack number wrong or something.If anyone could help i would appreciate. Here is the process of the packet after i check for the forbidden SNI: uint32_t client_receive_ack = ntohl(th-⁠>recv_ack); uint32_t client_send_seq = ntohl(th-⁠>sent_seq); th-⁠>sent_seq = th-⁠>recv_ack; th-⁠>recv_ack = htonl(client_send_seq + ntohs(iphdr-⁠>total_length)); uint16_t l = ntohs(ssl-⁠>length)-⁠0x02; uint16_t ip_l = ntohs(iphdr-⁠>total_length) -⁠ l; rte_pktmbuf_trim(m,l); iphdr-⁠>total_length = htons(ip_l); ssl-⁠>length = htons(2); alert = (struct Alert *)((uint8_t *)ssl + 5); iphdr-⁠>src_addr = dst_ip; iphdr-⁠>dst_addr = src_ip; th-⁠>src_port = dst_port; th-⁠>dst_port = src_port; ssl-⁠>type = 21; //alert message alert-⁠>type = 2; // fatal error alert-⁠>description = 112; // Unrecognized name iphdr-⁠>hdr_checksum = 0; th-⁠>cksum = 0; iphdr-⁠>hdr_checksum = rte_ipv4_cksum(iphdr); th-⁠>cksum = rte_ipv4_udptcp_cksum(iphdr,th); Thanks for your time >From contact@filipjaniszewski.com Wed Aug 15 11:45:53 2018 Return-Path: Received: from delivery.mailspamprotection.com (delivery.mailspamprotection.com [108.178.24.182]) by dpdk.org (Postfix) with ESMTP id 90BBC235 for ; Wed, 15 Aug 2018 11:45:53 +0200 (CEST) Received: from ns1.es18.siteground.eu ([37.60.250.193] helo=es18.siteground.eu) by se1.mailspamprotection.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1fpsNC-0004bo-R7 for users@dpdk.org; Wed, 15 Aug 2018 04:45:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=filipjaniszewski.com; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:From:To:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Cp0GoIczdB8ZEWylpqPg/VwEX3ci36RN5mG0rApcUXI=; b=I1j1oVCr6qsSqTtTJQMMla6keT v1twKMp15RyqL9fSd1dV2JZ9FEeXi5N3pKCDwtpaNAjEgWNGVJmzH9mhigxibTqedRdTrNdmI0KxS iWdsw3E3Q8E/uDo1LunOKUpcjQkG2u/3bW2SevM1K0mYj9sWYt4ckAsoVklHehzw5mavK73QfbHKQ 40TImQ2bFwB4C3CMDeqPl1FYTC+NjWZwRFURBwNFIYdwyPieHmccmD07OdWDmUC8JU+JEz2dGNLxg B7srjMpqPyGrp9IwDKw0zedkrVrnp8sB1tvfjDreAots90//WgAYXh6425iMyuq6q5QoouDmKdg6Y BcO5RGCA==; Received: from [89.71.152.167] (port=36590 helo=localhost.localdomain) by es18.siteground.eu with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_34-9f6032f-XX) (envelope-from ) id 1fpsNB-0004Dq-Mc for users@dpdk.org; Wed, 15 Aug 2018 11:45:49 +0200 To: users@dpdk.org From: Filip Janiszewski Message-ID: <86f9aa76-a323-635b-9078-d72f5897dcb9@filipjaniszewski.com> Date: Wed, 15 Aug 2018 11:45:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: 37.60.250.193 X-SpamExperts-Domain: es18.siteground.eu X-SpamExperts-Username: 37.60.250.193 Authentication-Results: mailspamprotection.com; auth=pass smtp.auth=37.60.250.193@es18.siteground.eu X-SpamExperts-Outgoing-Class: unsure X-SpamExperts-Outgoing-Evidence: Combined (0.39) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5n6O8gb0Gw4mpF61Kl5R3UB602E9L7XzfQH6nu9C/Fh9KJzpNe6xgvOx q3u0UDjvO1v+PcEVtX7KZY7H5dkGCkxVjyn5UrUp4n4yKOOaq9AxacYWqRomERmCuAnXCOsRR1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private data section X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Aug 2018 09:45:53 -0000 Hi, I'm using rte_mempool_create_empty (followed by rte_mempool_populate_default) to create a pool of buffers that have to be used by the application, along with the buffers I need to have a small set of meta information, so that when the user request an objects (rte_mempool_get) it gets back the buffer + the meta data. >>From the documentation it seems that I could use the "private_data_size" field while creating the pool, but the description is not very clear to me: "The size of the private data appended after the mempool structure. This is useful for storing some private data after the mempool structure, as is done for rte_mbuf_pool for example." Are those private data stored after each mempool object? It's legal then do something like this: ((char*)buf_ptr + elt_size) to access the private section of the buffer? (Assuming buf_ptr is the pointer returned by rte_mempool_get, void*.). >>From the code in rte_mempool.c I see that: . /*< * reserve a memory zone for this mempool: private data is< * cache-aligned< */< data_size = (private_data_size +< MEMPOOL_ALIGN_MASK) & (~RTE_MEMPOOL_ALIGN_MASK); . so it looks like that chunk of private data is just a big common buffer allocated along with the whole mempool, the objects within the pool do not have any private data by themselves. How can I add some private data to each object of the mempool? (I know the simpler solution would be to increase elt_size to cover the requirement of the meta data I want to add, but what's the purpose of private_data then??) Thanks -- BR, Filip +48 666 369 823