Bug 9010 - usernetctl does not detach - fixed
Summary: usernetctl does not detach - fixed
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Keywords:
: 8978 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-01-31 04:27 UTC by Volker Wysk
Modified: 2014-03-17 02:12 UTC (History)
2 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2000-01-31 17:08:58 UTC


Attachments (Terms of Use)

Description Volker Wysk 2000-01-31 04:27:59 UTC
Hi. I hunted down and fixed a bug that caused /usr/sbin/usernetctl
not to detach after a ppp connection has benn successuflly established.
I'm using initscripts-4.84-1 (rawhide).

It is a bug in /usr/src/redhat/BUILD/initscripts-4.84/src/ppp-watch.c
(/sbin/ppp-watch), in interfaceStatus(): The error return code of socket()
is -1, not 0.

(Also, the man page says, the protocol family should be specified by a
macro beginning with "PF_", not "AF_". But the PF_... are defined as the
AF_... Is this portable?)

Here is the patch:

*** ppp-watch.c-alt	Mon Dec  6 20:18:02 1999
--- ppp-watch.c	Mon Jan 31 05:03:14 2000
***************
*** 373,386 ****
  static int
  interfaceStatus(char *device) {
!     int sock = 0;
!     int pfs[] = {AF_INET, AF_IPX, AF_AX25, AF_APPLETALK, 0};
      int p = 0;
      struct ifreq ifr;
      int retcode = 0;

!     while (!sock && pfs[p]) {
          sock = socket(pfs[p++], SOCK_DGRAM, 0);
      }
!     if (!sock) return 0;

      memset(&ifr, 0, sizeof(ifr));
--- 373,386 ----
  static int
  interfaceStatus(char *device) {
!     int sock = -1;
!     int pfs[] = {PF_INET, PF_IPX, PF_AX25, PF_APPLETALK, 0};
      int p = 0;
      struct ifreq ifr;
      int retcode = 0;

!     while ((sock == -1) && pfs[p]) {
          sock = socket(pfs[p++], SOCK_DGRAM, 0);
      }
!     if (sock == -1) return 0;

      memset(&ifr, 0, sizeof(ifr));

Comment 1 Bill Nottingham 2000-01-31 05:18:59 UTC
*** Bug 8978 has been marked as a duplicate of this bug. ***

Comment 2 Bill Nottingham 2000-01-31 17:08:59 UTC
Will be fixed in initscripts-4.85.


Note You need to log in before you can comment on or make changes to this bug.