mirror of
https://github.com/vishvananda/netlink.git
synced 2025-10-18 13:51:11 +08:00
1. Fixed endianity probem with geneve VNI (ID)
2. Parse remote IP 3. Added unit test to test geneve paramters against "ip link"
This commit is contained in:

committed by
Alessandro Boch

parent
f2f0bfd10a
commit
88079d98e6
@@ -2476,7 +2476,7 @@ func addGeneveAttrs(geneve *Geneve, linkInfo *nl.RtAttr) {
|
||||
}
|
||||
|
||||
if geneve.ID != 0 {
|
||||
data.AddRtAttr(nl.IFLA_GENEVE_ID, htonl(geneve.ID))
|
||||
data.AddRtAttr(nl.IFLA_GENEVE_ID, nl.Uint32Attr(geneve.ID))
|
||||
}
|
||||
|
||||
if geneve.Dport != 0 {
|
||||
@@ -2497,7 +2497,9 @@ func parseGeneveData(link Link, data []syscall.NetlinkRouteAttr) {
|
||||
for _, datum := range data {
|
||||
switch datum.Attr.Type {
|
||||
case nl.IFLA_GENEVE_ID:
|
||||
geneve.ID = ntohl(datum.Value[0:4])
|
||||
geneve.ID = native.Uint32(datum.Value[0:4])
|
||||
case nl.IFLA_GENEVE_REMOTE, nl.IFLA_GENEVE_REMOTE6:
|
||||
geneve.Remote = datum.Value
|
||||
case nl.IFLA_GENEVE_PORT:
|
||||
geneve.Dport = ntohs(datum.Value[0:2])
|
||||
case nl.IFLA_GENEVE_TTL:
|
||||
|
Reference in New Issue
Block a user