X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fplugins%2Fpppoe%2Fpppoe-discovery.c;fp=pppd%2Fplugins%2Fpppoe%2Fpppoe-discovery.c;h=10f51dc975dbd9df1a851ca056f586770e09aa8d;hp=1fe999dbdf55b16fa7bbefe5ce6557b1f848fa26;hb=c5ff7d10cfd97fae1783fce445c575373b65856c;hpb=20fa5e803ff90eb9c90055afd679d1f2c00932bf diff --git a/pppd/plugins/pppoe/pppoe-discovery.c b/pppd/plugins/pppoe/pppoe-discovery.c index 1fe999d..10f51dc 100644 --- a/pppd/plugins/pppoe/pppoe-discovery.c +++ b/pppd/plugins/pppoe/pppoe-discovery.c @@ -24,32 +24,6 @@ #include "pppoe.h" -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_NETPACKET_PACKET_H -#include -#elif defined(HAVE_LINUX_IF_PACKET_H) -#include -#endif - -#ifdef HAVE_ASM_TYPES_H -#include -#endif - -#ifdef HAVE_SYS_IOCTL_H -#include -#endif - -#include -#include -#include - -#ifdef HAVE_NET_IF_ARP_H -#include -#endif - int debug; int got_sigterm; int pppoe_verbose; @@ -251,9 +225,16 @@ int main(int argc, char *argv[]) } } - /* default interface name */ - if (!conn->ifName) - conn->ifName = xstrdup("eth0"); + if (optind != argc) { + fprintf(stderr, "%s: extra argument '%s'\n", argv[0], argv[optind]); + usage(); + exit(EXIT_FAILURE); + } + + if (!conn->ifName) { + fprintf(stderr, "Interface was not specified\n"); + exit(EXIT_FAILURE); + } conn->sessionSocket = -1; @@ -276,7 +257,7 @@ usage(void) { fprintf(stderr, "Usage: pppoe-discovery [options]\n"); fprintf(stderr, "Options:\n"); - fprintf(stderr, " -I if_name -- Specify interface (default eth0)\n"); + fprintf(stderr, " -I if_name -- Specify interface (mandatory option)\n"); fprintf(stderr, " -D filename -- Log debugging information in filename.\n"); fprintf(stderr, " -t timeout -- Initial timeout for discovery packets in seconds\n"