Bug 9010 - usernetctl does not detach - fixed
usernetctl does not detach - fixed
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
: 8978 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-01-30 23:27 EST by Volker Wysk
Modified: 2014-03-16 22:12 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-01-31 12:08:58 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Volker Wysk 2000-01-30 23:27:59 EST
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 00:18:59 EST
*** Bug 8978 has been marked as a duplicate of this bug. ***
Comment 2 Bill Nottingham 2000-01-31 12:08:59 EST
Will be fixed in initscripts-4.85.

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