-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
UPF/internal/app/up-handler.go
Lines 546 to 582 in 68acd6a
| func checkUEIPAddress(ueipaddress *ie.UEIPAddressFields, sourceInterface uint8, pdu []byte) (res bool, err error) { | |
| var srcpdu net.IP | |
| var dstpdu net.IP | |
| ueIpAddressIE := ie.NewUEIPAddress(ueipaddress.Flags, ueipaddress.IPv4Address.String(), ueipaddress.IPv6Address.String(), ueipaddress.IPv6PrefixDelegationBits, ueipaddress.IPv6PrefixLength) | |
| if waterutil.IsIPv4(pdu) { | |
| p := gopacket.NewPacket(pdu, layers.LayerTypeIPv4, gopacket.Default).NetworkLayer().(*layers.IPv4) | |
| srcpdu = p.SrcIP | |
| dstpdu = p.DstIP | |
| } else if waterutil.IsIPv6(pdu) { | |
| p := gopacket.NewPacket(pdu, layers.LayerTypeIPv6, gopacket.Default).NetworkLayer().(*layers.IPv6) | |
| srcpdu = p.SrcIP | |
| dstpdu = p.DstIP | |
| } else { | |
| return false, fmt.Errorf("PDU is not IPv4 or IPv6") | |
| } | |
| if ueipaddress == nil { | |
| return false, fmt.Errorf("Invalid UE IP Address") | |
| } | |
| if sourceInterface == ie.SrcInterfaceAccess { | |
| // check ip src field | |
| if ueIpAddressIE.HasIPv4() && ueipaddress.IPv4Address.Equal(srcpdu) { | |
| return true, nil | |
| } | |
| if ueIpAddressIE.HasIPv6() && ueipaddress.IPv6Address.Equal(srcpdu) { | |
| return true, nil | |
| } | |
| } else { | |
| // check ip dst field | |
| if ueIpAddressIE.HasIPv4() && ueipaddress.IPv4Address.Equal(dstpdu) { | |
| return true, nil | |
| } | |
| if ueIpAddressIE.HasIPv6() && ueipaddress.IPv6Address.Equal(dstpdu) { | |
| return true, nil | |
| } | |
| } | |
| return false, nil | |
| } |
Bit 3 – S/D: This bit is only applicable to the UE IP Address IE in the PDI IE. It shall be set to "0" and ignored by the receiver in IEs other than PDI IE. In the PDI IE, if this bit is set to "0", this indicates a Source IP address; if this bit is set to "1", this indicates a Destination IP address.
(TS 29.244 V17.4.0, section 8.2.62 "UE IP Address", p. 279)
Must be tested against:
- NextMN/cp-lite
- free5GC SMF with feat: add UE IP Address IE on downlink PDRs free5gc/smf#146
- in classical scenario
- with handover scenario
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Todo