Thread (71 messages) flat view 71 messages, 4 authors, 2024-07-19

Re: [PATCH net-next v5 06/25] ovpn: implement interface creation/destruction via netlink

From: Sabrina Dubroca <sd@queasysnail.net>
Date: 2024-07-03 21:27:20

2024-06-27, 15:08:24 +0200, Antonio Quartulli wrote:
 int ovpn_nl_new_iface_doit(struct sk_buff *skb, struct genl_info *info)
 {
[...]
+	msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+	if (!msg)
+		return -ENOMEM;
+
+	hdr = genlmsg_iput(msg, info);
+	if (!hdr) {
+		nlmsg_free(msg);
+		return -ENOBUFS;
+	}
+
+	if (nla_put_string(msg, OVPN_A_IFNAME, dev->name)) {
+		genlmsg_cancel(msg, hdr);
+		nlmsg_free(msg);
+		return -EMSGSIZE;
+	}
Maybe the ifindex as well? The notifications in later patches use that
rather than the name, but I don't know how the client handles this reply.
+	genlmsg_end(msg, hdr);
+
+	return genlmsg_reply(msg, info);
 }
-- 
Sabrina
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help