MCPcopy Index your code
hub / github.com/F-Stack/f-stack / ff_veth_set_gateway6

Function ff_veth_set_gateway6

lib/ff_veth.c:745–770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

743}
744
745static int
746ff_veth_set_gateway6(struct ff_veth_softc *sc, uint32_t fib_num)
747{
748 struct sockaddr_in6 gw, dst, nm;;
749 struct rt_addrinfo info;
750 struct rib_cmd_info rci;
751
752 bzero((caddr_t)&info, sizeof(info));
753 info.rti_flags = RTF_GATEWAY;
754
755 bzero(&gw, sizeof(gw));
756 bzero(&dst, sizeof(dst));
757 bzero(&nm, sizeof(nm));
758
759 gw.sin6_len = dst.sin6_len = nm.sin6_len = sizeof(struct sockaddr_in6);
760 gw.sin6_family = dst.sin6_family = nm.sin6_family = AF_INET6;
761
762 gw.sin6_addr = sc->gateway6;
763 //dst.sin6_addr = nm.sin6_addr = 0;
764
765 info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&gw;
766 info.rti_info[RTAX_DST] = (struct sockaddr *)&dst;
767 info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&nm;
768
769 return rib_action(fib_num, RTM_ADD, &info, &rci);
770}
771
772static int
773ff_veth_setvaddr6(struct ff_veth_softc *sc, struct ff_port_cfg *cfg, const char *if_name)

Callers 1

ff_veth_setup_interfaceFunction · 0.85

Calls 2

bzeroFunction · 0.85
rib_actionFunction · 0.85

Tested by

no test coverage detected