MCPcopy Create free account
hub / github.com/F-Stack/f-stack / set80211meshrtmac

Function set80211meshrtmac

tools/ifconfig/ifieee80211.c:1362–1380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1360}
1361
1362static void
1363set80211meshrtmac(int s, int req, const char *val)
1364{
1365 char *temp;
1366 struct sockaddr_dl sdl;
1367
1368 temp = malloc(strlen(val) + 2); /* ':' and '\0' */
1369 if (temp == NULL)
1370 errx(1, "malloc failed");
1371 temp[0] = ':';
1372 strcpy(temp + 1, val);
1373 sdl.sdl_len = sizeof(sdl);
1374 link_addr(temp, &sdl);
1375 free(temp);
1376 if (sdl.sdl_alen != IEEE80211_ADDR_LEN)
1377 errx(1, "malformed link-level address");
1378 set80211(s, IEEE80211_IOC_MESH_RTCMD, req,
1379 IEEE80211_ADDR_LEN, LLADDR(&sdl));
1380}
1381
1382static
1383DECL_CMD_FUNC(set80211addmeshrt, val, d)

Callers 1

ifieee80211.cFile · 0.85

Calls 4

mallocFunction · 0.85
link_addrFunction · 0.85
set80211Function · 0.85
freeFunction · 0.50

Tested by

no test coverage detected