mirror of
https://github.com/rsmarples/dhcpcd.git
synced 2024-11-24 10:35:03 +08:00
Remove useless range check.
This commit is contained in:
parent
f137e29cb6
commit
9d3a9d1320
6
dhcpcd.c
6
dhcpcd.c
@ -1455,6 +1455,12 @@ main(int argc, char **argv)
|
||||
const char *siga = NULL;
|
||||
#endif
|
||||
|
||||
int seq;
|
||||
seq = INT_MAX;
|
||||
printf ("%d\n", seq);
|
||||
seq++;
|
||||
printf ("%u\n", (uint32_t)seq);
|
||||
|
||||
/* Test for --help and --version */
|
||||
if (argc > 1) {
|
||||
if (strcmp(argv[1], "--help") == 0) {
|
||||
|
4
dhcpcd.h
4
dhcpcd.h
@ -122,8 +122,8 @@ struct dhcpcd_ctx {
|
||||
#endif
|
||||
void *priv;
|
||||
int link_fd;
|
||||
unsigned int seq; /* route message sequence no */
|
||||
unsigned int sseq; /* successful seq no sent */
|
||||
int seq; /* route message sequence no */
|
||||
int sseq; /* successful seq no sent */
|
||||
|
||||
#ifdef USE_SIGNALS
|
||||
sigset_t sigset;
|
||||
|
@ -925,9 +925,7 @@ send_netlink(struct dhcpcd_ctx *ctx, struct interface *ifp,
|
||||
msg.msg_iovlen = 1;
|
||||
/* Request a reply */
|
||||
hdr->nlmsg_flags |= NLM_F_ACK;
|
||||
if (++ctx->seq > UINT32_MAX)
|
||||
ctx->seq = 0;
|
||||
hdr->nlmsg_seq = (uint32_t)ctx->seq;
|
||||
hdr->nlmsg_seq = (uint32_t)++ctx->seq;
|
||||
if (sendmsg(s, &msg, 0) != -1) {
|
||||
ctx->sseq = ctx->seq;
|
||||
r = get_netlink(ctx, ifp, s, 0, callback);
|
||||
|
Loading…
Reference in New Issue
Block a user