mirror of
https://github.com/vishvananda/netlink.git
synced 2025-09-26 20:01:13 +08:00
Add support for ignore-df flag in gretap links
Signed-off-by: Giuseppe Ognibene <ognibenegiuseppe8@gmail.com>
This commit is contained in:

committed by
Vish (Ishaya) Abrams

parent
5f641a7410
commit
481da0d6a4
8
link.go
8
link.go
@@ -1118,8 +1118,16 @@ type Gretap struct {
|
||||
EncapFlags uint16
|
||||
Link uint32
|
||||
FlowBased bool
|
||||
IgnoreDf GretapIgnoreDf
|
||||
}
|
||||
|
||||
type GretapIgnoreDf uint8
|
||||
|
||||
const (
|
||||
GRETAP_IGNORE_DF_FALSE = iota
|
||||
GRETAP_IGNORE_DF_TRUE
|
||||
)
|
||||
|
||||
func (gretap *Gretap) Attrs() *LinkAttrs {
|
||||
return &gretap.LinkAttrs
|
||||
}
|
||||
|
@@ -3461,6 +3461,9 @@ func addGretapAttrs(gretap *Gretap, linkInfo *nl.RtAttr) {
|
||||
data.AddRtAttr(nl.IFLA_GRE_ENCAP_FLAGS, nl.Uint16Attr(gretap.EncapFlags))
|
||||
data.AddRtAttr(nl.IFLA_GRE_ENCAP_SPORT, htons(gretap.EncapSport))
|
||||
data.AddRtAttr(nl.IFLA_GRE_ENCAP_DPORT, htons(gretap.EncapDport))
|
||||
if gretap.IgnoreDf != GRETAP_IGNORE_DF_FALSE {
|
||||
data.AddRtAttr(nl.IFLA_GRE_IGNORE_DF, nl.Uint8Attr(uint8(gretap.IgnoreDf)))
|
||||
}
|
||||
}
|
||||
|
||||
func parseGretapData(link Link, data []syscall.NetlinkRouteAttr) {
|
||||
|
@@ -274,6 +274,7 @@ const (
|
||||
IFLA_GRE_ENCAP_SPORT
|
||||
IFLA_GRE_ENCAP_DPORT
|
||||
IFLA_GRE_COLLECT_METADATA
|
||||
IFLA_GRE_IGNORE_DF
|
||||
IFLA_GRE_MAX = IFLA_GRE_COLLECT_METADATA
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user