From f5b1c3f98bf082d4ecf57e8f2e3c61fc993d80e7 Mon Sep 17 00:00:00 2001 From: Simon Chopin Date: Fri, 28 Feb 2020 11:28:07 +0100 Subject: net: new function get_ifindex The index of a given interface is an operation that highly depends on the network namespace we're in. This patch simply cuts out a function to get the index for a given interface name from the session initialization code, and expose it in the ap_net structure. This function can then be used to refresh the index when moving interfaces around. Signed-off-by: Simon Chopin --- accel-pppd/include/ap_net.h | 1 + 1 file changed, 1 insertion(+) (limited to 'accel-pppd/include') diff --git a/accel-pppd/include/ap_net.h b/accel-pppd/include/ap_net.h index 91ebdd5e..984c6c18 100644 --- a/accel-pppd/include/ap_net.h +++ b/accel-pppd/include/ap_net.h @@ -31,6 +31,7 @@ struct ap_net { void (*rtnl_put)(struct rtnl_handle *); int (*rtnl_open)(struct rtnl_handle *h, int proto); int (*move_link)(struct ap_net *net, int ifindex); + int (*get_ifindex)(const char * ifname); void (*release)(struct ap_net *net); }; -- cgit v1.2.3