mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2025-08-12 06:26:39 +00:00
ipv6 mpls support
This commit is contained in:
@@ -176,7 +176,7 @@ func (t *ICMPTracer) handleICMPMessage(msg ReceivedMessage, icmpType int8, data
|
||||
t.inflightRequestRWLock.RLock()
|
||||
defer t.inflightRequestRWLock.RUnlock()
|
||||
|
||||
mpls := t.extractMPLS(msg, data)
|
||||
mpls := extractMPLS(msg, data)
|
||||
if _, ok := t.inflightRequest[ttl]; ok {
|
||||
t.inflightRequest[ttl] <- Hop{
|
||||
Success: true,
|
||||
@@ -186,7 +186,7 @@ func (t *ICMPTracer) handleICMPMessage(msg ReceivedMessage, icmpType int8, data
|
||||
}
|
||||
}
|
||||
|
||||
func (t *ICMPTracer) extractMPLS(msg ReceivedMessage, data []byte) string {
|
||||
func extractMPLS(msg ReceivedMessage, data []byte) string {
|
||||
extensionOffset := 20 + 8 + 52
|
||||
|
||||
if len(data) <= extensionOffset {
|
||||
|
||||
@@ -233,10 +233,13 @@ func (t *ICMPTracerv6) listenICMP() {
|
||||
func (t *ICMPTracerv6) handleICMPMessage(msg ReceivedMessage, icmpType int8, data []byte, ttl int) {
|
||||
t.inflightRequestRWLock.RLock()
|
||||
defer t.inflightRequestRWLock.RUnlock()
|
||||
|
||||
mpls := extractMPLS(msg, data)
|
||||
if _, ok := t.inflightRequest[ttl]; ok {
|
||||
t.inflightRequest[ttl] <- Hop{
|
||||
Success: true,
|
||||
Address: msg.Peer,
|
||||
MPLS: mpls,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user