ovpn: add missing rtnl_link_ops->get_size callback
Subsystems (2)
Ralf Lici
reviewerPATCH 1/1 ovpn: add missing rtnl_link_ops->get_size callback
ovpn_fill_info always emits IFLA_OVPN_MODE inside IFLA_INFO_DATA, but ovpn_link_ops does not provide a get_size callback. rtnetlink therefore does not account for the ovpn-specific attribute when sizing RTM_NEWLINK messages, so ovpn_fill_info can fail with -EMSGSIZE.
Add the callback and reserve room for the mode attribute.
Fixes c2d950c4672a ("ovpn: add basic interface creation/destruction/management routines")
Signed-off-by Ralf Lici <[email protected]>
--- drivers/net/ovpn/main.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ovpn/main.c +7 -0
@@ -217,6 +217,12 @@ static void ovpn_dellink(struct net_device *dev, struct list_head *head)unregister_netdevice_queue (dev, head); } +static size_t ovpn_get_size (const struct net_device *dev) +{ +/* IFLA_OVPN_MODE */ +return nla_total_size (sizeof (u8)); +} +static int ovpn_fill_info (struct sk_buff *skb,const struct net_device *dev) {struct ovpn_priv *ovpn =netdev_priv (dev);
@@ -236,6 +242,7 @@ static struct rtnl_link_ops ovpn_link_ops = { .maxtype = IFLA_OVPN_MAX, .newlink = ovpn_newlink, .dellink = ovpn_dellink, + .get_size = ovpn_get_size, .fill_info = ovpn_fill_info, };
Signature · 8 lines
2.54.0 _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel