From e676db42c090dee4de73c2f3b5042c74e00bead5 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Mon, 15 Sep 2014 16:13:06 -0700 Subject: [PATCH] Add support for ReplayWindow in XfrmState --- xfrm_state.go | 1 + xfrm_state_linux.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/xfrm_state.go b/xfrm_state.go index 7e0d927..550506d 100644 --- a/xfrm_state.go +++ b/xfrm_state.go @@ -20,6 +20,7 @@ type XfrmState struct { Mode Mode Spi int Reqid int + ReplayWindow int Auth *XfrmStateAlgo Crypt *XfrmStateAlgo } diff --git a/xfrm_state_linux.go b/xfrm_state_linux.go index c9f5485..a56e167 100644 --- a/xfrm_state_linux.go +++ b/xfrm_state_linux.go @@ -245,6 +245,7 @@ func XfrmStateAdd(state *XfrmState) error { msg.Mode = uint8(state.Mode) msg.Id.Spi = swap32(uint32(state.Spi)) msg.Reqid = uint32(state.Reqid) + msg.ReplayWindow = uint8(state.ReplayWindow) msg.Lft.SoftByteLimit = XFRM_INF msg.Lft.HardByteLimit = XFRM_INF msg.Lft.SoftPacketLimit = XFRM_INF @@ -317,6 +318,7 @@ func XfrmStateList(family int) ([]XfrmState, error) { state.Mode = Mode(msg.Mode) state.Spi = int(swap32(msg.Id.Spi)) state.Reqid = int(msg.Reqid) + state.ReplayWindow = int(msg.ReplayWindow) attrs, err := parseRouteAttr(m[msg.Len():]) if err != nil {