X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-linux.c;h=b091030d708f4eafb29fcb66e0b7913f7356953e;hb=7e54469ed4f3c2ecc1006475dcd10df1d1fe35d3;hp=aba33d3b413e2a65d8839e82317bb5c065bbbc19;hpb=a762f529e9e62b382f66a8aedfc1c52cd6ff90d0;p=ppp.git diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index aba33d3..b091030 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -2346,11 +2346,13 @@ int sifaddr (int unit, u_int32_t our_adr, u_int32_t his_adr, /* * Set the gateway address */ - SIN_ADDR(ifr.ifr_dstaddr) = his_adr; - if (ioctl(sock_fd, SIOCSIFDSTADDR, (caddr_t) &ifr) < 0) { - if (! ok_error (errno)) - error("ioctl(SIOCSIFDSTADDR): %m (line %d)", __LINE__); - return (0); + if (his_adr != 0) { + SIN_ADDR(ifr.ifr_dstaddr) = his_adr; + if (ioctl(sock_fd, SIOCSIFDSTADDR, (caddr_t) &ifr) < 0) { + if (! ok_error (errno)) + error("ioctl(SIOCSIFDSTADDR): %m (line %d)", __LINE__); + return (0); + } } /* * Set the netmask.