diff mbox

validation: pktio: don't use reserved UDP port 0

Message ID 1433948453-32641-1-git-send-email-stuart.haslam@linaro.org
State New
Headers show

Commit Message

Stuart Haslam June 10, 2015, 3 p.m. UTC
The test generates UDP packets with the src and dest port numbers set to 0,
which is a reserved port so may lead some to the packets being dropped
and the test failing. Change to use some other arbitrary port numbers.

Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
---
This is a fix for; https://bugs.linaro.org/show_bug.cgi?id=1632

 test/validation/odp_pktio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Maxim Uvarov June 10, 2015, 3:25 p.m. UTC | #1
I always fix that for debugging :)

Maxim.

On 06/10/15 18:00, Stuart Haslam wrote:
> The test generates UDP packets with the src and dest port numbers set to 0,
> which is a reserved port so may lead some to the packets being dropped
> and the test failing. Change to use some other arbitrary port numbers.
>
> Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
> ---
> This is a fix for; https://bugs.linaro.org/show_bug.cgi?id=1632
>
>   test/validation/odp_pktio.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c
> index e1025d6..495222f 100644
> --- a/test/validation/odp_pktio.c
> +++ b/test/validation/odp_pktio.c
> @@ -168,8 +168,8 @@ static uint32_t pktio_init_packet(odp_packet_t pkt)
>   	/* UDP */
>   	odp_packet_l4_offset_set(pkt, ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN);
>   	udp = (odph_udphdr_t *)(buf + ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN);
> -	udp->src_port = odp_cpu_to_be_16(0);
> -	udp->dst_port = odp_cpu_to_be_16(0);
> +	udp->src_port = odp_cpu_to_be_16(12049);
> +	udp->dst_port = odp_cpu_to_be_16(12050);
>   	udp->length = odp_cpu_to_be_16(pkt_len -
>   				       ODPH_ETHHDR_LEN - ODPH_IPV4HDR_LEN);
>   	udp->chksum = 0;
Balasubramanian Manoharan June 10, 2015, 3:50 p.m. UTC | #2
We need the fix for IP address also in the same function as the src and dst
ip address are also kept as zero.

Regards,
Bala

On 10 June 2015 at 20:55, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> I always fix that for debugging :)
>
> Maxim.
>
> On 06/10/15 18:00, Stuart Haslam wrote:
>
>> The test generates UDP packets with the src and dest port numbers set to
>> 0,
>> which is a reserved port so may lead some to the packets being dropped
>> and the test failing. Change to use some other arbitrary port numbers.
>>
>> Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
>> ---
>> This is a fix for; https://bugs.linaro.org/show_bug.cgi?id=1632
>>
>>   test/validation/odp_pktio.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c
>> index e1025d6..495222f 100644
>> --- a/test/validation/odp_pktio.c
>> +++ b/test/validation/odp_pktio.c
>> @@ -168,8 +168,8 @@ static uint32_t pktio_init_packet(odp_packet_t pkt)
>>         /* UDP */
>>         odp_packet_l4_offset_set(pkt, ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN);
>>         udp = (odph_udphdr_t *)(buf + ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN);
>> -       udp->src_port = odp_cpu_to_be_16(0);
>> -       udp->dst_port = odp_cpu_to_be_16(0);
>> +       udp->src_port = odp_cpu_to_be_16(12049);
>> +       udp->dst_port = odp_cpu_to_be_16(12050);
>>         udp->length = odp_cpu_to_be_16(pkt_len -
>>                                        ODPH_ETHHDR_LEN -
>> ODPH_IPV4HDR_LEN);
>>         udp->chksum = 0;
>>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
Stuart Haslam June 11, 2015, 9:59 a.m. UTC | #3
On Wed, Jun 10, 2015 at 09:20:01PM +0530, Bala Manoharan wrote:
> We need the fix for IP address also in the same function as the src and dst
> ip address are also kept as zero.

Uh, missed that, v2 on the way (although it'll have a different subject).

--
Stuart.
diff mbox

Patch

diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c
index e1025d6..495222f 100644
--- a/test/validation/odp_pktio.c
+++ b/test/validation/odp_pktio.c
@@ -168,8 +168,8 @@  static uint32_t pktio_init_packet(odp_packet_t pkt)
 	/* UDP */
 	odp_packet_l4_offset_set(pkt, ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN);
 	udp = (odph_udphdr_t *)(buf + ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN);
-	udp->src_port = odp_cpu_to_be_16(0);
-	udp->dst_port = odp_cpu_to_be_16(0);
+	udp->src_port = odp_cpu_to_be_16(12049);
+	udp->dst_port = odp_cpu_to_be_16(12050);
 	udp->length = odp_cpu_to_be_16(pkt_len -
 				       ODPH_ETHHDR_LEN - ODPH_IPV4HDR_LEN);
 	udp->chksum = 0;