diff options
author | Patrick McHardy <kaber@trash.net> | 2007-04-05 18:54:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-04-05 18:54:39 -0400 |
commit | 04fef9893a1fa5d429522e09bc9591736408f2e8 (patch) | |
tree | d997599873920aef8970ce625c8f9d1184d2600e /net/ipv4/xfrm4_mode_beet.c | |
parent | c5027c9a896fbe05367fb893a274deca5114bfd0 (diff) |
[XFRM]: beet: use IPOPT_NOP for option padding
draft-nikander-esp-beet-mode-07.txt states "The padding MUST be filled
with NOP options as defined in Internet Protocol [1] section 3.1
Internet header format.", so do that.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/xfrm4_mode_beet.c')
-rw-r--r-- | net/ipv4/xfrm4_mode_beet.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/xfrm4_mode_beet.c b/net/ipv4/xfrm4_mode_beet.c index 16efc66a7c3f..f8544b7f02de 100644 --- a/net/ipv4/xfrm4_mode_beet.c +++ b/net/ipv4/xfrm4_mode_beet.c | |||
@@ -54,6 +54,8 @@ static int xfrm4_beet_output(struct xfrm_state *x, struct sk_buff *skb) | |||
54 | ph->padlen = 4 - (optlen & 4); | 54 | ph->padlen = 4 - (optlen & 4); |
55 | ph->hdrlen = (optlen + ph->padlen + sizeof(*ph)) / 8; | 55 | ph->hdrlen = (optlen + ph->padlen + sizeof(*ph)) / 8; |
56 | ph->nexthdr = top_iph->protocol; | 56 | ph->nexthdr = top_iph->protocol; |
57 | if (ph->padlen) | ||
58 | memset(ph + 1, IPOPT_NOP, ph->padlen); | ||
57 | 59 | ||
58 | top_iph->protocol = IPPROTO_BEETPH; | 60 | top_iph->protocol = IPPROTO_BEETPH; |
59 | top_iph->ihl = sizeof(struct iphdr) / 4; | 61 | top_iph->ihl = sizeof(struct iphdr) / 4; |