Skip to content

Commit

Permalink
NetLabel: the CIPSOv4 passthrough mapping does not pass categories co…
Browse files Browse the repository at this point in the history
…rrectly

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>
  • Loading branch information
Paul Moore authored and David S. Miller committed Oct 16, 2006
1 parent bf0edf3 commit ea614d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/cipso_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,8 @@ static int cipso_v4_map_cat_rbm_hton(const struct cipso_v4_doi *doi_def,

switch (doi_def->type) {
case CIPSO_V4_MAP_PASS:
net_spot_max = host_cat_len - 1;
while (net_spot_max > 0 && host_cat[net_spot_max] == 0)
net_spot_max = host_cat_len;
while (net_spot_max > 0 && host_cat[net_spot_max - 1] == 0)
net_spot_max--;
if (net_spot_max > net_cat_len)
return -EINVAL;
Expand Down

0 comments on commit ea614d7

Please sign in to comment.