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

Function vhost_set_ifname

dpdk/lib/vhost/vhost.c:792–807  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

790}
791
792void
793vhost_set_ifname(int vid, const char *if_name, unsigned int if_len)
794{
795 struct virtio_net *dev;
796 unsigned int len;
797
798 dev = get_device(vid);
799 if (dev == NULL)
800 return;
801
802 len = if_len > sizeof(dev->ifname) ?
803 sizeof(dev->ifname) : if_len;
804
805 strncpy(dev->ifname, if_name, len);
806 dev->ifname[sizeof(dev->ifname) - 1] = '\0';
807}
808
809void
810vhost_setup_virtio_net(int vid, bool enable, bool compliant_ol_flags, bool stats_enabled,

Callers 1

Calls 2

get_deviceFunction · 0.85
strncpyFunction · 0.85

Tested by

no test coverage detected