Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDP: Ensure propagation of control message to pool.Message #510

Merged
merged 2 commits into from
Nov 15, 2023

Conversation

jkralik
Copy link
Member

@jkralik jkralik commented Nov 12, 2023

This commit enhances the UDP functionality, ensuring proper dissemination of control messages to pool.Message for improved network coordination and responsiveness

@codecov-commenter
Copy link

codecov-commenter commented Nov 12, 2023

Codecov Report

Attention: 47 lines in your changes are missing coverage. Please review.

Comparison is base (d63d5c8) 72.52% compared to head (7e6b2bb) 73.85%.

Files Patch % Lines
net/connUDP.go 77.83% 40 Missing and 5 partials ⚠️
message/pool/message.go 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #510      +/-   ##
==========================================
+ Coverage   72.52%   73.85%   +1.32%     
==========================================
  Files          70       71       +1     
  Lines        5504     5729     +225     
==========================================
+ Hits         3992     4231     +239     
+ Misses       1115     1112       -3     
+ Partials      397      386      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jkralik jkralik force-pushed the jkralik/feature/udp-propagate-interface branch 3 times, most recently from 03ea641 to 9719626 Compare November 13, 2023 08:05
net/connUDP.go Outdated
@@ -24,10 +24,36 @@ type UDPConn struct {
}

type ControlMessage struct {
Dst net.IP // destination address, receiving only
Src net.IP // source address, specifying only
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source-Address is also valid when receiving packet, same address as the "remote" parameter you get from the read

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to doc the https://pkg.go.dev/golang.org/x/net@v0.18.0/ipv4#ControlMessage it seems that Src cannot be set for write.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc says "specifying only" for source (as in "write only).

but I am quite sure (just tested it on Debian) that you ALSO get the source set when receiving.

net/connUDP.go Outdated
@@ -24,10 +24,36 @@ type UDPConn struct {
}

type ControlMessage struct {
Dst net.IP // destination address, receiving only
Src net.IP // source address, specifying only
IfIndex int // interface index, must be 1 <= value when specifying
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interface-Index 0 is defined as "any interface", so I think the "must be 1<=" part of the comment can be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thx :)

Copy link
Collaborator

@HRogge HRogge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked out the latest commit of this branch and I successfully got src/dst-IP address and Interface Index. I am looking forward to see this merged.

@jkralik jkralik force-pushed the jkralik/feature/udp-propagate-interface branch 6 times, most recently from 13d6653 to 9b60602 Compare November 13, 2023 13:07
@HRogge
Copy link
Collaborator

HRogge commented Nov 13, 2023

Just re-tested with the current commit, still works fine.

@jkralik jkralik force-pushed the jkralik/feature/udp-propagate-interface branch 5 times, most recently from 53f734c to 2249b85 Compare November 13, 2023 16:36
@jkralik jkralik marked this pull request as ready for review November 13, 2023 16:36
@jkralik jkralik force-pushed the jkralik/feature/udp-propagate-interface branch 2 times, most recently from d4bd6f1 to 848a6cf Compare November 14, 2023 06:57
.github/workflows/test.yml Show resolved Hide resolved
net/connUDP.go Outdated Show resolved Hide resolved
This commit enhances the UDP functionality, ensuring proper dissemination
of control messages to pool.Message for improved network coordination
and responsiveness
@jkralik jkralik force-pushed the jkralik/feature/udp-propagate-interface branch from 3ac36df to 7e6b2bb Compare November 15, 2023 07:30
@jkralik jkralik requested a review from HRogge November 15, 2023 07:31
@jkralik
Copy link
Member Author

jkralik commented Nov 15, 2023

@HRogge Pls this is a final state. Could you check if it works as it is expected ?

Copy link

sonarcloud bot commented Nov 15, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

82.1% 82.1% Coverage
0.0% 0.0% Duplication

@HRogge
Copy link
Collaborator

HRogge commented Nov 15, 2023

@HRogge Pls this is a final state. Could you check if it works as it is expected ?

It seems that multicast transmission is broken... not sure why, still trying to understand. I get neither a compiler nor a runtime error when using WriteMulticast() on net.UDPConn

@HRogge
Copy link
Collaborator

HRogge commented Nov 15, 2023

I also get a broken Date for the current commit when I look at it with 'git log':

commit 7e6b2bbd34f0051d0ff09d06af2d453450a30706 (HEAD -> jkralik/feature/udp-propagate-interface, github-upstream/jkralik/feature/udp-propagate-interface)
Author: Jozef Kralik <jojo.lwin@gmail.com>
Date:   Wed May 10 15:11:10 2023 +0000

    Update UDP: Ensure propagation of control message to pool.Message
    
    This commit enhances the UDP functionality, ensuring proper dissemination
    of control messages to pool.Message for improved network coordination
    and responsiveness

@HRogge
Copy link
Collaborator

HRogge commented Nov 15, 2023

@HRogge Pls this is a final state. Could you check if it works as it is expected ?

It seems that multicast transmission is broken... not sure why, still trying to understand. I get neither a compiler nor a runtime error when using WriteMulticast() on net.UDPConn

It seems my multicast now ignores the specified interface and goes along the default route (into my local management interface).

@HRogge
Copy link
Collaborator

HRogge commented Nov 15, 2023

@HRogge Pls this is a final state. Could you check if it works as it is expected ?

It seems that multicast transmission is broken... not sure why, still trying to understand. I get neither a compiler nor a runtime error when using WriteMulticast() on net.UDPConn

It seems my multicast now ignores the specified interface and goes along the default route (into my local management interface).

facepalm okay, got the problem resolved... stupidity on my side.

Copy link
Collaborator

@HRogge HRogge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code works fine with the multicast application I have been using for testing. Looking forward to see it merged.

@jkralik jkralik changed the title Update UDP: Ensure propagation of control message to pool.Message UDP: Ensure propagation of control message to pool.Message Nov 15, 2023
@jkralik jkralik merged commit ce37a93 into master Nov 15, 2023
13 checks passed
@jkralik jkralik deleted the jkralik/feature/udp-propagate-interface branch November 15, 2023 10:01
@jkralik jkralik mentioned this pull request Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants