Changeset View
Changeset View
Standalone View
Standalone View
tcp_subr.c
Context not available. | |||||
if (inp->inp_socket == NULL) | if (inp->inp_socket == NULL) | ||||
xt->xt_inp.xi_socket.xso_protocol = IPPROTO_TCP; | xt->xt_inp.xi_socket.xso_protocol = IPPROTO_TCP; | ||||
} | } | ||||
void | |||||
tcp_log_end_status(struct tcpcb *tp, uint8_t status) | |||||
{ | |||||
uint32_t bit, i; | |||||
tuexen: You might want to use `uint32_t` for `bit`. | |||||
Done Inline Actionsack rrs: ack | |||||
if ((tp == NULL) || | |||||
(status > TCP_EI_STATUS_MAX_VALUE) || | |||||
(status == 0)) { | |||||
/* Invalid */ | |||||
return; | |||||
} | |||||
if (status > (sizeof(uint32_t) * 8)) { | |||||
/* Should this be a KASSERT? */ | |||||
return; | |||||
} | |||||
bit = 1U << (status - 1); | |||||
Not Done Inline ActionsAssuming you use uint32_t for bit, you might want to use 1U instead of 1. tuexen: Assuming you use `uint32_t` for `bit`, you might want to use `1U` instead of `1`. | |||||
Done Inline Actionsack rrs: ack | |||||
if (bit & tp->t_end_info_status) { | |||||
/* already logged */ | |||||
return; | |||||
} | |||||
for (i = 0; i < TCP_END_BYTE_INFO; i++) { | |||||
Not Done Inline ActionsYou might want to use i < TCP_END_BYTE_INFO instead of i<TCP_END_BYTE_INFO. tuexen: You might want to use `i < TCP_END_BYTE_INFO` instead of `i<TCP_END_BYTE_INFO`. | |||||
if (tp->t_end_info_bytes[i] == TCP_EI_EMPTY_SLOT) { | |||||
tp->t_end_info_bytes[i] = status; | |||||
tp->t_end_info_status |= bit; | |||||
break; | |||||
} | |||||
} | |||||
} | |||||
Context not available. |
You might want to use uint32_t for bit.