From: Frank Cusack Date: Tue, 4 Mar 2003 05:21:38 +0000 (+0000) Subject: *_send_config and *_recv_config now return int instead of calling fatal(). X-Git-Tag: ppp-2.4.7~320 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=9c0f3f00059b45e62849fe5a7a3164bbe6eca00e *_send_config and *_recv_config now return int instead of calling fatal(). --- diff --git a/pppd/plugins/rp-pppoe/plugin.c b/pppd/plugins/rp-pppoe/plugin.c index a478410..6885751 100644 --- a/pppd/plugins/rp-pppoe/plugin.c +++ b/pppd/plugins/rp-pppoe/plugin.c @@ -22,7 +22,7 @@ ***********************************************************************/ 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" @@ -180,7 +180,7 @@ PPPOEConnectDevice(void) return conn->sessionSocket; } -static void +static int 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) { - 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) { - fatal("ioctl(SIOCSIFMTU): %m"); + error("ioctl(SIOCSIFMTU): %m"); + return -1; } (void) close (sock); + return 0; } -static void +static int 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); + return -1; } + return 0; } /**********************************************************************