summaryrefslogtreecommitdiffstats
path: root/if.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-04-28 12:02:12 +0000
committerRoy Marples <roy@marples.name>2014-04-28 12:02:12 +0000
commit94bec97280d1ade4731040e1fd9dd234fe0fdb3f (patch)
treea251bb34ee3f8147d7730a1ef76b2a47916b1cda /if.c
parente9f942eab98b3b91ae4c930a23fce38508a3f363 (diff)
downloaddhcpcd-94bec97280d1ade4731040e1fd9dd234fe0fdb3f.tar.xz
Namespace all public dhcpcd.c functions.
Add ipv4, ipv6, dhcp and dhcp6 options to re-enable if disabled globally. Try and load a delegated interface if not running on all interfaces. Fix delegated interfaces without a prefix set.
Diffstat (limited to 'if.c')
-rw-r--r--if.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/if.c b/if.c
index 3ea370b7..ef6d0503 100644
--- a/if.c
+++ b/if.c
@@ -482,6 +482,20 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv)
return ifs;
}
+struct interface *
+if_find(struct dhcpcd_ctx *ctx, const char *ifname)
+{
+ struct interface *ifp;
+
+ if (ctx != NULL && ctx->ifaces != NULL) {
+ TAILQ_FOREACH(ifp, ctx->ifaces, next) {
+ if (strcmp(ifp->name, ifname) == 0)
+ return ifp;
+ }
+ }
+ return NULL;
+}
+
int
if_domtu(const char *ifname, short int mtu)
{