diff options
author | Paul Moore <paul.moore@hp.com> | 2006-10-11 19:10:49 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-10-16 02:14:16 -0400 |
commit | ea614d7f4fb2d436b7a5ee490d1011615f6b38d5 (patch) | |
tree | 39953be82c3a6fc98cc6257cb965cd1af159fe6f | |
parent | bf0edf39296097f20c5fcc4919ed7d339194bd75 (diff) |
NetLabel: the CIPSOv4 passthrough mapping does not pass categories correctly
The CIPSO passthrough mapping had a problem when sending categories which
would cause no or incorrect categories to be sent on the wire with a packet.
This patch fixes the problem which was a simple off-by-one bug.
Signed-off-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: James Morris <jmorris@namei.org>
-rw-r--r-- | net/ipv4/cipso_ipv4.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c index d19c9ac7727e..e2077a3aa8c0 100644 --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c | |||
@@ -832,8 +832,8 @@ static int cipso_v4_map_cat_rbm_hton(const struct cipso_v4_doi *doi_def, | |||
832 | 832 | ||
833 | switch (doi_def->type) { | 833 | switch (doi_def->type) { |
834 | case CIPSO_V4_MAP_PASS: | 834 | case CIPSO_V4_MAP_PASS: |
835 | net_spot_max = host_cat_len - 1; | 835 | net_spot_max = host_cat_len; |
836 | while (net_spot_max > 0 && host_cat[net_spot_max] == 0) | 836 | while (net_spot_max > 0 && host_cat[net_spot_max - 1] == 0) |
837 | net_spot_max--; | 837 | net_spot_max--; |
838 | if (net_spot_max > net_cat_len) | 838 | if (net_spot_max > net_cat_len) |
839 | return -EINVAL; | 839 | return -EINVAL; |