diff options
| author | Roy Marples <roy@marples.name> | 2015-08-11 09:24:41 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2015-08-11 09:24:41 +0000 |
| commit | b5df92dc5d42ae761fa945807c74bbbac4585e00 (patch) | |
| tree | 5a0b1701bc2fce75206c9c32bf2ba1078a9bf90b /if.c | |
| parent | d433a3789b26da8671240423e7cf366d1b1ab2bf (diff) | |
| download | dhcpcd-b5df92dc5d42ae761fa945807c74bbbac4585e00.tar.xz | |
Don't do platform init or setting interface MTU if too small when
testing or dumping leases.
Diffstat (limited to 'if.c')
| -rw-r--r-- | if.c | 29 |
1 files changed, 16 insertions, 13 deletions
@@ -496,20 +496,23 @@ if_discover(struct dhcpcd_ctx *ctx, int argc, char * const *argv) } } - /* Handle any platform init for the interface */ - if (if_init(ifp) == -1) { - logger(ifp->ctx, LOG_ERR, "%s: if_init: %m", p); - if_free(ifp); - continue; - } + if (!(ctx->options & (DHCPCD_DUMPLEASE | DHCPCD_TEST))) { + /* Handle any platform init for the interface */ + if (if_init(ifp) == -1) { + logger(ifp->ctx, LOG_ERR, "%s: if_init: %m", p); + if_free(ifp); + continue; + } - /* Ensure that the MTU is big enough for DHCP */ - if (if_getmtu(ifp) < MTU_MIN && - if_setmtu(ifp, MTU_MIN) == -1) - { - logger(ifp->ctx, LOG_ERR, "%s: set_mtu: %m", p); - if_free(ifp); - continue; + /* Ensure that the MTU is big enough for DHCP */ + if (if_getmtu(ifp) < MTU_MIN && + if_setmtu(ifp, MTU_MIN) == -1) + { + logger(ifp->ctx, LOG_ERR, + "%s: if_setmtu: %m", p); + if_free(ifp); + continue; + } } #ifdef SIOCGIFPRIORITY |
