Add support for ReplayWindow in XfrmState

This commit is contained in:
Vishvananda Ishaya 2014-09-15 16:13:06 -07:00
parent 72264c566c
commit e676db42c0
2 changed files with 3 additions and 0 deletions

View File

@ -20,6 +20,7 @@ type XfrmState struct {
Mode Mode Mode Mode
Spi int Spi int
Reqid int Reqid int
ReplayWindow int
Auth *XfrmStateAlgo Auth *XfrmStateAlgo
Crypt *XfrmStateAlgo Crypt *XfrmStateAlgo
} }

View File

@ -245,6 +245,7 @@ func XfrmStateAdd(state *XfrmState) error {
msg.Mode = uint8(state.Mode) msg.Mode = uint8(state.Mode)
msg.Id.Spi = swap32(uint32(state.Spi)) msg.Id.Spi = swap32(uint32(state.Spi))
msg.Reqid = uint32(state.Reqid) msg.Reqid = uint32(state.Reqid)
msg.ReplayWindow = uint8(state.ReplayWindow)
msg.Lft.SoftByteLimit = XFRM_INF msg.Lft.SoftByteLimit = XFRM_INF
msg.Lft.HardByteLimit = XFRM_INF msg.Lft.HardByteLimit = XFRM_INF
msg.Lft.SoftPacketLimit = XFRM_INF msg.Lft.SoftPacketLimit = XFRM_INF
@ -317,6 +318,7 @@ func XfrmStateList(family int) ([]XfrmState, error) {
state.Mode = Mode(msg.Mode) state.Mode = Mode(msg.Mode)
state.Spi = int(swap32(msg.Id.Spi)) state.Spi = int(swap32(msg.Id.Spi))
state.Reqid = int(msg.Reqid) state.Reqid = int(msg.Reqid)
state.ReplayWindow = int(msg.ReplayWindow)
attrs, err := parseRouteAttr(m[msg.Len():]) attrs, err := parseRouteAttr(m[msg.Len():])
if err != nil { if err != nil {