]> git.ozlabs.org Git - ppp.git/commitdiff
*_send_config and *_recv_config now return int instead of calling fatal().
authorFrank Cusack <fcusack@fcusack.com>
Tue, 4 Mar 2003 05:21:38 +0000 (05:21 +0000)
committerFrank Cusack <fcusack@fcusack.com>
Tue, 4 Mar 2003 05:21:38 +0000 (05:21 +0000)
pppd/plugins/rp-pppoe/plugin.c

index a4784107e8755861bafb15a98ad8cd4f34077e97..6885751bbebd7aba6cecdabc4e23a3c618816a47 100644 (file)
@@ -22,7 +22,7 @@
 ***********************************************************************/
 
 static char const RCSID[] =
 ***********************************************************************/
 
 static char const RCSID[] =
-"$Id: plugin.c,v 1.7 2002/04/02 13:11:00 dfs Exp $";
+"$Id: plugin.c,v 1.8 2003/03/04 05:21:38 fcusack Exp $";
 
 #define _GNU_SOURCE 1
 #include "pppoe.h"
 
 #define _GNU_SOURCE 1
 #include "pppoe.h"
@@ -180,7 +180,7 @@ PPPOEConnectDevice(void)
     return conn->sessionSocket;
 }
 
     return conn->sessionSocket;
 }
 
-static void
+static int
 PPPOESendConfig(int mtu,
                u_int32_t asyncmap,
                int pcomp,
 PPPOESendConfig(int mtu,
                u_int32_t asyncmap,
                int pcomp,
@@ -195,18 +195,21 @@ PPPOESendConfig(int mtu,
     }
     sock = socket(AF_INET, SOCK_DGRAM, 0);
     if (sock < 0) {
     }
     sock = socket(AF_INET, SOCK_DGRAM, 0);
     if (sock < 0) {
-       fatal("Couldn't create IP socket: %m");
+       error("Couldn't create IP socket: %m");
+       return -1;
     }
     strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
     ifr.ifr_mtu = mtu;
     if (ioctl(sock, SIOCSIFMTU, &ifr) < 0) {
     }
     strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
     ifr.ifr_mtu = mtu;
     if (ioctl(sock, SIOCSIFMTU, &ifr) < 0) {
-       fatal("ioctl(SIOCSIFMTU): %m");
+       error("ioctl(SIOCSIFMTU): %m");
+       return -1;
     }
     (void) close (sock);
     }
     (void) close (sock);
+    return 0;
 }
 
 
 }
 
 
-static void
+static int
 PPPOERecvConfig(int mru,
                u_int32_t asyncmap,
                int pcomp,
 PPPOERecvConfig(int mru,
                u_int32_t asyncmap,
                int pcomp,
@@ -214,7 +217,9 @@ PPPOERecvConfig(int mru,
 {
     if (mru > MAX_PPPOE_MTU) {
        error("Couldn't increase MRU to %d", mru);
 {
     if (mru > MAX_PPPOE_MTU) {
        error("Couldn't increase MRU to %d", mru);
+       return -1;
     }
     }
+    return 0;
 }
 
 /**********************************************************************
 }
 
 /**********************************************************************