netlabel_kapi.c (976e3645923bdd2fe7893aae33fd7a21098bfb28) | netlabel_kapi.c (eead1c2ea2509fd754c6da893a94f0e69e83ebe4) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * NetLabel Kernel API 4 * 5 * This file defines the kernel API for the NetLabel system. The NetLabel 6 * system manages static and dynamic label mappings for network protocols such 7 * as CIPSO and RIPSO. 8 * --- 720 unchanged lines hidden (view full) --- 729 struct netlbl_lsm_catmap *iter; 730 u32 off = *offset; 731 u32 idx; 732 733 /* only allow aligned offsets */ 734 if ((off & (BITS_PER_LONG - 1)) != 0) 735 return -EINVAL; 736 | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * NetLabel Kernel API 4 * 5 * This file defines the kernel API for the NetLabel system. The NetLabel 6 * system manages static and dynamic label mappings for network protocols such 7 * as CIPSO and RIPSO. 8 * --- 720 unchanged lines hidden (view full) --- 729 struct netlbl_lsm_catmap *iter; 730 u32 off = *offset; 731 u32 idx; 732 733 /* only allow aligned offsets */ 734 if ((off & (BITS_PER_LONG - 1)) != 0) 735 return -EINVAL; 736 |
737 /* a null catmap is equivalent to an empty one */ 738 if (!catmap) { 739 *offset = (u32)-1; 740 return 0; 741 } 742 |
|
737 if (off < catmap->startbit) { 738 off = catmap->startbit; 739 *offset = off; 740 } 741 iter = _netlbl_catmap_getnode(&catmap, off, _CM_F_WALK, 0); 742 if (iter == NULL) { 743 *offset = (u32)-1; 744 return 0; --- 773 unchanged lines hidden --- | 743 if (off < catmap->startbit) { 744 off = catmap->startbit; 745 *offset = off; 746 } 747 iter = _netlbl_catmap_getnode(&catmap, off, _CM_F_WALK, 0); 748 if (iter == NULL) { 749 *offset = (u32)-1; 750 return 0; --- 773 unchanged lines hidden --- |