--- embedaddon/mpd/src/ipv6cp.c 2013/07/22 08:44:29 1.1.1.1 +++ embedaddon/mpd/src/ipv6cp.c 2021/03/17 00:39:23 1.1.1.2 @@ -64,7 +64,7 @@ static void Ipv6cpLayerDown(Fsm fp); static void Ipv6cpFailure(Fsm fp, enum fsmfail reason); - static int Ipv6cpSetCommand(Context ctx, int ac, char *av[], void *arg); + static int Ipv6cpSetCommand(Context ctx, int ac, const char *const av[], const void *arg); void CreateInterfaceID(u_char *intid, int random); /* @@ -84,7 +84,7 @@ Ipv6cpSetCommand, NULL, 2, (void *) SET_YES}, { "no [opt ...]", "Disable and deny option", Ipv6cpSetCommand, NULL, 2, (void *) SET_NO}, - { NULL }, + { NULL, NULL, NULL, NULL, 0, NULL }, }; /* @@ -94,7 +94,7 @@ static const struct fsmoptinfo gIpv6cpConfOpts[] = { { "INTIDENT", TY_INTIDENT, 8, 8, TRUE }, { "COMPPROTO", TY_COMPPROTO, 4, 4, FALSE }, - { NULL } + { NULL, 0, 0, 0, 0 } }; static const struct confinfo gConfList[] = { @@ -124,7 +124,7 @@ Ipv6cpFailure, NULL, NULL, - NULL, + NULL, NULL, NULL, NULL }; /* @@ -132,11 +132,15 @@ */ int -Ipv6cpStat(Context ctx, int ac, char *av[], void *arg) +Ipv6cpStat(Context ctx, int ac, const char *const av[], const void *arg) { Ipv6cpState const ipv6cp = &ctx->bund->ipv6cp; Fsm fp = &ipv6cp->fsm; + (void)ac; + (void)av; + (void)arg; + Printf("[%s] %s [%s]\r\n", Pref(fp), Fsm(fp), FsmStateName(fp->state)); Printf("Interface identificators:\r\n"); Printf("\tSelf: %02x%02x:%02x%02x:%02x%02x:%02x%02x\r\n", @@ -177,8 +181,8 @@ CreateInterfaceID(u_char *intid, int r) } srandomdev(); - ((u_int32_t*)intid)[0]=(((u_int32_t)random()) % 0xFFFFFFFF) + 1; - ((u_int32_t*)intid)[1]=(((u_int32_t)random()) % 0xFFFFFFFF) + 1; + ((u_int32_t*)(void*)intid)[0]=(((u_int32_t)random()) % 0xFFFFFFFF) + 1; + ((u_int32_t*)(void*)intid)[1]=(((u_int32_t)random()) % 0xFFFFFFFF) + 1; intid[0] &= 0xfd; } @@ -236,6 +240,7 @@ Ipv6cpConfigure(Fsm fp) static void Ipv6cpUnConfigure(Fsm fp) { + (void)fp; } /* @@ -445,8 +450,10 @@ Ipv6cpDecodeConfig(Fsm fp, FsmOption list, int num, in opt->data[0], opt->data[1], opt->data[2], opt->data[3], opt->data[4], opt->data[5], opt->data[6], opt->data[7])); switch (mode) { + u_int32_t *ui32p; case MODE_REQ: - if ((((u_int32_t*)opt->data)[0]==0) && (((u_int32_t*)opt->data)[1]==0)) { + ui32p = (u_int32_t *)(void *)opt->data; + if ((ui32p[0]==0) && (ui32p[1]==0)) { Log(LG_IPV6CP2, ("[%s] Empty INTIDENT, propose our.", b->name)); CreateInterfaceID(ipv6cp->hisintid, 1); memcpy(opt->data, ipv6cp->hisintid, 8); @@ -496,7 +503,7 @@ Ipv6cpInput(Bund b, Mbuf bp) */ static int -Ipv6cpSetCommand(Context ctx, int ac, char *av[], void *arg) +Ipv6cpSetCommand(Context ctx, int ac, const char *const av[], const void *arg) { Ipv6cpState const ipv6cp = &ctx->bund->ipv6cp;