Bug 1582

Summary: IPv6 raw socket return value is not like Linux socket
Product: ns-3 Reporter: Hajime Tazaki <tazaki>
Component: ipv6Assignee: Tommaso Pecorella <tommaso.pecorella>
Status: RESOLVED FIXED    
Severity: major CC: ns-bugs
Priority: P5    
Version: pre-release   
Hardware: PC   
OS: Linux   
Attachments: Fix the return value of IPv6 raw socket

Description Hajime Tazaki 2013-02-09 09:19:03 UTC
Created attachment 1509 [details]
Fix the return value of IPv6 raw socket

Some applications use return values from socket call to check whether the data is correctly sent/received. The attached trivial patchset fixes the issue of the returned value when IPv6 raw socket is used, packet size and source address of the packet.

The patch was tested with test.py (-g as well) under changeset: 9232:0958cf37fa89.
Comment 1 Tommaso Pecorella 2013-02-11 16:33:04 UTC
+1 for the changes, however the patch does fix two separate bugs.

1) in the Send (and SendTo) the return value is incorrect.
2) in the Recv (and RecvFrom) the fromAddress parameter is not set if the packet is larger than maxSize.

I don't know if it's better to commit two changes or just one. Anyway, I'm positive with both changes. Feel free to push 'em.

Cheers,

T.
Comment 2 Hajime Tazaki 2013-02-12 05:27:17 UTC
Thanks Tommasso.
I've pushed "a" single patchset with an additional test-case to detect them.

changeset: 9236:3c5ea0bd869f