Thread (9 messages) 9 messages, 2 authors, 2021-12-13

Re: [iproute2-next 4/4] vdpa: Enable user to set mtu of the vdpa device

flat view

From: David Ahern <hidden>
Date: 2021-12-03 17:01:56
Also in: virtualization

On 12/1/21 9:22 PM, Parav Pandit wrote:
quoted hunk ↗ jump to hunk
@@ -154,6 +156,31 @@ static int vdpa_argv_mac(struct vdpa *vdpa, int argc, char **argv, char *mac)
 	return 0;
 }
 
+static int strtouint16_t(const char *str, uint16_t *p_val)
+{
+	char *endptr;
+	unsigned long int val;
+
+	val = strtoul(str, &endptr, 10);
+	if (endptr == str || *endptr != '\0')
+		return -EINVAL;
+	if (val > USHRT_MAX)
+		return -ERANGE;
+	*p_val = val;
+	return 0;
+}
duplicates get_u16
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help