Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/ipfw/ip_fw_table.c
Show First 20 Lines • Show All 617 Lines • ▼ Show 20 Lines | restart: | ||||
if (ts.modified != 0) | if (ts.modified != 0) | ||||
goto restart; | goto restart; | ||||
/* | /* | ||||
* Link all values values to shared/per-table value array. | * Link all values values to shared/per-table value array. | ||||
* | * | ||||
* May release/reacquire UH_WLOCK. | * May release/reacquire UH_WLOCK. | ||||
*/ | */ | ||||
error = ipfw_link_table_values(ch, &ts); | error = ipfw_link_table_values(ch, &ts, flags); | ||||
if (error != 0) | if (error != 0) | ||||
goto cleanup; | goto cleanup; | ||||
if (ts.modified != 0) | if (ts.modified != 0) | ||||
goto restart; | goto restart; | ||||
/* | /* | ||||
* Ensure we are able to add all entries without additional | * Ensure we are able to add all entries without additional | ||||
* memory allocations. May release/reacquire UH_WLOCK. | * memory allocations. May release/reacquire UH_WLOCK. | ||||
Show All 14 Lines | restart: | ||||
IPFW_WLOCK(ch); | IPFW_WLOCK(ch); | ||||
v = ta_buf_m; | v = ta_buf_m; | ||||
for (i = 0; i < count; i++, v += ta->ta_buf_size) { | for (i = 0; i < count; i++, v += ta->ta_buf_size) { | ||||
ptei = &tei[i]; | ptei = &tei[i]; | ||||
num = 0; | num = 0; | ||||
/* check limit before adding */ | /* check limit before adding */ | ||||
if ((error = check_table_limit(tc, ptei)) == 0) { | if ((error = check_table_limit(tc, ptei)) == 0) { | ||||
error = ta->add(tc->astate, KIDX_TO_TI(ch, kidx), | error = ta->add(tc->astate, KIDX_TO_TI(ch, kidx), | ||||
melifaro: Could you please verify this is safe to insert the record w/o having a properly-linked value… | |||||
Not Done Inline ActionsWould it be possible if you could format the comment according to the style(9)? melifaro: Would it be possible if you could format the comment according to the style(9)?
Why `XXX`? | |||||
ptei, v, &num); | ptei, v, &num); | ||||
/* Set status flag to inform userland */ | /* Set status flag to inform userland */ | ||||
store_tei_result(ptei, OP_ADD, error, num); | store_tei_result(ptei, OP_ADD, error, num); | ||||
} | } | ||||
if (error == 0) { | if (error == 0) { | ||||
/* Update number of records to ease limit checking */ | /* Update number of records to ease limit checking */ | ||||
tc->count += num; | tc->count += num; | ||||
numadd += num; | numadd += num; | ||||
▲ Show 20 Lines • Show All 2,696 Lines • Show Last 20 Lines |
Could you please verify this is safe to insert the record w/o having a properly-linked value for this entry?
If yes, could you please add some comments on such input here?