Deleted Added
full compact
bundle.c (96153) bundle.c (97360)
1/*-
2 * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 1998 Brian Somers <brian@Awfulhak.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/usr.sbin/ppp/bundle.c 96153 2002-05-07 10:06:54Z brian $
26 * $FreeBSD: head/usr.sbin/ppp/bundle.c 97360 2002-05-27 23:19:53Z brian $
27 */
28
29#include <sys/param.h>
30#include <sys/socket.h>
31#include <netinet/in.h>
32#include <net/if.h>
33#include <net/if_tun.h> /* For TUNS* ioctls */
34#include <net/route.h>

--- 1575 unchanged lines hidden (view full) ---

1610 else if (got != iov[0].iov_len)
1611 log_Printf(LogERROR, "%s: Failed initial sendmsg: Only sent %d of %u\n",
1612 sun->sun_path, got, (unsigned)iov[0].iov_len);
1613 else {
1614 /* We must get the ACK before closing the descriptor ! */
1615 int res;
1616
1617 if ((got = read(reply[0], &newpid, sizeof newpid)) == sizeof newpid) {
27 */
28
29#include <sys/param.h>
30#include <sys/socket.h>
31#include <netinet/in.h>
32#include <net/if.h>
33#include <net/if_tun.h> /* For TUNS* ioctls */
34#include <net/route.h>

--- 1575 unchanged lines hidden (view full) ---

1610 else if (got != iov[0].iov_len)
1611 log_Printf(LogERROR, "%s: Failed initial sendmsg: Only sent %d of %u\n",
1612 sun->sun_path, got, (unsigned)iov[0].iov_len);
1613 else {
1614 /* We must get the ACK before closing the descriptor ! */
1615 int res;
1616
1617 if ((got = read(reply[0], &newpid, sizeof newpid)) == sizeof newpid) {
1618 log_Printf(LogDEBUG, "Received confirmation from pid %d\n",
1619 (int)newpid);
1618 log_Printf(LogDEBUG, "Received confirmation from pid %ld\n",
1619 (long)newpid);
1620 if (lock && (res = ID0uu_lock_txfr(lock, newpid)) != UU_LOCK_OK)
1621 log_Printf(LogERROR, "uu_lock_txfr: %s\n", uu_lockerr(res));
1622
1623 log_Printf(LogDEBUG, "Transmitting link (%d bytes)\n", expect);
1624 if ((got = writev(reply[0], iov + 1, niov - 1)) != expect) {
1625 if (got == -1)
1626 log_Printf(LogERROR, "%s: Failed writev: %s\n",
1627 sun->sun_path, strerror(errno));

--- 123 unchanged lines hidden (view full) ---

1751 return;
1752 case 0:
1753 close(fds[1]);
1754 bundle_LockTun(bundle); /* update pid */
1755 read(fds[0], &done, 1); /* uu_locks are mine ! */
1756 close(fds[0]);
1757 setsid();
1758 bundle_ChangedPID(bundle);
1620 if (lock && (res = ID0uu_lock_txfr(lock, newpid)) != UU_LOCK_OK)
1621 log_Printf(LogERROR, "uu_lock_txfr: %s\n", uu_lockerr(res));
1622
1623 log_Printf(LogDEBUG, "Transmitting link (%d bytes)\n", expect);
1624 if ((got = writev(reply[0], iov + 1, niov - 1)) != expect) {
1625 if (got == -1)
1626 log_Printf(LogERROR, "%s: Failed writev: %s\n",
1627 sun->sun_path, strerror(errno));

--- 123 unchanged lines hidden (view full) ---

1751 return;
1752 case 0:
1753 close(fds[1]);
1754 bundle_LockTun(bundle); /* update pid */
1755 read(fds[0], &done, 1); /* uu_locks are mine ! */
1756 close(fds[0]);
1757 setsid();
1758 bundle_ChangedPID(bundle);
1759 log_Printf(LogDEBUG, "%d -> %d: %s session control\n",
1760 (int)orig, (int)getpid(),
1759 log_Printf(LogDEBUG, "%ld -> %ld: %s session control\n",
1760 (long)orig, (long)getpid(),
1761 holdsession ? "Passed" : "Dropped");
1762 timer_InitService(0); /* Start the Timer Service */
1763 break;
1764 default:
1765 close(fds[0]);
1766 /* Give away all our physical locks (to the final process) */
1767 for (dl = bundle->links; dl; dl = dl->next)
1768 if (dl->state != DATALINK_CLOSED)

--- 240 unchanged lines hidden ---
1761 holdsession ? "Passed" : "Dropped");
1762 timer_InitService(0); /* Start the Timer Service */
1763 break;
1764 default:
1765 close(fds[0]);
1766 /* Give away all our physical locks (to the final process) */
1767 for (dl = bundle->links; dl; dl = dl->next)
1768 if (dl->state != DATALINK_CLOSED)

--- 240 unchanged lines hidden ---