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

Function setbridge_static

tools/ifconfig/ifbridge.c:452–472  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452static void
453setbridge_static(const char *val, const char *mac, int s,
454 const struct afswtch *afp)
455{
456 struct ifbareq req;
457 struct ether_addr *ea;
458
459 memset(&req, 0, sizeof(req));
460 strlcpy(req.ifba_ifsname, val, sizeof(req.ifba_ifsname));
461
462 ea = ether_aton(mac);
463 if (ea == NULL)
464 errx(1, "%s: invalid address: %s", val, mac);
465
466 memcpy(req.ifba_dst, ea->octet, sizeof(req.ifba_dst));
467 req.ifba_flags = IFBAF_STATIC;
468 req.ifba_vlan = 1; /* XXX allow user to specify */
469
470 if (do_cmd(s, BRDGSADDR, &req, sizeof(req), 1) < 0)
471 err(1, "BRDGSADDR %s", val);
472}
473
474static void
475setbridge_deladdr(const char *val, int d, int s, const struct afswtch *afp)

Callers

nothing calls this directly

Calls 4

memsetFunction · 0.85
do_cmdFunction · 0.70
strlcpyFunction · 0.50
memcpyFunction · 0.50

Tested by

no test coverage detected